# Can get to work with capital letters and small capitals in fancyhdr

Is there a way of making a capitalized section name appear in fancyhdr as only first letters capital?

My section name is HELLO, and I want it to appear as Hello (in small capitals) in the header.

The mfirstuc package doesn't seem to give option on already capital letters, so I tried using \MakeLowercase before applying \xcapitalisewords or \capitalisewords, but it doesn't seem that simple.

Any ideas?

MWE:

\documentclass[11pt]{article}
\usepackage{fancyhdr}
\usepackage{blindtext}
\usepackage{mfirstuc}

\fancypagestyle{normal}{%
\fancyhf{}

\pagestyle{normal}
\begin{document}
\section{HELLO}

\blindtext

\end{document}

edit 1. This is what I want.

\leftmark is a rather complicated command. Better change the text in the \markboth command.

\documentclass[11pt]{article}
\usepackage{fancyhdr}
\usepackage{blindtext}
\usepackage{mfirstuc}

\fancypagestyle{normal}{%
\fancyhf{}

\pagestyle{normal}
\ExplSyntaxOn
\renewcommand{\sectionmark}[1]{\markboth{\text_titlecase:n{#1}}{}}
\ExplSyntaxOff
\renewcommand{\subsectionmark}[1]{\markright{#1}{}}
\begin{document}
\section{HELLO}

\blindtext

\end{document}

• \exp_args:Ne\capitalisewords{\text_lowercase:n{#1}} should work. Nov 28 '20 at 18:13

In my opinion you should do the other way around: input the section titles normally and making them uppercase in print, so you have full control of the headers.

\documentclass[11pt,twoside]{article}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{blindtext}

\titleformat{\section}
{\normalfont\Large\bfseries}
{\thesection}
{1em}
{\MakeUppercase}

\fancypagestyle{normal}{%
\fancyhf{}%
}

\pagestyle{normal}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

\newcommand{\xhrulefill}[1][0pt]{%
}

\begin{document}

\section{Hello}

\blindtext
\blindtext
\blindtext
\blindtext

\blinddocument

\end{document}

I added code for raising the rule, which is better than lowering the other parts.