[OS X TeX] Creating a new composite symbol in LaTeX

George Gratzer gratzer at me.com
Wed Nov 9 07:17:18 CET 2011


There is more in More Math into LateX than I am aware of.


On 2011-11-09, at 12:40 AM, Richard Seguin wrote:

> This is a LaTeX trick that I thought I should pass on.
> I recently wanted to use the \preccurlyeq symbol, but I also needed a negated version of it, and there is no negated version in the LaTeX or AMS symbol sets. (There are a couple of symbols that mean \preccurlyeq and not =, but that's not a full negation.) I wondered if I could make LaTeX move a / backwards on top of a \preccurlyeq, and so I first created a macro for the symbol I would call \notpre:
> \newcommand{\notpre}{\;\preccurlyeq \negthickspace \negthickspace \negmedspace \negthinspace / \mbox{ }\,}
> It looked great and it seemed to be absolutely stable with font size changes, but then I ran into a problem. If LaTeX had to significantly compress or expand inter-character spaces to justify a line, the / moved around a little bit on top of the \preccurlyeq, meaning that LaTeX was also compressing or expanding the negative spaces that I defined. So I dug into More Math into LaTeX for a while and discovered that if you wrap something in a math environment with { … }, it "tokenizes" everything within the curly brackets and no compression or expansion will take place on inter-charcter spaces (or negative spaces). So, finally I tried
> \newcommand{\notpre}{\;{\preccurlyeq \negthickspace \negthickspace \negmedspace \negthinspace /}\mbox{ }\,}
> and it worked perfectly! It is possible that the negative spacing might have to be tweaked a little if you use font symbol sets other than standard CM.
> Richard Séguin----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

More information about the macostex-archives mailing list