2

I intend to use small colored boxes in front of sections in order to identify at which heading level the text is located, and I'd want my reader to quickly reference the heading level by color. My idea was to implement a small line holding the order of the heading colors into each odd head rule. Is it possible to add the code below in such a way that I might get the result shown in the picture:

\makeheadrule{standard}{\textwidth}{\normalrulethickness}

enter image description here

I just picked random colors here, but if possible, I would decide on colors that would be distinguishable by the colorblind.

2

I guess the easiest would be to add the coloured squares to the \makeoddhead

\documentclass{memoir}

\makepagestyle{standard} % Make standard pagestyle

\setlength{\headheight}{13.60005pt}

\makeatletter                 % Define standard pagestyle
\makeevenfoot{standard}{}{}{} %
\makeoddfoot{standard}{}{}{}  %
\makeevenhead{standard}{\bfseries\thepage\normalfont\qquad\small\leftmark}{}{}
\makeoddhead{standard}{}{}{%
    {\color{yellow}\rule{1em}{1em}}%
    {\color{orange}\rule{1em}{1em}}%
    {\color{red}\rule{1em}{1em}}%
    {\color{purple}\rule{1em}{1em}}%
    {\color{blue}\rule{1em}{1em}}%
    {\color{cyan}\rule{1em}{1em}}%
    {\color{green}\rule{1em}{1em}}%
    \hfill\small\rightmark\qquad\bfseries\thepage}
\makeheadrule{standard}{\textwidth}{\normalrulethickness}
\makeatother                  %

\makeatletter
\makepsmarks{standard}{
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{ \quad }
\createmark{section}{right}{shownumber}{}{ \quad }
}
\makeatother                               %

\nouppercaseheads
\pagestyle{standard}      

\usepackage{xcolor}
\usepackage{lipsum} % Just to put in some text

\begin{document}
\frontmatter
\chapter{Introduction}
\lipsum[1-12]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.