Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I disable smallcaps within \textsc{}?

I would like to be able to disable/toggle smallcaps on a local level so that something like \textsc{o\textrm{open}mp} looks like \textsc{o}open\textsc{mp}. The reason for not doing the latter is to try to make use of the glossaries package with the smallcaps option for abbreviations. This automatically does the outer \textsc{} wrapping.

share|improve this question
3  
\textsc{o\textup{open}mp} should work. –  egreg Oct 10 '11 at 22:04
add comment

2 Answers

up vote 11 down vote accepted

\textsc acts on the "shape" attribute; so changing again this attribute is what's needed: \textup exactly switches to "upright shape" (or Roman).

\textsc{a\textup{b}c}

will print "a" and "c" in small caps and "b" in the normal font.

share|improve this answer
add comment

As mentioned by egreg, you can use \textup instead of textsc.

One way to do this is to redefine the meaning of \textrm. I'd recommend limiting it to within the scope where you want to apply this:

\documentclass{article}
\begin{document}
{% Group here so that this is only in effect locally in this group.
\let\OldTextrm\textrm%
\renewcommand{\textrm}[1]{\textup{#1}}%
%
These should be the same:\par
\textsc{o\textrm{open}mp}\par
\textsc{o}open\textsc{mp}\par
}

These should be different:\par
\textsc{o\textrm{open}mp}\par
\textsc{o}open\textsc{mp}\par
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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