4

It would be useful if I could get a list of all the running heads in my document, preferably listed by recto and verso (i.e. right- and left-hand pages), without having to manually go through the output PDF.

Some initial thoughts include:

  • Temporarily using a different style file to make the Contents list appear differently.
  • Just deleting out all body text from the .tex so that I'm just left with chapter and subsection headers.

I'm looking for something of the form:

Chapter # | Verso           | Recto
1         | chapter 1 title | subsection 1 title
1         | chapter 1 title | subsection 2 title
2         | chapter 2 title | subsection 1 title

For other work I might want something of the form: (I include this in case it would use a similar solution!)

Chapter # | Verso           | Recto
1         | book title      | chapter 1 title
2         | book title      | chapter 2 title

If this is an editor-specific question, then for reference I'm using Texmaker.

1 Answer 1

1

I am not sure if I understand what you want to do. But I think a solution would depend on the class and the package used for page header and footer.

Maybe you can use package scrwfile to clone the ToC in a new list and tocbasic to formate the entries in this new list.

Example:

\documentclass{book}
\usepackage{scrwfile}
\TOCclone[Running heads]{toc}{lorh}
\AtEndDocument{\listoflorh}

\usepackage{tocbasic}
\makeatletter
\AfterTOCHead[lorh]{
  \let\MakeUppercase\relax
  \value{tocdepth}=0
  \pagestyle{plain}
  \DeclareTOCStyleEntry[
    pagenumberbox=\@gobble,
    entryformat=\bfseries\Large
    ]{tocline}{chapter}%
}
\makeatother
\DeclareTOCStyleEntry[
  indent=0pt,
  beforeskip=3pt,
  level=0,
  numwidth=0pt
]{tocline}{rhverso}
\DeclareTOCStyleEntry[
  indent=5.5cm,
  beforeskip=3pt,
  level=0,
  numwidth=0pt
]{tocline}{rhrecto}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{\markright{\thesubsection. \MakeUppercase{#1}}}
\fancyhead{}
\fancyhead[LE]{\leftmark\addcontentsline{lorh}{rhverso}{\parbox[b]{5cm}{\protect\raggedright\leftmark}}}
\fancyhead[RO]{\rightmark\addcontentsline{lorh}{rhrecto}{\parbox[b]{5cm}{\protect\raggedright\rightmark}}}

\usepackage{blindtext}% only for dummy text
\begin{document}
\tableofcontents
\blinddocument
\blinddocument
\end{document}

enter image description here

or with scrlayer-scrpage instead fancyhdr:

\documentclass{book}
\usepackage{scrwfile}
\TOCclone[Running heads]{toc}{lorh}
\AtEndDocument{\listoflorh}

\usepackage{tocbasic}
\makeatletter
\AfterTOCHead[lorh]{
  \let\MakeUppercase\relax
  \value{tocdepth}=0
  \DeclareTOCStyleEntry[
    pagenumberbox=\@gobble,
    entryformat=\bfseries\Large
    ]{tocline}{chapter}%
}
\makeatother

\DeclareTOCStyleEntry[
  indent=0pt,
  beforeskip=5pt,
  level=0,
  numwidth=0pt
]{tocline}{rhverso}
\DeclareTOCStyleEntry[
  indent=5.5cm,
  beforeskip=5pt,
  level=0,
  numwidth=0pt
]{tocline}{rhrecto}


\usepackage{scrlayer-scrpage}
\automark[subsection]{chapter}
\ihead{%
  \headmark
  \ifodd\value{page}%
    \addcontentsline{lorh}{rhrecto}{\parbox[b]{5cm}{\protect\raggedright\headmark}}%
  \else
    \addcontentsline{lorh}{rhverso}{\parbox[b]{5cm}{\protect\raggedright\headmark}}%
  \fi
}

\usepackage{blindtext}% only for dummy text
\begin{document}
\tableofcontents
\blinddocument
\blinddocument
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .