[texhax] typset mistranslates the anglbrackets

Uwe Lück uwe.lueck at web.de
Tue Mar 19 23:57:19 CET 2013


Am Dienstag, den 19.03.2013, 23:04 +0100 schrieb Reinhard Kotucha:
> On 2013-03-19 at 14:13:46 +0100, Uwe Lück wrote:
> 
>  > Practical recommendations:
>  > 
>  > I sometimes use \angled{...} instead of $\langle$...$\rangle$, 
>  > after \def\angled#1{$\langle$#1$\rangle$} or 
>  > \newcommand*\angled[1]{$\langle$#1$\rangle$}.
>  > 
>  > If the mathematical relation symbol is not needed at all, 
>  > <...> may yield good typography after
>  > 
>  >     \catcode`\<\active \def<#1>{$\langle$#1$\rangle$}
> 
> It's possible to write something like 
> 
>   \catcode`\<=13
>   \def<{\ifmmode\char60\relax\else$\langle$\fi}
> 
> but you have to hide stuff using \ifdim or \ifnum in macros before.

Everything using < in \ifdim and \ifnum must happen earlier, 
i.e., macro definitions using them. My niceverb package offers 
commands to switch on/off such a syntax explicitly ...
when you are sure ... (e.g., somewhere \AtBeginDocument with LaTeX).

As to \ifmmode, I also thought of 

    \everymath\expandafter{\the\everymath\let<\lt}

After looking at manmac.tex (my earlier posting), I prefer 

    \def\angled#1{\leavevmode\hbox{$\langle$#1\/$rangle$}}

while I still have not understood \/ entirely 
("provisional" for the case of \it?)

Cheers,

    Uwe.





More information about the texhax mailing list