[Mac OS X TeX] BBEdit syntax coloring

Sime Ungar ungar at math.hr
Thu Nov 1 18:01:01 CET 2001



<x-flowed>>>It is not recommended to use $ in tex source code because it is a tex
>>primitive.
>>instead use \( and \[
>
>A problem with \(, as opposed to the "equivalent" $, is that it's 
>fragile and requires protection.
>
>Suppose you want a section named "The alpha-example", and a table of contents.
>
>- If you write \section{The $\alpha$-example} then the following 
>line is written to the .toc file:
>
>\contentsline {subsection}{\numberline {3.2.}The $\alpha $-example}{22}
>
>and nothing bad happens.
>
>- If you write \section{The \(\alpha\)-example} then you get the 
>error message:
>
>! LaTeX Error: Bad math environment delimiter.
>[...]
>l.8 ...turn> to continue without it.}-example}{22}
>
>and, after entering scrollmode, the following line is written to the 
>.toc file:
>
>\contentsline {subsection}{\numberline {3.2.}The \relax $\alpha 
>\relax \GenericError { }{LaTeX Error: Bad math environment 
>delimiter}{See the LaTeX manual or LaTeX Companion for 
>explanation.}{Your command was ignored.\MessageBreak Type I 
><command> <return> to replace it with another command,\MessageBreak 
>or <return> to continue without it.}-example}{22}
>
>Clearly not what you want!
>
>- If you write \section{The \protect\(\alpha\protect\)-example} then 
>the following line is written to the .toc file:
>
>\contentsline {subsection}{\numberline {3.2.}The \(\alpha \)-example}{22}
>
>and all's well again - but not very handy!
>
>>but anyone is free
>
>It's for avoiding that kind of problem, I guess, that people often 
>prefer to stick to $ $ constructs.
>
>Bruno Voisin
>

And also because, in the input file, $...$ and even more so $$...$$ 
is so much more conspicuous than \(...\) or \[...\].

Besides, when the line preceeding the displayed math is short, 
spacing (abovedisplayskip) with $$...$$ and \[...\] is different.

Sime Ungar

-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------

</x-flowed>




More information about the macostex-archives mailing list