# Italic section title with non-italic numbers in memoir

I would like to have the printed title of my sections be in italic, with the numbering in Roman format (not Roman numerals, though). Yet, using the memoir commands for section formatting, the \itshape in the setsecheadstyle appears to be overriding the rest of the format.

MWE:

\documentclass{memoir}
\renewcommand{\thesection}{\rmfamily § \arabic{section}}
\begin{document}
\section{A Test}
\end{document}

• You need to enclose the section number in a group with the declaration \upshape, the opposite of \itshape. Does \renewcommand{\thesection}{{\upshape § \arabic{section}}} work for you? (Not sure if you need the additional \rmfamily in this definition.) Jun 27 '21 at 23:32
• @marquinho brilliant! If you make it into an answer I'm happy to accept Jun 27 '21 at 23:51
• Great! Will do. Jun 28 '21 at 7:13
• You don't want to \renewcommand{\thesection} that way. That's really a problem when you do cross-references. Jun 28 '21 at 8:11

You don't want to add formatting commands in the definition of \thesection, because you'll get in troubles when cross-referencing.

\documentclass{memoir}

\renewcommand{\thesection}{\arabic{section}}

\begin{document}

\section{A Test}

\end{document}


This is possibly a simplification and you may want to differentiate headers in left and right pages, but shows the main parts where to act.

• (This is better, and more sensible, than my answer below!) Jun 28 '21 at 8:35

To typeset text in the upright shape, the opposite of italicization, you can put it it in a group (delimited by braces) with the explicit declaration \upshape. The corresponding commands are \textit and \textup. Here's a short reference of text styles and their relations.

\documentclass{memoir}