[OS X TeX] Scandinavian {\aa} ??

Ross Moore ross at ics.mq.edu.au
Mon Mar 24 21:56:24 EDT 2008


Hi all,

On 25/03/2008, at 12:34 PM, Martin Costabel wrote:

> Bruce Kellogg wrote:
>> It is strange: when I process the file
>> \documentclass[10pt,oneside,leqno]{article}
>> \def \r{\rho}

   Oh no!  ...

>> \begin{document}
>> G{\aa}rding
>>  \end{document}
>> I get an error message, and if I type "q" in the dialog box, I get  
>> a misspelt Garding with
>> a Greek rho inserted. On the other hand, when I process the file
>> \documentclass[10pt,oneside,leqno]{article}
>> %\def \r{\rho}
>> \begin{document}
>> G{\aa}rding
>>  \end{document}
>> there is no error message and I get what I expect.
>
> I guess this is an example for why they recommend to use  
> \newcommand in latex instead of \def. With \newcommand you would  
> have got an error message telling you
>
> ! LaTeX Error: Command \r already defined.

  ... and it is also an example of why you should not use
1-letter names for your own personal macros.

There is too great a possibility of conflicting with
something already defined -- in particular an accent
or diacritic mark used primarily with other (i.e.
non-English) languages.

It is unwise to use even 2-letter command names without care.

Grätzer mentions this, as Rule 2 on p.416 of his book.

>
> Indeed, in latex.ltx you can find the line
>
> \def \aa {\r a}
>
> -- 
> Martin


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the MacOSX-TeX mailing list