I need to typeset a book where sections are identified by a string, like "PLA 1", as dictated by the book's editor (the publisher calls these strings "cite-keys".)

Sometimes there are a few sections on a given book spread, which means a few cite-keys.

  • These cite-keys need to be printed on the outer margin, on the same line as the section.
  • Also, the first current cite-key of a left page must be printed in even-page running headers.
  • The last current cite-key appearing on a right page must be in odd-page running headers.

How can one print those special strings in running headers and in margins?

I thought of using \label{SCA 1}, but then I realized \labels are actually counters.

I tried to use \marks (with the emarks package), but I can't figure it out.

Work-in-progress MWE:







\section*{Section title}\label{PLA 1}

Label string should be here \nameref{PLA 1}


I need to use Koma class. I saw somewhere people using fancyhdr or titlesec, but Koma manual advice against either or them (for example, the titlesec package interferes with the option headings=optiontotoc).

I saw a few questions answered on http://tex.stackexchange.com, but none has enough pointers to get me started.

  • Welcome to TeX.SX! – user31729 Sep 29 '14 at 17:17
  • Your MWE doesn't really show a dictionary, it shows something you suppose is necessary for the solution, but probably it is not (see also XY Problem). Please make your code reflect what your true intention is. And btw, Section 10 of the fancyhdr manual describes a method that is not so much dependent on fancyhdr itself, you just ought to use the KOMA commands for modifying the headers instead of \fancyhead; this could make a good starting point for you. – yo' Sep 29 '14 at 18:11
  • Thank you for pointing out that particular fancyhdr section would possibly not disturb KOMA inner commands. The book is actually not a dictionary, perhaps more of a reference book. I will refine the MWE as soon as I can wrap my head around the fancyhdr example. Thank you so much. – gsl Sep 29 '14 at 18:18

Here is a suggestion using the package scrlayer-scrpage


\usepackage{lipsum}% dummy text

%%% alternatively:



\chapter{Chapter Title}
\myaddsec{Section title}{PLA1}
\myaddsec{Section title}{PLA2}
\myaddsec{Section title}{PLA3}
\myaddsec{Section title}{PLA4}
\myaddsec{Section title}{PLA5}
\myaddsec{Section title}{PLA6}

Label string should be here 


Result enter image description here

  • Thank you, that is perfect. I was struggling with fancyhdr, as suggested by others, but they may not be aware that, if one uses many aspects of koma class, fancyhdr will interfere with it at some point. Your solution is simple and elegant. Very nice, thank you. – gsl Oct 2 '14 at 6:40

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.