Skip to content

Commit 4cea882

Browse files
authored
[macros] In \ucode, align size of digits and letters (#5211)
* [macros] In \ucode, improve sizes of digits and letters. We do this by typesetting letters in small-caps of the body font, and digits using the font "smaller by 1 step" (e.g. 10pt -> 8pt). This combination seems to look perfectly harmonious for normal body text and notes. This works around the absence of "small-caps sized lining numerals" in Latin Modern. The fact that LMR has separate optical sizes for the size range in question makes this combination work well.
1 parent fc9818b commit 4cea882

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

source/macros.tex

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,37 @@
360360
\renewcommand{\fref}[1]{\hyperref[fig:#1]{\figurerefname \nolinebreak[3] \ref*{fig:#1}}}
361361

362362
%% NTBS, etc.
363-
\newcommand{\ucode}[1]{\textsc{u}\textsmaller[1.5]{\kern-0.05em\protect\raisebox{.25ex}{\textsmaller[1]{+}}\uppercase{#1}}}
363+
\verbtocs{\StrTextsmaller}|\textsmaller[1]{|
364+
\verbtocs{\StrTextsc}|\textsc{|
365+
\verbtocs{\StrClosingbrace}|}|
366+
\newcommand{\ucode}[1]{%
367+
\textsc{u}%
368+
\textsmaller[2]{\kern-0.05em\protect\raisebox{.25ex}{+}}%
369+
\begingroup%
370+
\def\temp{#1}%
371+
\StrSubstitute{\temp}{0}{X0Z}[\temp]%
372+
\StrSubstitute{\temp}{1}{X1Z}[\temp]%
373+
\StrSubstitute{\temp}{2}{X2Z}[\temp]%
374+
\StrSubstitute{\temp}{3}{X3Z}[\temp]%
375+
\StrSubstitute{\temp}{4}{X4Z}[\temp]%
376+
\StrSubstitute{\temp}{5}{X5Z}[\temp]%
377+
\StrSubstitute{\temp}{6}{X6Z}[\temp]%
378+
\StrSubstitute{\temp}{7}{X7Z}[\temp]%
379+
\StrSubstitute{\temp}{8}{X8Z}[\temp]%
380+
\StrSubstitute{\temp}{9}{X9Z}[\temp]%
381+
\StrSubstitute{\temp}{a}{YaZ}[\temp]%
382+
\StrSubstitute{\temp}{b}{YbZ}[\temp]%
383+
\StrSubstitute{\temp}{c}{YcZ}[\temp]%
384+
\StrSubstitute{\temp}{d}{YdZ}[\temp]%
385+
\StrSubstitute{\temp}{e}{YeZ}[\temp]%
386+
\StrSubstitute{\temp}{f}{YfZ}[\temp]%
387+
\StrSubstitute{\temp}{X}{\StrTextsmaller}[\temp]%
388+
\StrSubstitute{\temp}{Y}{\StrTextsc}[\temp]%
389+
\StrSubstitute{\temp}{Z}{\StrClosingbrace}[\temp]%
390+
\tokenize\temp{\temp}%
391+
\temp%
392+
\endgroup%
393+
}
364394
\newcommand{\uname}[1]{\textsc{#1}}
365395
\newcommand{\unicode}[2]{\ucode{#1} \uname{#2}}
366396
\newcommand{\NTS}[1]{\textsc{#1}}

source/std.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
\usepackage[active,header=false,handles=false,copydocumentclass=false,generate=std-gram.ext,extract-cmdline={gramSec},extract-env={bnf,simplebnf}]{extract} % Grammar extraction
4848
\usepackage{expl3}
4949
\usepackage{xparse}
50+
\usepackage{xstring}
5051

5152
\pdfminorversion=5
5253
\pdfcompresslevel=9

0 commit comments

Comments
 (0)