9

I have already read much about LaTeX3 on TeX.SE, in TeX Live’s documentation and in TUGBoat, but there is something I do not yet understand: is the expl3 syntax meant to be used in document-level commands?

I would be truly delighted if it was possible to include the caracthers : and _ in command names defined with \newcommand or an equivalent LaTeX3 definition construct. That would bring “namespaces in the document”, so to speak, and generally make commands more readable (in my opinion). Since I always have to work with XML and HTML in my professional life, I would like to make my LaTeX markup more similar to XML’s elements and attributes, at least superficially.

Going further down this line of thinking, a side question is: is it somehow possible to use non-ASCII letters in LaTeX3 command names?

P.S.: Yes, I do pursue the foolish dream of semantic markup in LaTeX :-).

11

No, that is to misunderstand the idea more or less completely :-) The 'long term vision' is that the 'machinery' is coded in expl3, while one interface is provided using LaTeX2e-like commands as at present. Note that one aim is to allow alternative interface layers backed by the same code: you might implement one of those of course.

You can use non-'letter' characters in command names, for example in 'classical' TeX:

\expandafter\def\csname some-awkward-1-2-3-name\endcsname

or in expl3:

\cs_set:cpn { some-awkward-1-2-3-name } 

but accessing those 'readily' is not easy as TeX's rules mean that what is a 'letter' is important. Those rules can't be altered by macro packages, which includes expl3, so they remain in place.

|improve this answer|||||
  • I must thank you! This is exactly what I needed to hear. You see, even by documenting myself and trying to get the gist of LaTeX3, I had not gotten that, which is fundamental. As for a satisfying alternative, I was already aware of this question about formatting and semantics, where the accepted answer gives great insights, but I still wanted to ask my naïve question just to make sure. – Christian Gagné Jan 7 '14 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.