0

The code

  \createmark{section}{right}{shownumber}{\@secapp}{\ }

in the following source gives error that \@secapp is undefined. I tried to use that by analogy with the use of \@chapapp in the preceding line, so as to produce, e.g.,

Section 1.1 Test section

in the odd-page header -- that is, include the word Section and not include a period after the 1.1 section number.

Question: How does one do that?

So far as I can see, the memoir docs don't speak to that.

\documentclass{memoir}
\usepackage{lipsum}

\nouppercaseheads
\makepagestyle{mystyle} 
\makeheadrule {mystyle}{\textwidth}{\normalrulethickness}
\makeevenhead{mystyle}{\bfseries\sffamily\thepage}{}{\bfseries\sffamily\leftmark}
\makeoddhead{mystyle}{\bfseries\sffamily\rightmark}{}{\bfseries\sffamily\thepage} 
\makeatletter
\addtopsmarks{mystyle}{}{ 
  \createmark{chapter}{left}{shownumber}{\@chapapp\ }{. \ } 
  \createmark{section}{right}{shownumber}{\@secapp}{\ }
}
\makeatother

\pagestyle{mystyle}

\begin{document}

\chapter{Test Chapter}
\lipsum[1]

\section{Test Section}
\lipsum[1-20]

\end{document}

1 Answer 1

1

In your MWE replace:

\createmark{section}{right}{shownumber}{\@secapp}{\ }

by

\createmark{section}{right}{shownumber}{Section }{\ }

You tried a \@secapp to imitate \@chapapp, but the \@chapapp is special in that its value will change whether or not an Appendix is being set or a normal Chapter; it is an internal LaTeX macro. There is no need for such convolutions for Sections.

You must log in to answer this question.

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