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

Don Green Dragon fergdc at Shaw.ca
Thu Nov 17 07:53:48 CET 2011


Hi Everyone,

On 09Nov2011, at 6:35 AM, Nestor Aguilera wrote:

> 
> On 9 Nov 2011, at 02:40, 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
> 
> There is also the package "centernot". Have you tried it?

The following is rather simple minded and the idea is stolen from Graetzer's book. Try placing \not just before the character, as in

	$\not\preccurlyeq$

which produces a glyph which looks reasonable (to me). I use $\not\simeq$  lot and define it by

\newcommand{\ncet}[0]{\ensuremath{\not\simeq}}	% is Not Cardinally Equivalent To

You can move the forward slash around (left or right), if not satisfied, in the manner shown by Richard.


Don Green Dragon
fergdc at Shaw.ca





More information about the macostex-archives mailing list