Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with the reference of an annex. In the main .tex file I put

%... couple of lines before this
\include{ThesisChapter4} % 
\include{ThesisAppendixA} % Appendix A

and in Appendix A I write this:

\chapter*{Appendix A}
\label{ThesisAppendixA} \thispagestyle{plain} %\pagenumbering{roman}

\begin{figure}[ht]
 \centering
 \includegraphics[scale=1]{images/heike/img1}
 \label{image1}
\end{figure}

In the page of ThesisChapter4, I tried to refer to the chapter of Appendix A with this:

 A complete procedure is provided in chapter \ref{chap:Appendix A}.

However, when I look at the created PDF, this is shown as

 A complete procedure is provided in chapter ??.

I have actually managed to refer to different figures before, however so far these refer to labels in the same file (for instance, in thesis chapter 4, I refer to a certain figure in the thesis chapter 4). When I tried to reference to chapter Appendix A, it fails. I tried to refer to the label also (image1) but it also fails.

Does anyone know how to fix above problem?

share|improve this question
    
Your label is ThesisAppendixA, not chap:Appendix A. –  Torbjørn T. Feb 15 '12 at 18:20
    
@TorbjørnT. Yes, I am aware of that . However, if I do this, the result is "A complete procedure is provided in chapter 4.4" where 4.4 being my current section. I tried to have a result of "..in chapter Appendix A" instead –  heike Feb 15 '12 at 18:23
1  
Ah, yes, sorry. That would be because you're using an unnumbered chapter (I didn't notice at first). You could perhaps add the nameref package, and use ... is provided in \nameref{ThesisAppendixA}, but it doesn't solve the figure reference. Depending on document class, you may have an \appendix command, that switches the numbering of subsequent chapters to A, B, C etc., instead of 1, 2, 3. Then you can use a numbered chapter, and refer to it as usual. Which class are you using? –  Torbjørn T. Feb 15 '12 at 18:51

2 Answers 2

up vote 6 down vote accepted

You can't make a reference to a \chapter*, because it is unnumbered.

share|improve this answer

The general way of utilizing appendix chapters is to issue \appendix once before using the regular \chapter{...} for each appendix. What \appendix does (in the standard book and report document classes) is:

\newcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}}

This

  • Restarts the chapter counter numbering (\setcounter{chapter}{0});
  • Restarts the section counter numbering (\setcounter{section}{0}). This is usually done automatically when you "make a new \chapter" (actually, via a \[ref]stepcounter), but not when you just set a counter as is done in the previous step;
  • Modifies the chapter heading to read Appendix <num> (actually \appendixname\ <num>) rather than Chapter <num>; and
  • Modifies the chapter counter to be CAPITALIZED alphabetic (A, B, C, ...).

That way you don't have to use \chapter*{Appendix A} but rather something more symbolic like \chapter{Pseudocode} that includes a name for the particular appendix. Using the latter, you can now reference the appendix in the usual way you would a regular chapter, since it is numbered with a referenceable counter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.