[Tex/LaTex] \textup command not working inside \textsc

fonts

I believe it's going to be difficult getting a solution for my issue the way I have to put it, because I'm afraid I cannot provide an MWE for it.

The issue is that when I type something like \textsc{\textup{upshape text} smallcaps text}, what I get is everything typeset in small caps. I have been able to check that this issue is not dependent on the font I'm using.

I cannot provide an MWE because this happens in documents depending on a class where I'm loading a very long list of packages and where I'm doing a lot of processing. So, it'd be helpful if somebody could just say what may be going on here even if it is only as a possibility or as a guess, because everything else works fine.

Compilation is on pdfLaTeX and in the class I'm using expl3 code.

EDIT: As for my intentions, I'm collecting some token lists and setting everything therein in small caps except for what I may have marked in the original text with \textup. Hope this helps.

EDIT 2: I've located the source of the problem. It boils down to something within the biolinum package. The next MWE replicates the problem:

\documentclass{memoir}

\usepackage{biolinum}

\begin{document}
\textsc{\textup{regular text} small caps}
\end{document}      

Now, does anybody know what is the reason why this happens? And, of course, my appreciation to all those who have guessed, hinted, or provided any critical remarks.

Best Answer

When NFSS2 (the current LaTeX font selection scheme) was designed, the developers decided for four "axes": encoding, family, weight and shape. They encoded four basic shapes

  • upright
  • italic
  • slanted
  • small caps

At the time, with the constraints imposed by the low memory computers available, this was probably sufficient. With senno di poi (as we say ‘hindsight’ in Italian), encoding small caps as a shape was a mistake. Packages such as libertine and biolinum load the fontaxes package that modifies NFSS2 in order to make room for a new axis. The command \textup only changes the “primary shape” attribute, but not the new axis that distinguishes between “primary” and “secondary” shapes, so the secondary shape remains small caps. The primary shape is for upright, italic and slanted.

This said, use \textulc (the corresponding declaration is \ulcshape), where ulc stands for “upper and lower case”.

\documentclass{memoir}

\usepackage{biolinum}

\begin{document}
\textsc{\textulc{regular text} small caps}
\end{document}

enter image description here