0

From the following answer: https://tex.stackexchange.com/a/270484/201720,

one can refer to an appendix by letter, which is what I want to achieve. However, I do not want the output to be: enter image description here

Instead, I want the following:

  • I want to add a section number before "Appendices"
  • Instead of "A Graph Appendix", I want "Appendix A: Graph Appendix

In other words, I want the output to be like this (in my case, appendices will be section 9): enter image description here

Is there a way to do this?

I could write (from https://tex.stackexchange.com/a/30123/201720):

\section{Appendices}
\subsection*{Appendix A: Graph Appendix} \label{appendix:a}
\addcontentsline{toc}{subsection}{\protect\numberline{}Appendix A: Graph Appendix}
This is the graph appendix. It is appendix \ref{appendix:a}.

Because I do not want the subsection to be numbered. But when I do this, latex references section 9 (because of the asterisk*, I think), so I get this: enter image description here

But even if I remove the asterisk, latex will reference section 9.1. i.e. I will get this: enter image description here

But again, that is not what I want. What I want is this: enter image description here

Aziz
  • 159
  • 1
    I think if you use package appendix you can put \begin{appendices} and \end{appendices} and the chapters you put inbetween there will automatically get letters instead of numbers. – Plergux Nov 02 '20 at 10:41
  • Yes, but if I do that, there won't be a number before "Appendices" (which I want). Plus, for the first appendix, it will say "A Graph Appendix", but I want it to say "Appendix A: Graph Appendix". – Aziz Nov 02 '20 at 10:44

1 Answers1

2

You can use appendix package with the option [title]. To get the numbered Appendices section you simply put it before the \start{appendices} call.

\documentclass{article}

\usepackage[title]{appendix} \usepackage{lipsum}

\begin{document}

\section{One} \lipsum[1]

\section{Two} \lipsum[2]

\section{Appendices} \begin{appendices}

\section{Alpha} \lipsum[3]

\section{Beta} \lipsum[4] \end{appendices}

\end{document}

enter image description here

Plergux
  • 874
  • Not exactly what I had in mind, but this should be fine as well. Thank you very much. – Aziz Nov 02 '20 at 11:50
  • 1
    I notice now that I did not include the colon that you had in your example. Sorry about that. You can achieve this with package titlesec and "\titleformat{\section}{\bfseries\Large}{\appendixname{} \thesection:}{20pt}{\bfseries\Large}" just after \begin{appendices} (sorry again for omitting this). – Plergux Nov 02 '20 at 11:52
  • No problem at all! Thank you very much for your help, I really appreciate it! – Aziz Nov 02 '20 at 14:36