[OS X TeX] Old style numerals with small caps
Josep Maria Font
jmfont at ub.edu
Sun May 6 22:57:15 CEST 2012
Forwarded message from Bruno Voisin:
Le 6 mai 2012 à 11:28, Josep Maria Font a écrit :
> It seems it is more difficult to solve the \oldstylenums issue than to just obtain old style numerals as default with small caps (which is what I was about). For the latter purpose, his advice:
>
>> - To get oldstyle nums in small caps, it seems you need to use LY1 encoding, not T1. Namely, replace
>>
>> \usepackage[T1]{fontenc}
>>
>> by
>>
>> \usepackage[LY1]{fontenc}
>>
>
> has worked like a charm.
To solve these issues, it's needed to look more closely into the working of T1/TS1 (incl. textcomp) and LY1.
On one hand, T1 and TS1 encodings go together: T1 contains contains letters and numbers with focus on providing accented glyphs for most European languages, while TS1 contains the remaining non-alphabetic glyphs (trademark and copyright symbols, dagger and double-dagger, etc.). The fontenc package with option T1 defines accents etc. for the T1 encoding, and the textcomp package introduces the appropriate definitions (\textregistered etc.) for TS1 encoding.
On the other hand is LY1, which contains letters and numbers with less accented glyphs, plus the non-alphabetic glyphs all together in one metrics. The fontenc package with option LY1 introduces the appropriate definitions for LY1 encoding.
Now come the small caps and old-style numbers, for which the two approaches differ:
- For LY1, old-style numbers are the numbers of a separate expert small-caps font. Hence, selecting the small caps font yields automatically old-style numbers. This is the way the Type 1 Lucida fonts are packaged, with lbrsc the small caps font (and lbdsc the associated bold font), and this is also the way the associated LY1 metrics hlhrc8y is constructed.
- For T1/TS1, small caps and old-style numbers are totally separate concepts. Old-style numbers are no longer considered as the proper numbers of an expert small caps font, they are considered instead as exotic non-alphabetic glyphs relegated to the TS1 encoding for the standard (ie non small-caps) font. The small caps T1 metrics hlhrc8t for lbrsc borrows its numbers from the regular lbr font, while the old-style digits are relegated to the TS1 metrics hlhr8c for lbr.
As a result, the solutions to your problem differ:
- Based on T1/TS1: the packages to load are
\usepackage[T1]{fontenc}
\usepackage{textcomp}
You will not get old-style digits in small caps; this is the deliberate way the T1/TS1 metrics for Lucida are designed, and I can think of no workaround. For old-style numbers, you get them automatically by using \oldstylenums in math mode, ie with $\oldstylenums{0123456789}$; to get them also in text, simply add
\DeclareEncodingSubset{TS1}{hlh}{1}
- Based on LY1: the only package to load is
\usepackage[LY1]{fontenc}
and this yields old-style numbers in small caps. For \oldstylenums to work, you need to copy the definition of \oldstylenums from latex.ltx and replace \rmdefault in it by hlcm, yielding
\makeatletter
\def\oldstylenums#1{%
\begingroup
\spaceskip\fontdimen\tw@\font
\usefont{OML}{hlcm}{\f at series}{it}%
\mathgroup\symletters #1%
\endgroup
}
\makeatother
As a consequence, the old-style digits will be taken from the lbmo alternative italic math font.
> Will this change in encoding package have any other side effects ? The packages we work with with some fonts effects that I can think of are lucidabr and textcomp.
Using LY1 instead of T1/textcomp should normally have no side effect. In principle T1/textcomp provides more glyphs than LY1, but in practice I've never encountered any problem with LY1. You can still load textcomp on top of LY1, but I wouldn't advise it.
The differences are elsewhere: the LY1 metrics hlhr8y etc. are the original metrics designed by Y&Y using afm2tfm when packaging the fonts for TeX, while the T1/TS1 metrics were created much later by Walter Schmidt (I think) using fontinst. Hence line breaks etc. may differ when using one or the other.
Personally I have a preference for LY1, for which I find the line breaks more pleasing to the eye (in particular, less hyphenations). That is, of course, very subjective.
Finally here are modified versions of your example for LY1, T1/TS1 and also with the OpenType fonts. The modifications include examples for old-style numbers in italic and bold. Glyph charts for the T1, TS1 and LY1 metrics are also attached.
Hope this helps,
Bruno
PS Would you mind forwarding this message to the OS X TeX list (I'm no longer subscribed, hence cannot post to it)?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samplely1.pdf
Type: application/pdf
Size: 35088 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samplely1.tex
Type: application/octet-stream
Size: 2353 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sampleot.pdf
Type: application/pdf
Size: 20134 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sampleot.tex
Type: application/octet-stream
Size: 2373 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samplet1.pdf
Type: application/pdf
Size: 39804 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samplet1.tex
Type: application/octet-stream
Size: 2227 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0002.obj>
-------------- next part --------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hlhr8c.pdf
Type: application/pdf
Size: 124837 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0003.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hlhrc8t.pdf
Type: application/pdf
Size: 126258 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0004.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hlhrc8y.pdf
Type: application/pdf
Size: 89351 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0dc85b18/attachment-0005.pdf>
-------------- next part --------------
More information about the macostex-archives
mailing list