8

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.

Marcos
  • 5,422
  • I guess that you want \MakeUppercase{text} instead of \textup{}. Is this right? Your command \textsc{\textup{upshape text} smallcaps text} is working here. – Sigur Jan 24 '14 at 18:03
  • 2
    Upshape (= textup) and scshape (textsc) change the same font feature, so the outer command wins. – Ulrike Fischer Jan 24 '14 at 18:06
  • 2
    \textup merely sets everything in an upright font that is otherwise in the same "family". since there are very few font families that have small caps in anything but an upright orientation, you won't be able to see any difference. in any event, it's not clear from your description exactly what you do want. some more help, please ... – barbara beeton Jan 24 '14 at 18:06
  • I'm sure my problem has to do with my own class at some point, but this is the only feature I seem to get wrong. When I compile the line in my post as a document of the memoir class, I get the right behavior. The thing is that I've got a lot of processing coded in my class and a long list of loaded packages. Hence, trying to find out from scratch where the problem is would be extremely time-consuming. I was mostly wondering if somebody else had been through a similar issue sometime. – Marcos Jan 24 '14 at 18:18
  • @Sigur: No, what I need is what I mean. It's not \MakeUppercase, but the regular roman shape that you get by issuing \textup or \upshape, as opposed to the small caps shape. – Marcos Jan 24 '14 at 18:21
  • @barbara beeton: The difference in the fonts I'm using is clearly discernible. – Marcos Jan 24 '14 at 18:24
  • Use {\scshape.... } instead of \textsc{....} – Ulrike Fischer Jan 24 '14 at 18:26
  • 1
    @Marcos upright text is not opposed to small caps: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{libertine} \begin{document} \itshape\textsc{\textup{upshape text} smallcaps text} \end{document} – cgnieder Jan 24 '14 at 18:26
  • 1
    @cgnieder Note that libertine adds an axis, so \scshape and \upshape actually change different attributes. This is not true in the normal setup. – egreg Jan 24 '14 at 18:32
  • 1
    @Marcos I get “upshape text” in the normal font, and “smallcaps text” in small caps; there must be something else in your setup. – egreg Jan 24 '14 at 18:34
  • @egreg interesting! Someday I need to learn more about how NFSS works... – cgnieder Jan 24 '14 at 18:36
  • @egreg: Indeed. It's just that I really don't know where to start looking for it because everything else in the documents depending on that class looks fine. – Marcos Jan 24 '14 at 20:49
  • 3
    It is important to note that the reason MWE's are called 'minimal' is not because they necessarily take a minimal amount of time or effort to create. If you document is complex, it will take time (unless you get lucky). Make a copy of the original file, and work slowly and methodically to reduce the amount of text in the document and then the number of packages required to recreate the problem. Anything 'solution' you otherwise get is due to the excellent guessing abilities of some members, not becuase it is reasonable to expect that someone will guess the right answer. – jon Jan 24 '14 at 20:58
  • @jon: Right. That's why I insisted on getting some guesses as to where the origin of the problem might be, considering in particular the possibility that somebody else was already familiar with the same issue. – Marcos Jan 24 '14 at 21:16
  • @Marcos Start by removing packages which modify the default font setup - anything which loads a font, obviously, but also support packages such as fontaxes or nfssext-cfr which modify these kinds of commands. Use \listfiles to check a complete list of what's being loaded. Note that the mere fact that the problem occurs with different fonts doesn't show it isn't a result of your font choices since many different fonts use fontaxes, for example, to modify these kinds of commands. – cfr Jan 24 '14 at 21:59
  • Please check my EDIT 2. – Marcos Jan 25 '14 at 17:31
  • 1
    Very nice MWE. It is also reproducible with \usepackage{libertine} (the related serifed font). A workaround would be to use \textnormal instead, which resets all attributes. ... But I see a real solution has been posted in the meantime! – jon Jan 25 '14 at 18:13
  • @jon: Right, and a very informative one, as usual with egreg. – Marcos Jan 25 '14 at 19:17

1 Answers1

8

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

egreg
  • 1,121,712