# Chemical formula in fancyhdr environment [duplicate]

I am using the fancyhdr package to create nice headers for my thesis. I'm running into problems with a chemical formula that appears as a section name.

The chemical formula is capitalized when displayed in the header:

However, I'd like to have it formatted like this:

How can I make LaTeX to format the header correctly for this chemical formula without changing the uppercase conversion for other chapter / section names?

A minimal example of the code I used is:

\documentclass[twoside,openright]{report}

%\input{preamble.tex}
\newcommand{\bisb}{Bi$_{1-x}$Sb$_{x}\,$}
\usepackage{blindtext} % For testing purposes

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\renewcommand{\footrulewidth}{0pt}

\begin{document}
\chapter{One}
\section{\bisb}
\blindtext[20]

\end{document}


## marked as duplicate by Johannes_B, Troy, CarLaTeX, Mike Renfro, TeXnicianAug 13 '17 at 12:15

• Welcome, \nouppercase{\leftmark} and \nouppercase{\rightmark}. This does not influence the chemical formula, but makes all header not use UPPERCASE. – Johannes_B Aug 13 '17 at 9:46
• I am unable to replicate the issue you're reporting, using just the information you've provided so far. (I do get an error message about an option clash for the textcomp package, apparently related to the instruction \DeclareRobustCommand{\sustyle}....) Please post a fully compilable example that generates the issue you're looking to fix. – Mico Aug 13 '17 at 10:04
• Hi Johannes, thanks for the answer. However, I'd like to have the other sections to appear in uppercase, so that does not fix the problem completely. – DaanMusic Aug 13 '17 at 10:14
• Hi Mico, I have just updated the question with a new code snippet that I just ran. I hope this provides enough information. – DaanMusic Aug 13 '17 at 10:15
• You should be using a proper package for chemistry support such as chemformula and chemmacros (my favourite) or mhchem (which is also good). – Johannes_B Aug 13 '17 at 10:15

\section{\protect\bisb}