I have been using \textsc
for the abbreviations for AM
, PM
, but it does not work within \textbf{}
. As you can see in the image, within a \textbf{}
, it reverts to the normal lower case letter. Ulrike Fischer suggests in bold small caps with mathpazo, to switch to uppercase characters when attempting to use a bold weight font, but that does not look right as the result lablelled MyTextsc
shows (I modified it slightly to apply a \tiny
size change):
The results are not very good, so wondering if others have other suggestions?
Code:
\documentclass{article}
\usepackage{lmodern}%
\usepackage[T1]{fontenc}%
\usepackage{graphicx}
\usepackage{xspace}
\makeatletter
\newcommand*{\AMorPMTextModeTextsc}[1]{%
\@ifnextchar{.}%
{\textsc{\,{\small#1}}}%
{\textsc{\,{\small#1}}\xspace}%
}%
% https://tex.stackexchange.com/a/24635/4301
\DeclareRobustCommand{\MyTextsc}[1]{%
\edef\@tempa{\f@series}\edef\@tempb{\bfdefault}%
\ifx\@tempa\@tempb%
\uppercase{{\tiny#1}}% \small here seems to do nothing
\else
{\scshape\small#1}%
\fi }
\newcommand*{\AMorPMTextModeMyTextsc}[1]{%
\@ifnextchar{.}%
{\MyTextsc{\,{#1}}}%
{\MyTextsc{\,{#1}}\xspace}%
}%
\makeatother
\newcommand{\PrintText}[1]{%
\makebox[8.0em][l]{Using \textbackslash#1:} 5:00\PM to 8:00\PM.\par
\makebox[8.0em][l]{Using \textbackslash#1:} \textbf{5:00\PM to 8:00\PM.}
}%
\begin{document}
\newcommand{\AM}{\AMorPMTextModeTextsc{am}}%
\newcommand{\PM}{\AMorPMTextModeTextsc{pm}}%
\PrintText{textsc}
\bigskip
\renewcommand{\AM}{\AMorPMTextModeMyTextsc{am}}%
\renewcommand{\PM}{\AMorPMTextModeMyTextsc{pm}}%
\PrintText{MyTextsc}
\end{document}