What do \m@ne and \@M do in the definition of \@makechapterhead in book class?
I took a quick look at latex.ltx and couldn't find any explanation.
Asked
Active
Viewed 3,675 times
11
lockstep
- 250,273
Vahid Damanafshan
- 6,925
2 Answers
14
\m@ne stands for minus one, i.e. is a count register with a fixed value of -1, which is used for efficiency reasons over a literal -1.
\@M is defined using \mathchardef and equal to \mathchar"2710, i.e. 10000, and is used for the same reasons like above.
See the question \@ne \tw@ \thr@@ for more details on the reasons.
See also Documentation reference for LaTeX internal commands? for a list of further similar macros. I also can recommend you latexdef (or texdef -t latex) to test for the definitions of such macros, e.g. latexdef m@ne @M will give you the definition and numerical values of these two macros.
Martin Scharrer
- 262,582
-
Why doesn't one use the same -1 instead of
\m@ne? Isn't\m@neconfusing? – Vahid Damanafshan Dec 26 '11 at 23:27 -
3It's used mainly for efficience (one token instead of two), but also because it avoids possible premature expansion of tokens after it. – egreg Dec 26 '11 at 23:29
5
The file latex.ltx is the correct one.
At line 316 you find \m@ne:
\countdef\m@ne=22 \m@ne=-1
At line 300 you find \@M:
\mathchardef\@M=10000
Werner
- 603,163
Marco Daniel
- 95,681
\m@neis the constant-1, while\@Mstands for10000. – egreg Dec 26 '11 at 23:18