Using \textsc{} manually in section

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:

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.

• Why don’t you use actual small caps? And adjust the formatting of the section using titlesec. May 23 at 12:11
• \section{P{\scriptsize ROGRAMMING} P{\scriptsize ROGRAMMING}}. The effect of \scriptsize lasts only until the closing brace. May 23 at 12:13
• 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. May 23 at 13:10

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.

\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}