Sender: |
|
Date: |
Sun, 23 Apr 2017 11:37:19 +0200 |
Reply-To: |
|
Message-ID: |
|
Subject: |
|
MIME-Version: |
1.0 |
Content-Transfer-Encoding: |
7bit |
In-Reply-To: |
|
Content-Type: |
text/plain; charset=utf-8; format=flowed |
From: |
|
Parts/Attachments: |
|
|
Am 23.04.17 um 10:50 schrieb Benedikt Vitecek:
> This is only a rough idea and I would need to figure out how to implement it, but it could solve (at least
> for me) the category code problem.
as I expected, babel does have an option to enable the shorthands
already in the preamble:
[KeepShorthandsActive]
however, as I also expected that doesn't work in all cases as packages
loaded afterwards may have a problem with that.
So
\usepackage{xparse}
\usepackage
[KeepShorthandsActive]
{babel}
solves your problem but if babel is loaded before xparse, that will break.
On the other hand, what might be enough in your case is simply changing
the catcode of < and > before making your definition since we know that
it will be active by the time of begin document (ie when your definition
is used):
\documentclass[spanish]{scrartcl}
\usepackage{xparse}
\usepackage{babel}
\catcode`\< = 13
\catcode`\> = 13
\NewDocumentCommand \Something { d<> m }
{
Optional: #1 \\
Mandatory: #2
}
\catcode`\< = 12
\catcode`\> = 12
\begin{document}
\Something<Hello>{World}
\end{document}
Of course that only works because we know that spanish will activate
them, so this is not robust in a general way.
Guess the correct answer is drawingboard and make xparse babel aware and
long term a better shorthand interface / integration
frank
|
|
|