4

I would like to remove the section title (header) in the appendix:

\documentclass[headsepline, open=right,twoside=true, numbers=noenddot]{scrreprt}

\usepackage[english]{babel}
\usepackage{scrpage2}
\usepackage{blindtext}

\clearscrheadfoot
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
\automark[section]{chapter}
\pagestyle{scrheadings}
\renewcommand*{\chapterpagestyle}{empty}


\begin{document}

\begin{appendix}

    \chapter{Appendix}
    \section{Remove the section title}
    \blindtext[12]

\end{appendix}

\end{document}

I'm looking for something like \renewcommand*{\sectionmarkformat}{} except I want to keep the number and remove the title.

3

If the KOMA-Script option appendixprefix is not used:

\newcommand*{\appendixmore}{%
  \renewcommand\sectionmark[1]{%
    \markright{\ifnumbered{section}{\thesection\autodot}{}}%
}}

enter image description here

Using \ifnumbered avoids a wrong number in the header if there is an unnumbered section.

Note \appendix is not an environment. The package scrpage2 is depreciated. Use scrlayer-scrpage instead.

\documentclass[headsepline,twoside, numbers=noenddot]{scrreprt}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
\automark[section]{chapter}
\renewcommand*{\chapterpagestyle}{empty}
\newcommand*{\appendixmore}{%
  \renewcommand\sectionmark[1]{%
    \markright{\ifnumbered{section}{\thesection\autodot}{}}%
}}

\begin{document}
\appendix
\chapter{Appendix}
\section{Remove the section title}
\blindtext[30]
\addsec{Unnumbered section}
\blindtext[12]
\end{document}
6
  • Maybe my question was unclear. I would like to keep the section number. In my example I would like to keep the A.1 and just remove the Remove the section title.
    – Shery
    Dec 7 '14 at 21:02
  • I have changed my answer.
    – esdd
    Dec 7 '14 at 22:19
  • @esdd I am sorry, but how can I totally remove page headers using scrbook and scrlayer-scrpage?
    – Diaa
    Dec 8 '16 at 3:29
  • @DiaaAbidou In the appendix? Then you can use \newcommand*{\appendixmore}{\ihead*{}\ohead*{}\chead*{}\KOMAoptions{headsepline=false}} or \newcommand*{\appendixmore}{\clearpairofpagestyles\KOMAoptions{headsepline=false}} if there should also be nothing in the footer.
    – esdd
    Dec 8 '16 at 7:09
  • @esdd I am sorry, but I meant for the whole document. I found that plain.scrheadings option of scrlayer-scrpage did what I want, am I right? or should it be done another way?
    – Diaa
    Dec 8 '16 at 8:31
5

I also suggest the use of scrlayer-scrpage instead of scrpage2....

About your question, you can issue

\lohead{\thesection\autodot}

just after

\chapter{Appendix}

to obtain what you want.

MWE

\documentclass[headsepline, open=right,twoside=true, numbers=noenddot]{scrreprt}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
\automark[section]{chapter}
\renewcommand*{\chapterpagestyle}{empty}

\begin{document}

\chapter{Test}
\section{Here I want the headers}
\blindtext[12]

\appendix

\chapter{Appendix}
\lohead{\thesection\autodot}

\section{Remove the section title}
\blindtext[12]


\end{document} 

Output

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.