first my code: (I added all packages I'm currently using)
\documentclass[12pt,a4paper,notitlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage[toc,page]{appendix}
\usepackage[onehalfspacing]{setspace}
\usepackage{hyperref}
\usepackage{chngcntr}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{multirow}
\usepackage{bm}
\usepackage{setspace}
\usepackage{threeparttable}
\begin{document}
\chapter{Text}
Here is a chapter with text where I want to make a reference to Appendix A. Lets try the reference: Here a reference to Appendix \ref{appendix:a} and a reference to Appendix B namely Appendix \ref{appendix:b}.
\appendix
\chapter{Appendix A}
\label{appendix:a}
This is the content of the appendix A.
\chapter*{Appendix B}
\label{appendix:b}
This is the content of the appendix B.
\end{document}
This example has a perfectly fine reference for Appendix A
. However, the title for Appendix A
is done twice. Once due to \chapter{Appendix A}
and once as the \chapter{Appendix A}
is the first entry for the appendix. Furthermore, \appendix
changes numerical references to alpha references.
Obviously adding the *
for the appendix B removes the additional title, hence makes propper referencing impossible.
Anyone got an idea on how to handle this?
I already tried \begin{appendices} ... \end{appendices}
, however, for that version the numbering of the appendix chapters were numerical and not "A, B etc "
EDIT: I would prefer the table of content not including the appendix chapters and within the appendices only the Chapter names. However, as mentioned before using \chapter*{chapter_name}
makes the reference unusuable.
\documentclass[12pt,a4paper,notitlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage[toc,page]{appendix}
\usepackage[onehalfspacing]{setspace}
\usepackage{hyperref}
\usepackage{chngcntr}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{multirow}
\usepackage{bm}
\usepackage{setspace}
\usepackage{threeparttable}
\begin{document}
\tableofcontents
\chapter{Text}
Here is a chapter with text where I want to make a reference to Appendix A. Lets try the reference: Here a reference to Appendix \ref{appendix:a} and a reference to Appendix B namely Appendix \ref{appendix:b}.
\begin{appendices}
\chapter*{Appendix A}
\label{appendix:a}
This is the content of the appendix A.
\chapter*{Appendix B}
\label{appendix:b}
This is the content of the appendix B.
\end{appendices}
\end{document}
\appendix
command does just rename the chapter name toAppendix
, so it's no wonder that\Appendix A
appears twice, since you used this as the title as well. And it's\begin{appendices}...\end{appendices}
\chapter{chapter 1}
.\appendix
I had used\begin{appendices}...\end{appendices}
, however I was not able to create a propper looking reference as the numbering of the appendix section was numerically.\appendix
or\begin{appendices}...
switch to alpha 'numbering' of appendix chapters or sections.\chapter*{}
.