0

In the following lines of code (a MWE), I intend to have appendix results named like A.1, A.2, etc. (see line "\newtheorem{APP.}{A.}").

\documentclass[12pt,oneside,english]{report} 

\usepackage[a4paper]{geometry}
\geometry{verbose, tmargin=2cm, bmargin=2cm, lmargin=2cm, rmargin=2cm, headsep=0.5cm, footskip=1cm}
\usepackage[hidelinks]{hyperref}
\newtheorem{APP.}{A.}

\begin{document}

\tableofcontents
  
\chapter{FFFFFFFFFFFFFFFFF}\label{chap: Brownian motion theory}
\justify 
\pagenumbering{arabic}
\lhead{\textbf{\rightmark}}
\section{WWWWWW}\label{subsec: History of Brownian motion}
\justify 
As pointed out in \ref{app.:law XXXXXX}...


\chapter{Appendix} \label{app: Appendix ACCA}
\begin{APP.}\textbf{(Law XXXXXX)}\label{app.:law XXXXXX}
\noindent According to ...

\end{APP.}
    
\end{document}

Appendix part will appear as:

enter image description here

Hence, as intended, first appendix result will be named A.1.



With the line:

 As pointed out in \ref{app.:law XXXXXX}...

I get the output:

As pointed out in 1

While I would like to get instead:

As pointed out in A.1




I understand the point and the reason of that. Is there any possible authomatic way (I know how to do it manually, but it is too time-expensive) to get A.1 instead of 1 in the body text reference? Should I make some adjustment as to the way in which I define the appendix (which currently corresponds to "\newtheorem{APP.}{A.}") or should I make any adjustment somewhere else?

1

When I process your MWE with pdflatex there are several problems including "undefined control sequence" and a hyperref problem.

In the code below I have commented out the problematic lines.

% newtheoremprob.tex  SE 568951

\documentclass[12pt,oneside,english]{report} 

\usepackage[a4paper]{geometry}
\geometry{verbose, tmargin=2cm, bmargin=2cm, lmargin=2cm, rmargin=2cm, headsep=0.5cm, footskip=1cm}
\usepackage[hidelinks]{hyperref}  % PW causes a problem
%%    \newtheorem{APP.}{A.}[chapter]
\newtheorem{APP.}{}[chapter] % changed by PW

\begin{document}

\tableofcontents
  
\chapter{FFFFFFFFFFFFFFFFF}\label{chap: Brownian motion theory}
%%%    \justify % PW undefined control sequence
\pagenumbering{arabic}
%%%    \lhead{\textbf{\rightmark}} % PW undefined control sequence
\section{WWWWWW}\label{subsec: History of Brownian motion}
%%%    \justify % PW undefined control sequence
As pointed out in \ref{app.:law XXXXXX}...

\appendix  % added by PW
\chapter{Appendix} \label{app: Appendix ACCA}
\begin{APP.}\textbf{(Law XXXXXX)}\label{app.:law XXXXXX}
\noindent According to ...

\end{APP.}
    
\end{document}

I didn't like your Chapter 2 Appendix and changed that because an Appendix is not a chapter, although an appendix include one or more chapters. I also changed your \newtheorem specification. Now you get the reference style you are after.

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.