2

I am using textsc in section by manually adjusting fontsize between normal size and script size. For example:

\section{P\scriptsize ROGRAMMING \normalsize P\scriptsize ROGRAMMING}

should produce:

enter image description here

The first letter P appears to be larger than the second letter P, obviously since normalsize has a fontsize less than fontsize of section

My question is how can I make the second letter P match the size of the first letter P. I don't want to add another normalsize for the first letter P.

3
  • 5
    Why don’t you use actual small caps? And adjust the formatting of the section using titlesec.
    – Alan Munn
    Commented May 23, 2022 at 12:11
  • 3
    \section{P{\scriptsize ROGRAMMING} P{\scriptsize ROGRAMMING}}. The effect of \scriptsize lasts only until the closing brace. Commented May 23, 2022 at 12:13
  • 4
    You could use \textsc You should never have fontsize commands in the section argument, the sizes are set by the document class, and are different in the heading, in the table of contents and in page heads. Commented May 23, 2022 at 13:10

1 Answer 1

7

If you need to render all section-level headers in bold small-caps, I strongly recommend you tell LaTeX about this, so that LaTeX will do the tedious work for you. E.g., you could load the sectsty package and issue a suitable \sectionfont directive.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc} %to enable bold small-caps letters

\usepackage{sectsty}
\sectionfont{\scshape} % render section-level headers in bold small-caps

\begin{document}
\stepcounter{section}
\section{Programming Programming}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .