# Stop memoir from making mathmode section names uppercase in header

I'm typesetting my thesis with memoir and in general I'm happy with the result. However, some of my section headers have math mode text like \section{The $\phi_{ij}$ matrix} which memoir comically turns into $\phi_{IJ}$ in the header. I'm new to memoir so I don't really know my way around.

Is there a way to tell it to leave mathmode in lower case when it prints the header?

I'm using XeLaTeX with TeX live downloaded yesterday via tlmgr. Full example, including possibly interfering packages:

\documentclass[12pt]{memoir}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{multirow}
\usepackage[margin=1.4in]{geometry}
\usepackage{graphicx}
\usepackage{changepage}
\usepackage{url}
\usepackage{hyperref}
\usepackage{subfig}
\usepackage{standalone}
\usepackage[section]{placeins}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{supertabular}
\usepackage{nth}
\usepackage[normalem]{ulem}
\begin{document}

\chapter{This is a chapter}

\section{The $\phi_{ij}$ Matrix}

\chapter{Another chapter}

\section{Density - $\omega^j_c$}

\end{document}


This is how it looks:

-
Is that a sufficient level of detail? –  mmdanziger Jan 24 '12 at 21:12
Using \section{Density - \lowercase{$\omega^j_c$}} suppresses the capitalization. –  Werner Jan 24 '12 at 21:24
Ok, I guess that will work. But is there a way to tell memoir to wrap all mathmode lines in headers with \lowercase? –  mmdanziger Jan 24 '12 at 21:26
Just discovered an almost identical question with a different solution: tex.stackexchange.com/questions/40421/… –  mmdanziger Jan 24 '12 at 21:34

If you want uppercase headings, it's sufficient to say

\usepackage[overload]{textcase}


that will change \MakeUppercase and \MakeLowercase into "math-aware" commands.

## Aside

• hyperref should be loaded last;
• It's a bit strange to load both longtable and supertabular
• memoir has its own way to set the line spacing and saying only \linespread{1.5} is quite defective in many situations
• When you have math in a section title, consider using \texorpdfstring: for instance

\section{Density --- \texorpdfstring{$\omega^j_c$}{omega j c}}


that avoids many messages by hyperref

-

actually, this does appear to be standard behavior of memoir. here are a few definitions from memoir.cls:

\newcommand*{\nouppercaseheads}{\let\memUChead\relax}

try adding \nouppercaseheads in your preamble.
really, the \MakeUppercase should be changed to something "math-aware" like the \uppercasenonmath defined in the ams document classes. (i've written to the maintainer of memoir.cls to suggest it.)
How would I combine the \uppercasenonmath with memoir? It could be that lower case headers are better in general but I'd like to know how to tell just the math to be left alone. –  mmdanziger Jan 24 '12 at 21:58
I've added it to my todo list, I'm not going to fix it, but rather provide some features like the ones ams use. I personally do not like using uppercase headings, (1) takes up to much space, (2) in these web days, uppercasing equal shouting ... –  daleif Jan 25 '12 at 10:20