# Appendix part of a book document

The following MWE is a skeleton of the formatting I am using for the chapters, sections and appendices in my book.

\documentclass[a4paper]{book}
\usepackage{emptypage}
\usepackage[tmargin=2in, bmargin=2in, lmargin=1.5in, rmargin=1.5in]{geometry}
\usepackage[inline]{enumitem}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage[toc, page]{appendix}
\let\plainappendixpage\appendixpage
\makeatletter
\renewcommand{\appendixpage}{%
\begingroup
\let\ps@plain\ps@empty
\plainappendixpage
\endgroup}
\makeatother

%====================================================================================================
% Chapter title format
%
\setcounter{secnumdepth}{3}
\usepackage{titlesec}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\filleft\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{$\mid$}\hsp}{0pt}{\Huge\bfseries}
\titlespacing*{\chapter}{0pt}{0pt}{3in}
\titleformat{\subsubsection}{\large\bfseries}{\thesubsubsection}{1em}{\large\bfseries}
\renewcommand{\thesubsubsection}{\large\bfseries{\ensuremath{\bullet}}}
%====================================================================================================

%====================================================================================================
% Section symbol in TOC and in text
%
\usepackage{tocloft}
\renewcommand\cftsecpresnum{\S}
\titleformat{\section}{\normalfont\Large\bfseries}{\S\thesection}{1em}{}
%====================================================================================================

%====================================================================================================
%
\usepackage[english]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\S\thesection.\ #1}}
%====================================================================================================

%====================================================================================================
% Cross-references
%
\usepackage{varioref}
\usepackage{hyperref}
\hypersetup
{
citecolor=teal,
}
\usepackage{cleveref}

\begin{document}
\tableofcontents
\chapter{First}
\lipsum\\
\vref{A1}
\section{title}
\lipsum[1]
\chapter{Second}
\lipsum
\begin{appendices}
%====================================================================================================
% Local formatting
\titleformat{\chapter}[hang]{\filleft\LARGE\bfseries}{Appendix \thechapter\hsp\textcolor{gray75}{$\mid$}\hsp}{0pt}{\LARGE\bfseries}
\renewcommand{\chaptermark}[1]{\markboth{Appendix \MakeUppercase{\thechapter.\ #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{}}
\crefname{chapter}{appendix}{appendices}
%====================================================================================================

\chapter{One}\label{A1}
\lipsum
\section{First section}
\lipsum[1]
\chapter{Two}\label{A2}
\lipsum
\end{appendices}
\end{document}


My goals are:

1. The "Appendices" header in the TOC should not have a page reference.
2. The separator page "Appendices" should be there (as it is there now) after the usual chapters without a page number on it.
3. The appendices part should behave like a (partially) one-sided document. First, like an one-sided document, the first appendix chapter should start on right (odd numbered page) and the next appendix chapters should start on the next new pages (even or odd numbered page). Secondly, the chapter marks in the header of a page should behave like a two-sided document (as it is there now, with no section mark in the header).
4. \vref to chapters in appendices (only) should produce the pre-string "appendix" instead of "chapter".
5. The formatting behaviour outside appendices should stay exactly how they are now.

EDIT

PS: (getting intrigued by this plea), Please feel free to change the title of my question to a more meaningful one.

I have revised your MWE to give what I think you want. My changes are marked with % PW -----

% appendixprob.tex  SE 543637

\documentclass[a4paper]{book}
\usepackage{emptypage}
\usepackage[tmargin=2in, bmargin=2in, lmargin=1.5in, rmargin=1.5in]{geometry}
\usepackage[inline]{enumitem}
\usepackage{lipsum}
\usepackage{xcolor}
%\usepackage[toc, page]{appendix} % PW -------------------------
\usepackage[page]{appendix} % PW -----------------------------
\let\plainappendixpage\appendixpage
\makeatletter
\renewcommand{\appendixpage}{%
\begingroup
\let\ps@plain\ps@empty
\plainappendixpage
\endgroup}
\makeatother

%====================================================================================================
% Chapter title format
%
\setcounter{secnumdepth}{3}
\usepackage{titlesec}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\filleft\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{$\mid$}\hsp}{0pt}{\Huge\bfseries}
\titlespacing*{\chapter}{0pt}{0pt}{3in}
\titleformat{\subsubsection}{\large\bfseries}{\thesubsubsection}{1em}{\large\bfseries}
\renewcommand{\thesubsubsection}{\large\bfseries{\ensuremath{\bullet}}}
%====================================================================================================

%====================================================================================================
% Section symbol in TOC and in text
%
\usepackage{tocloft}
\renewcommand\cftsecpresnum{\S}
\titleformat{\section}{\normalfont\Large\bfseries}{\S\thesection}{1em}{}
%====================================================================================================

%====================================================================================================
%
\usepackage[english]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\S\thesection.\ #1}}
%====================================================================================================

%====================================================================================================
% Cross-references
%
\usepackage{varioref}
\usepackage{hyperref}
\hypersetup
{
citecolor=teal,
}
\usepackage{cleveref}

\begin{document}
\tableofcontents
\chapter{First}
\lipsum\\
\vref{A1}
\section{title}
\lipsum[1]
\chapter{Second}
\lipsum
\begin{appendices}
%====================================================================================================
% Local formatting
\titleformat{\chapter}[hang]{\filleft\LARGE\bfseries}{Appendix \thechapter\hsp\textcolor{gray75}{$\mid$}\hsp}{0pt}{\LARGE\bfseries}
\renewcommand{\chaptermark}[1]{\markboth{Appendix \MakeUppercase{\thechapter.\ #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{}}
\crefname{chapter}{appendix}{appendices}
%====================================================================================================

\chapter{One}\label{A1}
\let\cleardoublepage\clearpage % PW --------------------------------
\lipsum
\section{First section}
\lipsum[1]
\chapter{Two}\label{A2}
\lipsum
\end{appendices}
\end{document}


I don't know the \vref command so that is up to you. With my changes you might find that you can eliminate some of your code but I'm not going there.

• Thank you so much. In this particular document, I have not called \vref for a chapter outside the Appendices. So I have defined \crefname for a chapter as appendix. Though this hack does not solve the problem in general, it serves my purpose in this particular document. Thanks again for the rest of your efforts. – Subhajit Paul May 19 at 17:52
• @SubhajitPaul: You can add \crefalias{section}{appendix} right after \begin{appendices} to get your \vrefs in order. See e.g. this answer. (Note that while \vref is from the varioref package, cleveref redefines it, which is why this works.) – Circumscribe May 19 at 21:12
• Thanks for your effort. From the tagged answer, the following piece of code worked: \AtBeginEnvironment{appendices}{\crefalias{chapter}{appendix}}. I don't know why your suggested piece didn't work. – Subhajit Paul May 19 at 21:30
• @SubhajitPaul: Sorry, it didn't work because I should've written chapter instead of section. – Circumscribe May 20 at 13:51
• @SubhajitPaul: Did you compile twice? (The reference type name is written to the aux file on the first run and will only be used from the next run onward.) – Circumscribe May 20 at 14:16