6
votes
2answers
47 views

What Pascal procedure inserts \mathon and \mathoff?

TeX surrounds inline math formulae with \mathon and \mathoff, which appear to be nodes. For instance, running TeX on $ $\showlists\bye gives ### horizontal mode entered at line 0 \hbox(0.0+0.0)x20.0 ...
2
votes
1answer
46 views

Substitute characters in text-mode with their math equivalent

I'm looking for a TeXway to substitute - (or other characters) while in text-mode with their math equivalent (i.e. $-$) in one environment/group. I'm looking for a 'switch' (\foo # and not \foo{#}). ...
4
votes
2answers
118 views

How to define a command \exponent that transforms $\exponent^e$ to $a^eb^ec^e$?

I have tried to define a command $\exponent$ that would look for next exponent and would put a copy of this exponent after a, another after b and a last one after c. $\exponent^e$ would transform to ...
9
votes
3answers
317 views

How to force LaTeX only commands?

Recently, I learned that for a long time I have been doing all of my mathematics in LaTeX incorrectly! I was using the $ TeX commands instead of the \( and \) LaTeX commands! I immediately went back ...
6
votes
2answers
588 views

Left-aligned display math mode

How could one achieve, as primitively as possible, left-aligned display math so that \abovedisplayshortskip would still work as intended? It is my understanding that one can achieve left-alignment ...
18
votes
1answer
303 views

Drawbacks of redefining math accents with extra leading {}?

As I discovered through the non-bug latex/4253, TeX has a (mis)feature whereby it ignores braces around a \mathaccent construction: ${a_b}_c$ works, but ${\tilde a_b}_c$ fails with a "Double ...
8
votes
2answers
123 views

\setbox containing maths interferes with surrounding math mode in XeTeX

I encountered what might be a bug in XeTeX (but I would be glad to be proven wrong) while chasing a strange interaction between bytefield, unicode-math, and mathtools. In general, I do not expect a ...
15
votes
3answers
1k views

Difference between \mskip and \mkern

What are the differences between \mskip and \mkern? The TeXbook writes the following (ch. 18): You can insert math glue into any formula just by giving the command ‘\mskip⟨muglue⟩’. [...] ...
10
votes
2answers
205 views

Determining the math class of a non-keyboard symbol

What is the "right" way of determining the math class (e.g. ordinary/0, relation/3, closing/5, etc.) of a non-keyboard symbol? Something like \oplus is easy enough to guess, but I wasn't immediately ...
8
votes
1answer
199 views

Why doesn't \mathord work to turn an Acc atom into Ord?

Writing ${\dot X^a}^b$ produces a very cryptic "double superscript" error: this has been explained here on this forum: the reason is that {\dot X}^a generates an Acc atom and that, for a reason that ...
1
vote
0answers
44 views

How to break long expressions automatically in displaymode? [duplicate]

Whenever an expression is too long, it will be broken automatically in inline mode but done nothing in displaymode E.g. MWE: \documentclass[11pt]{article} \begin{document} ...
11
votes
2answers
242 views

How does math mode work?

When writing an a in TeX, it is typeset as an upright "a" by default. When writing an a in math mode it is typeset in italics. Furthermore, in math mode white spaces are ignored and no empty lines ...
4
votes
1answer
256 views

Math font change for subscript only

Goal: I want a macro that changes the math font of only subscript and superscript. In TeX terms, I think this means I want to change only S, S' styles, which are typeset using scriptfont. ...
14
votes
1answer
191 views

Can one determine the first character of a given math list?

I'm still pursuing my quest to code a better \widebar command. I can do bars over single characters quite well already, but I have problems when it comes to letter combinations such as AW. ...
25
votes
1answer
543 views

What exactly is a “single character” or “symbol” in math mode?

There are at least three instances where single symbols in math mode receive a special treatment by the TeX engine: 1. when accents are placed, 2. when a math operator is created with ...
13
votes
1answer
213 views

How to find out if a math list consists of a single character?

When accents are placed, the TeX engine gives single characters a special treatment; see the TeXbook, Rule 12 on page 443. See also this question and its accepted answer for details. Thus, ...
5
votes
1answer
93 views

Preventing atoms from changing kind

In the example below, the presence of \mycommand changes the first minus sign into a binary operation atom, so that the spacing between - and 1 is increased. \documentclass{article} ...
9
votes
2answers
204 views

Hooks into mathmode

Short version Is there a way to pipe every symbol in a math environment unevaluated to an external program w/o manipulating the (La)TeX file directly (except for adding header files) or patching TeX ...
7
votes
1answer
268 views

Why is there no \mudimendef primitive?

The TeXbook defines in chapter 24 (page 270 in my edition) the notion of <dimen>, <skip>, <mudimen> and <muskip>, the first two being used in horizontal and vertical mode, ...
7
votes
3answers
356 views

Making mathmode obey spaces

I know this is kind of blasphemic thing to ask, but is there a way to make mathmode obey spaces? Preferably in Plain with XeTeX.
4
votes
2answers
752 views

Problem with \mathpalette and \mathchoice

When working on an additional answer to this question of mine, I stumbled across the following problem with \mathpalette. For simplicity I give an example where in practice it is ridiculous to use ...
13
votes
4answers
461 views

How does one change the math style to one of the “primed” styles?

Background TeX typesets each portion of a mathematical expression in one of 8 styles: display, display', text, text', script, script', scriptscript, or scriptscript'. Knuth calls them, D, D', T, ...