2

I have acronyms with slash in them, like ISO/IEC and I'd like to write them in small caps. The problem is that the slash is quite a bit taller than the letters.

  1. OT: Is this really a typographic problem or not? Should I just live with a bit tall slash?
  2. Main question: is there a proper/easy way to have a "small cap slash" in the middle? If there is a good font that achieves this, please recommend one.

I'm using now baskervaldx package for the font. And this is the MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[osf]{Baskervaldx}
\begin{document}
\textsc{iso/iec} with a bit too tall slash.
\end{document}
2

Here, I vertically downsize the text slash to the height of a \textsc{e} in the current font size. (note: since scalerel processes arguments in math mode by default, using a $/$ actually processes the slash in text mode).

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[osf]{Baskervaldx}
\usepackage{scalerel}
\newcommand\scslash{\stretchrel*{$/$}{\textsc{e}}}
\begin{document}
\textsc{iso/iec} with a bit too tall slash.

\textsc{iso\scslash iec} with a downsized slash.

\LARGE
\textsc{iso/iec} with a bit too tall slash.

\textsc{iso\scslash iec} with a downsized slash.
\end{document}

enter image description here

The above implementation preserves the glyph width and shrinks the vertical height. If one wanted the same slant and a narrower glyph, changing the \stretchrel to a \scalerel would accomplish that:

enter image description here

  • Great, thanks! The \scalerel version produces very good results! Not sure which one on these is typographically the "correct" one but this looks anyway a lot better than the default slash. – Paapaa Jul 19 '16 at 18:52
  • @Paapaa Keeping the same slant (\scalerel) is probably more preferred except that it also thins out the glyph's rule thickness, which is not preferable. But unless one redesigns such a glyph into the font set, your options are along either of these lines. – Steven B. Segletes Jul 19 '16 at 18:59
1

You can use a command for the slash:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[osf]{Baskervaldx}
\usepackage{xpatch}

\newcommand{\textslash}{/}
\makeatletter
\DeclareRobustCommand{\textslashsc}{%
  \check@mathfonts
  {\fontsize{\sf@size}{\z@}\selectfont/}%
}
\xapptocmd{\scshape}{\let\textslash\textslashsc}{}{}
\makeatother

\begin{document}

\textsc{iso\textslash iec} with a bit too tall slash
and a normal\textslash big slash.

\end{document}

enter image description here

  • Thanks! That is also a possible approach and the result looks good. Can you explain what happens on the two rows starting with \check@? – Paapaa Jul 19 '16 at 20:03
  • 1
    @Paapaa The \check@mathfonts macro makes some computations to set up sizes for math fonts according to the current font size; in particular it defines \sf@size that's the size for subscripts, so we can use this size for the slash, because we add to \scshape that \textslash should become the “small version”. – egreg Jul 19 '16 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.