How to change font and color of sections in memoir?
Asked Answered
B

1

5

I have a test document using memoir and I'd like to figure out how to change the font and color of sections and lower levels.

\documentclass{memoir}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\setsansfont{Helvetica}
\usepackage{blindtext}

\begin{document}
    \blinddocument
\end{document}

I understand that memoir includes the functionality of titlesec, and this seems to be described in section 6 of the manual, but I just can't figure out the incantation to make it work. If I wanted \section to be in the sans font in blue, and the lower levels to be in green, what are the commands to make this happen?

Blouse answered 2/12, 2018 at 0:49 Comment(0)
L
8

Use \setXheadstyle{<style>} to set the <style> of X where

  • sec denotes \section,

  • subsec denotes \subsection

  • subsubsec denotes \subsubsection,

  • para denotes \paragraph, and

  • subpara denotes \subparagraph.

enter image description here

\documentclass{memoir}

\usepackage{blindtext,xcolor}

\setsecheadstyle{\sffamily\color{blue}}% Set \section style
\setsubsecheadstyle{\sffamily\color{green}}% Set \subsection style

\begin{document}

\blinddocument

\end{document}
Langley answered 2/12, 2018 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.