I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Products » LaTeX Equation Editor »

Nice Display Bug (not imortant)

stephem\′s Photo
26 Jan 11, 10:18AM
Nice Display Bug (not imortant)
This is a fascinating bug which is caused by the underlying TeX engine not the CodeCogs implementation of it. You can reproduce the bug in a document by using
$\displaystyle\mathbf{\textbf{\bigotimes}}$
which results in 44 errors!

The cause of the error is that \bigotimes must be in maths mode but
\textbf{\bigotimes}
puts it in text mode. You can see this if you type
\mathbf{\textbf{\ensuremath{\bigotimes}}}
and the bug disappears.

Of course the question is why does this cause such an odd display of 4 different fonts? The answer lies deep inside TeX. It's really the \text command that's causing the problem as it adjusts the font according to whether the contents are subscripts, superscripts etc. It does this using \mathchoice.

The details are given in Knuth's TeXbook (Knuth is the author of TeX of course):

TeX has a special feature called \mathchoice that comes to the rescue in such situations: You write

\mathchoice{<math>}{<math>}{<math>}{<math>}

where each < math > specifies a subformula. TeX will choose the first subformula in style D or D', the second in style T or T', the third in style S or S', the fourth in style SS or SS'. (TeX actually typesets all four subformulas, before it chooses the final one, because the actual style is not always known at the time a \mathchoice is encountered; for example, when you type '\over' you often change the style of everything that has occurred earlier in the formula.

(D,D' = displaystyle, T,T' = textstyle, S,S' = scriptstyle, SS,SS' = scriptscriptstyle; D',T',S',SS' are cramped versions which don't raise exponents so much but are otherwise the same)

It's clear then that TeX never makes a choice due to the errors so leaves the 4 styles there, which explains the different font sizes.

Currently you need to be logged in to leave a message.