Difference between revisions of "Command/setupformulae"

From Wiki
Jump to navigation Jump to search
(→‎Example: add Hans' example from mailman.ntg.nl/pipermail/ntg-context/2021/101671.html)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupformulae</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 76: Line 79:
 
     <td class="cmd">[[Command/keyword:numberconversion|numberconversion]]</td>
 
     <td class="cmd">[[Command/keyword:numberconversion|numberconversion]]</td>
 
     <td>[[Command/value:numbers|numbers]] [[Command/value:characters|characters]] [[Command/value:Characters|Characters]] [[Command/value:romannumerals|romannumerals]] [[Command/value:Romannumerals|Romannumerals]] [[Command/value:text|text]] </td>
 
     <td>[[Command/value:numbers|numbers]] [[Command/value:characters|characters]] [[Command/value:Characters|Characters]] [[Command/value:romannumerals|romannumerals]] [[Command/value:Romannumerals|Romannumerals]] [[Command/value:text|text]] </td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">...=...,...</td>
 +
    <td>inherits from {{cmd|setupcounter}}</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 86: Line 93:
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
In order to show all section numbering in the formula, one can use the prefixset option (by default it is limited to 3 levels, see strc-def) as follows:
 +
 
 +
<context source=yes>
 +
\setupcounter[formula][way=bytext]
 +
\setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]
 +
 
 +
\startchapter[title=Chapter]
 +
\dorecurse{4}{
 +
\startsection[title=Section]
 +
\startsubsection[title=Subsection]
 +
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2 \stopformula \stopplaceformula
 +
\stopsubsection
 +
\startsubsection[title=Subsection]
 +
\startplaceformula[reference=eq2] \startformula c^2 = a^2 + b^2 \stopformula \stopplaceformula
 +
\stopsubsection
 +
\stopsection
 +
}
 +
\stopchapter
 +
 
 +
\placelist[formula][criterium=all,alternative=c]
 +
</context>
  
 
== See also ==
 
== See also ==

Latest revision as of 17:30, 21 March 2021

\setupformulae

Syntax (autogenerated)


Syntax

\setupformulae[...,...=...,...]
color name
location left right
left text
right text
align flushleft middle flushright
option middle
strut yes no
distance dimension
margin dimension standard yes no
leftmargin dimension
rightmargin dimension
indentnext yes no
alternative name
spacebefore dimension
spaceafter dimension
separator text
numberconversion numbers characters Characters romannumerals Romannumerals text
...=...,... inherits from \setupcounter

Description

Using option [way=bysection] resets the numbering to 1 at each new section, but does not prefix the numbers with the section number, to do that, use the following options: \setupformulae[way=bysection,prefixsegments=section]

Example

In order to show all section numbering in the formula, one can use the prefixset option (by default it is limited to 3 levels, see strc-def) as follows:

\setupcounter[formula][way=bytext]
\setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]

\startchapter[title=Chapter]
\dorecurse{4}{
\startsection[title=Section]
\startsubsection[title=Subsection]
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2 \stopformula \stopplaceformula
\stopsubsection
\startsubsection[title=Subsection]
\startplaceformula[reference=eq2] \startformula c^2 = a^2 + b^2 \stopformula \stopplaceformula
\stopsubsection
\stopsection
}
\stopchapter

\placelist[formula][criterium=all,alternative=c]

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: