"Detokenizace" ??

David Necas (Yeti) yeti at physics.muni.cz
Sun May 15 19:32:48 CEST 2005


On Sun, May 15, 2005 at 06:53:43PM +0200, Jaroslav Hajtmar wrote:
> 
> \def\datum{12.5.1995}
> 
> \def\toengldate #1.#2.#3 {{#3-#2-#1}}
> 
> \toengldate 12.5.1995   % funguje spravne (vraci 1995-5-12), nebot "."
> je separatorem mezi jednotlivymi tokeny
> 
> \toengldate \datum      % nefunguje, nebot \datum je jedniny token
> <12.5.1995>

Pomohlo by prostě expandovat nejprve \datum, a pak teprve
\toengldate:

    \expandafter\toengldate\datum

Ovšem vy máte jako koncový separátor mezeru, která to kazí.
Podle okolností mi přijdou jako nejjednodušší řešení

    \def\datum{12.5.1995 }
    \expandafter\toengldate\datum

nebo

    \def\fixme#1{\expandafter\toengldate#1 }
    \fixme\datum

Záleží na tom, jak se to 12.5.1995 do \datum dostává.

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?




More information about the csTeX mailing list