## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

 Options: Use Classic View Use Monospaced Font Show Text Part by Default Show All Mail Headers Topic: [<< First] [< Prev] [Next >] [Last >>]

 Re: Using d<> and babel with option spanish Jonathan Fine <[log in to unmask]> Fri, 21 Apr 2017 17:32:35 +0100 text/plain (71 lines) Hi Early on, LaTeX sets basic character codes. Perhaps if, at the same time, it also executed     \catcode<13     \expandafter\let\expandafter<\string < then Benedikt 's problem would go way. Or could more easily be solved. I don't see any fundamental reason why this would not work. best regards Jonathan ________________________________ From: Mailing list for the LaTeX3 project <[log in to unmask]> on behalf of Frank Mittelbach <[log in to unmask]> Sent: 21 April 2017 16:35:09 To: [log in to unmask] Subject: Re: Using d<> and babel with option spanish Am 21.04.2017 um 16:49 schrieb Benedikt Vitecek: > For a command I used the argument specifier d<> (which I thought was a > good idea), > which doesn’t work properly in combination with ‚babel‘ and the language > option > ‚spanish‘: > > \documentclass[spanish]{scrartcl} > \usepackage{babel} > \usepackage{xparse} > \NewDocumentCommand \Something { d<> m } > { > Optional: #1 \\ > Mandatory: #2 > } > \begin{document} > \Something{World} > \end{document} the problem is that babel only enables < as an active character after begin document, i.e., when you make that definition in the preamble "<" is still a normal character (\catcode 12 presumably, not checked). After \begin{document} it is an active char and therefore the xparse scanning no longer matches. If you move the definition there your document works as expected. In my opinion there is nothing xparse or expl could do here, it needs a different shorthand interface in babel --- it might be that there is something there to enable shortcuts already in the preamble This is a tricky area as babel hides the fact for a reason: there are probably a good number of packages that would fall over if the mechanism is exposed while they are setting up their internals. Basically, this is an issue with legacy code that is difficult to resolve in a perfect way as long as those interfaces aren't universally available but are added by packages. This is all a bit of hand-waving as I haven't looked at the babel internals for a while; so perhaps Javier or somebody else can give a more accurate answer. frank `