The URW Palldio font (mathpazo package) does not provide bold small caps. To get round this issue, I'd want to make a macro to use small caps usually and normal caps in bold text.
I tried this code:
\documentclass{minimal}
\usepackage[sc,osf]{mathpazo}
% Use small caps normally except in a bold font: switch to uppercase instead.
% This macro does not work: the `\ifx\f@series\bfdefault` test always fails.
\makeatletter
\DeclareRobustCommand{\mytextsc}[1]{%
\ifx\f@series\bfdefault%
\uppercase{#1}%
\else
{\scshape #1}%
\fi
}
\makeatother
% An other macro, where the same test is ok here !?
\newcommand\normal{\fontseries{\ifx\f@series\bfdefault\then m \fi}\selectfont}
\begin{document}
% this works OK
This is a \mytextsc{small caps} text.
% this fails
\textbf{This is a bold \mytextsc{upper case} text.}
% here the normal macro works
\textbf{This is a bold \mytextsc{upper \normal case} text.}
\end{document}
For some strange reason, the test \ifx\f@series\bfdefault
always fails in the \mytestsc
macro, although it works well in the \normal
macro. Any ideas how to correct the \mytextsc
macro?