Consider the following example. (The code is not my own.)




% Subscript text directly in math mode.
\AtBeginDocument{\catcode`\_=12 \mathcode`\_=32768 }




  \MoveEqLeft \price_|total| - \price_|Water park, total|\\
  &= 7 \cdot \price_|hotel, total| + 14 \cdot \price_|adult|(\text{food}) + 14 \cdot \price_|child|(\text{food})\\
  &\hphantom{{}=} - \price_|Water park, total|\\
  &= \SI{2069.00}{\kroner} - \price_|Water park, total|.





(a) In the second line there is missing a space between the first + and 14. How do I fix this?

(b) In the last line is there too much space between the subscript total and the .? If there is, how do I fix this?


Another question: Is it a difference whether or not there is a blank space between 32768 and } in the code?

I haven't been abel to defect any differences myself when making a few examples.


1 Answer 1


This is just you'd get from any

Op Binary Ord

sequence. A binary operation symbol following an operator is treated as an ordinary. The same would happen with \sin-x.

There's no reason for definining \price with \DeclareMathOperator, because it's a variable.


will give the correct shape and no spacing problem.

enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .