5

I am writing a document where each chapter has an appendix. In addition to the appendices I would like to have a final supplementary files section where I list all the files that accompany the document each in their own section.

I am using both the appendix and cleveref packages.

Essentially when I refer to an appendix I would like the in-text reference to say "Appendix X" except when referring to the final appendix where it should say "Supplement X.X".

In addition since appendices are labeled alphabetically I would like to set the appendix counter forward to 19 so that the supplementary files section is section "S".

Here is a MWE:

\documentclass{report}
\usepackage[toc,page,titletoc]{appendix}
\usepackage[capitalise,nameinlink]{cleveref}

\begin{document}

TITLE 

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}). The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

\appendix
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}

\crefalias{sectiom}{supp}

\chapter{Supplementary material}
\section{Supplementary material of chapter 1}
\label{app:supp1}
\section{Supplementary material of chapter 2}
\label{app:supp2}

\end{document}
1
+50

Using the appendices environment you can control things a little more finely:

Table of contents:

Table of contents

Text reference:

Text reference

Supplementary material:

Supplementary material

\documentclass{report}

\usepackage[toc,page,titletoc]{appendix}
\usepackage[capitalise,nameinlink]{cleveref}

\crefname{supp}{Supplement}{Supplements}

\begin{document}

\begin{center}
  TITLE
\end{center}

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}).
The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

\begin{appendices}
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}
\end{appendices}

\appendixpageoff
\appendixtitleoff
\renewcommand{\appendixtocname}{Supplementary material}
\begin{appendices}
  \setcounter{chapter}{19}
  \crefalias{section}{supp}
  \chapter*{Supplementary material}
  \section{Supplementary material of chapter 1}
  \label{app:supp1}
  \section{Supplementary material of chapter 2}
  \label{app:supp2}
\end{appendices}

\end{document}

The ingredients are as follows:

  1. Ordinary appendices in their appendices environment with options controlled by the option passed to the appendix package
  2. Supplementary material in a separate appendices environment, where the extra page and heading are turned off, the toc name is adjusted, the chapter counter is set to 19 (corresponding to "S"), the chapter title is provide by \chapter* and the section counter is aliased to supp
  3. A \crefname instruction to print references to the supp counter with the name Supplement
2

Please try the below given

\documentclass{report}
\usepackage[toc,page,titletoc]{appendix}
\usepackage[capitalise,nameinlink]{cleveref}

\makeatletter
\renewcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \def\@chapapp{\appendixname}%
  \def\thechapter{\@Alph\c@chapter}}
  \makeatother

\begin{document}

TITLE

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}). The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

{
\appendix
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}
}

\crefalias{sectiom}{supp}

\renewcommand\chaptername{Supplementary}
\def\thechapter{S}

\chapter*{Supplementary material}
\section{Supplementary material of chapter 1}
\label{app:supp1}
\section{Supplementary material of chapter 2}
\label{app:supp2}


\end{document}

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.