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:


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.


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


\makepagestyle{standard} % Make standard pagestyle


\makeatletter                 % Define standard pagestyle
\makeevenfoot{standard}{}{}{} %
\makeoddfoot{standard}{}{}{}  %
\makeatother                  %

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


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


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.