[XeTeX] Roman Numerals as stylistic alternatives

Ross Moore ross.moore at mq.edu.au
Tue Jun 21 22:53:37 CEST 2011


Hi Enrico,

On 22/06/2011, at 5:23 AM, enrico.gregorio at univr.it wrote:

> From: enrico.gregorio at univr.it
> 
>> I'll think to a way for adding the /ActualText to the macros I 
>> showed you.
> 
> There is a way, via the accsupp package by Heiko Oberdiek:
> 
> ===
> \documentclass{article}
> \usepackage{fontspec}
> \setmainfont[Ligatures=TeX]{DejaVu Serif}
> 
> \usepackage{accsupp}
> \makeatletter
> \def\@URomanx#1{\ifcase#1\or
>  Ⅰ\or Ⅱ\or Ⅲ\or Ⅳ\or Ⅴ\or Ⅵ\or Ⅶ\or Ⅷ\or Ⅸ\or Ⅹ\or Ⅺ\or Ⅻ\else
>  \expandafter\@slowURoman\romannumeral #1@\fi}
> \def\@slowURoman#1{\ifx @#1% then terminate
>     \else
>       \if i#1Ⅰ\else\if v#1Ⅴ\else\if x#1Ⅹ\else\if
>       l#1Ⅼ\else\if c#1Ⅽ\else\if d#1Ⅾ\else \if
>       m#1Ⅿ\else#1\fi\fi\fi\fi\fi\fi\fi
>       \expandafter\@slowURoman
>     \fi
> }
> \def\@Uromanx#1{\ifcase#1\or
>  ⅰ\or ⅱ\or ⅲ\or ⅳ\or ⅴ\or ⅵ\or ⅶ\or ⅷ\or ⅸ\or ⅹ\or ⅺ\or ⅻ\else
>  \expandafter\@slowUroman\romannumeral #1@\fi}
> \def\@slowUroman#1{\ifx @#1% then terminate
>     \else
>       \if i#1ⅰ\else\if v#1ⅴ\else\if x#1ⅹ\else\if
>       l#1ⅼ\else\if c#1ⅽ\else\if d#1ⅾ\else \if
>       m#1ⅿ\else#1\fi\fi\fi\fi\fi\fi\fi
>       \expandafter\@slowUroman
>     \fi
> 
> 
> \ordinal{999}
> \end{document}
> ===
> 
> Works with AR 9, though not perfectly in the selections.
> 
> Ciao
> Enrico
> 
> --
> Enrico Gregorio          + Dipartimento di Informatica          + Tel: +39 045 8027937
> Enrico.Gregorio at univr.it + Università degli Studi di Verona     +
> (gregorio at math.unipd.it) + Strada le Grazie 15 / I-37134 Verona + Fax: +39 045 8027928
> 
> 
> 
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



More information about the XeTeX mailing list