LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Content-Type: text/plain; charset=UTF-8
Date: Fri, 21 Apr 2017 17:32:35 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
Content-Transfer-Encoding: quoted-printable
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Jonathan Fine <[log in to unmask]>
Parts/Attachments: text/plain (71 lines)

Early on, LaTeX sets basic character codes. Perhaps if, at the same
time, it also executed

    \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


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<Hello>{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.