LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type: text/plain; charset=utf-8
Date: Sun, 23 Apr 2017 10:50:39 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Benedikt Vitecek <[log in to unmask]>
Message-ID: <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Transfer-Encoding: quoted-printable
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (42 lines)
> What happens if you do your definition \AtBeginDocument?  Does babel
> turn on shorthands too late for that?

I’ve tried it before and sadly it doesn’t work and produces the same output:

  \NewDocumentCommand \Something { d<> m }
      Optional: #1 \\
      Mandatory: #2 \\

> Here at some point the
> command you define must grab an argument delimited by ">".  Given how
> TeX works, we need to know what category code this ">" will have.  In
> principle it could be conceivable to do that depending on the category
> code of the "<" that started the argument, or depending on the current
> category code of ">"

I am glad that this is the first (maybe second) time I have to deal with category codes, 
it seems to be quite complicated.

I think what I might be able to do locally is to check if the „m“ argument grabs the token
„<„ (which I should be able to test with \str_if_eq:nn {#2} { < } ), define a macro which collects the 
next tokens until it encounters a „>“ (again tested with \str_if_eq:nn) and then maybe call my
main command again.

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.