
Я использую \fancyhdr
пакет для заголовков и отчета как пример класса документа, код которого приведен ниже
\documentclass[a4paper,11pt]{report}
\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\fancyhf{}
\fancyhead[LE,LO]{\slshape \leftmark}
\rhead{\thepage}
\cfoot{}
\begin{document}
\pagenumbering{arabic}
\input{chap_01}
\input{chap_02}
\input{chap_03}
\begin{appendices}
\input{Appendix_01}
\end{appendices}
\end{document}
Теперь все вроде бы работает, но на странице приложения я получаю:
тогда как вместо главы я бы хотел «Приложение А. Определение параметров».
Предложения?
решение1
Вы можете просто поставить строку
\renewcommand\chaptername{Appendix}
сразу после строки
\begin{appendices}
Образец документа:
\documentclass[a4paper,11pt]{report}
\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\fancyhf{}
\fancyhead[LE,LO]{\slshape \leftmark}
\rhead{\thepage}
\cfoot{}
\begin{document}
\pagenumbering{arabic}
\begin{appendices}
\renewcommand\chaptername{Appendix}
\chapter{Parameter Definition}
\newpage
\setcounter{page}{35}
some text
\end{appendices}
\end{document}
решение2
В LaTeX уже есть метод для переключения между \chaptername
и \appendixname
; команда \@chapapp
обычно расширяется до , \chaptername
но переопределяется так, чтобы означать \appendixname
после \appendix
.
Я убрал из вашего примера то, что не нужно.
\documentclass[a4paper,11pt]{report}
\usepackage{kantlipsum} % just for the example
\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\slshape \leftmark}
\fancyhead[R]{\thepage}
\makeatletter % necessary for using \@chapapp
\renewcommand{\chaptermark}[1]{%
\markboth{\@chapapp\ \thechapter.\ #1}{}}
\makeatother
\begin{document}
\pagenumbering{arabic}
\chapter{One}
\kant
\chapter{Two}
\kant
\begin{appendices}
\chapter{Again}
\kant
\end{appendices}
\end{document}