1

I tried to adapt the solution given by Egreg to have Roman numerals over- and underlined (Roman numerals with over- and underline).

However, I run into a problem when I reduce the kerning for Roman numerals (I find it visually nicer). The over- and underlining is not the right width and is offset from the margin.

I don't understand what the problem is due to, because the width of the boxes is well modified according to the value of the kerning.

Would you know how to remedy this problem?

Here is my MWE :

\documentclass[12pt,a4paper]{article}
\usepackage{libertine}
\usepackage{microtype}
\usepackage[showframe]{geometry}

\newsavebox{\thebox} \def\barroman#1{% \sbox{\thebox}{#1}% \dimen\thebox=\dimexpr\wd\thebox+0.5pt\relax% \makebox[\dimen\thebox]{% \rlap{% \vrule width\dimen\thebox% height 0.07ex% depth 0.02ex% }% \rlap{% \vrule width\dimen\thebox% height\dimexpr\ht\thebox+0.01ex\relax% depth\dimexpr-\ht\thebox+0.08ex\relax% }% \kern0.25pt#1\kern0.25pt% }% }

\def\romnumwidth#1{% \sbox{\thebox}{#1}% \dimen\thebox=\dimexpr\wd\thebox% (\the\dimexpr\wd\thebox)% }

\begin{document} \Huge\noindent\kern0.25pt XI\ \barroman{XI} \romnumwidth{XI}\ \barroman{\textls[-30]{XI}} \romnumwidth{\textls[-30]{XI}}\ \barroman{\textls[100]{XI}} \romnumwidth{\textls[100]{XI}} \end{document}

enter image description here

Vincent
  • 20,157
Bastien
  • 449
  • What's the reason for applying \textls? – egreg Jul 19 '20 at 15:11
  • I use this command, from the microtype package, to slightly reduce the space (-0.03 em) between the letters of roman numerals. In my opinion, it's more visually pleasing. – Bastien Jul 19 '20 at 15:37
  • Well, don't. Use explicit kerns: \textls is not suitable for that. And don't use this horrible way to print Roman numerals to begin with. ;-) – egreg Jul 19 '20 at 15:58
  • What would you recommend? :) – Bastien Jul 19 '20 at 16:42

0 Answers0