Difference between revisions of "Math spacing"

From Wiki
Jump to navigation Jump to search
(Describe math spacing)
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
TeX handles math spacing by breaking a formula into parts, and assigning each of those parts a role such as 'Ord' (a variable or number) or 'Rel' (equality, larger than, et cetera). For each combination of roles, it then looks up the spacing appropriate between them in a table. These are the roles:
 
TeX handles math spacing by breaking a formula into parts, and assigning each of those parts a role such as 'Ord' (a variable or number) or 'Rel' (equality, larger than, et cetera). For each combination of roles, it then looks up the spacing appropriate between them in a table. These are the roles:
  
{|
+
{| class=wikitable
 
| Ord || e.g. ''4'' or ''a'' or ''x<sup>2</sup>''
 
| Ord || e.g. ''4'' or ''a'' or ''x<sup>2</sup>''
 
|-
 
|-
Line 20: Line 20:
 
|}
 
|}
  
To set up e.g. the spacing between ordinal items, do as follows{{since|2012|dec 2012}}:
+
To set up e.g. the spacing between ordinal items, do as follows (since dec 2012):
  
 
  \startsetups math:morespacing
 
  \startsetups math:morespacing
Line 28: Line 28:
 
  \setupmathematics
 
  \setupmathematics
 
   [setups=math:morespacing]
 
   [setups=math:morespacing]
 +
 +
[[Category:Math]]

Latest revision as of 17:24, 8 June 2020

TeX handles math spacing by breaking a formula into parts, and assigning each of those parts a role such as 'Ord' (a variable or number) or 'Rel' (equality, larger than, et cetera). For each combination of roles, it then looks up the spacing appropriate between them in a table. These are the roles:

Ord e.g. 4 or a or x2
Op Unary operators such as sin or ln.
Bin Binary operators such as '+'
Rel Relationships such as '=' or '>' or '\implies'
Open open brackets of any kind
Close closing brackets of any kind
Punct Punctuation: digit separators like '.' or ','.
Inner Fractions are inner. What else is inner?

To set up e.g. the spacing between ordinal items, do as follows (since dec 2012):

\startsetups math:morespacing
    \ordordspacing\textstyle 1mu plus .5mu minus .25mu\relax
\stopsetups
\setupmathematics
  [setups=math:morespacing]