LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Morten Høgholm <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Mon, 26 Apr 2004 12:03:20 +0200
text/plain (77 lines)
Hi all,

Recently I've been playing with templates and the new internal syntax. One
thing I did think about with the internal syntax was the ability to turn
it off again at will. One reason was that I needed to load amsmath and be
able to pass options to it, so I couldn't say


as this wouldn't pass the options, but instead had to do it with


Unfortunately this results in an infinite loop created by \GenericInfo
 from amstext (\iffirstchoice@ is equal to \iftrue by default and this goes
horribly wrong).

In order to work around this I decided to do things a little differently:

\def\InternalSyntaxError{\errmessage{Invalid use of command}}
       \catcode`\noexpand\ =\the\catcode`\ \relax
     \catcode`\ =9\relax
     \endlinechar=` %

This way I got a pair of commands I could use to turn the internal syntax
on and off, sort of like for \makeatletter and \makeatother, only this new
set is able to restore the original meaning of catcodes and provides error
checking, so that you don't put two \InternalSyntaxOn after each other and
similar stupidities. I think the off-switch
could easily be integrated into \@onefilewithoptions and somewhere in
\document just so that package authors and hackers don't have to remember
to switch it off themselves.

Any comments on this (pros and cons)?
Morten Høgholm