problem with appendixes

708 views
Skip to first unread message

Pawel_Iks

unread,
Feb 13, 2008, 7:36:49 AM2/13/08
to LaTeX Users Group
I want to place two appendixes in my document, and when I use
following code:

\appendix
\chapter{Sth 1}
\label{ch:appendixA}

...

\appendix
\chapter{Sth 2}
\label{ch:appendixB}

...

both of these appendixes are shown as A in my table of content. And I
have problem with labeling them. When I place \ref{ch:appendixA} in
output appear ?? instead of diserable text.

I want to number equations as A-1, A-2, ... in first appendix and B-1,
B-2, ... in second. I use for this command

\renewcommand{\theequation}{\thechapter--\arabic{equation}}

which somebody from this forum advise me, but I don't understand: if I
have to write this command in all appendix or only once? Now,
equations in both appendixes are numbered as A-1, A-2, ...

Where is the problem?

Luis

unread,
Feb 14, 2008, 2:14:30 PM2/14/08
to LaTeX Users Group
Hi,

remove the second \appendix... you only need it once.

Luis

mvfpoa

unread,
Feb 15, 2008, 8:31:45 AM2/15/08
to LaTeX Users Group
Pawel_lks,

This is how i solved my problem with appendix to create two
distinct chapters: one for appendices and the other for annexes.


\titleformat{\chapter}[block]{\raggedright\Huge\bfseries}
{\chaptertitlename~\thechapter\space-\space}{0em}{} %%
\usepackage{titlesec}
\begin{appendices}
\appendix
\include{<appendix_chapter1>}
\include{<appendix_chapter2>}
\renewcommand{\appendixname}{Annex}
\newcounter{countannex}
\setcounter{countannex}{1}
\renewcommand{\thechapter}{\Alph{countannex}}
\include{anex_chapter1}
\end{appendices}


----//----

-----------------------------
appendix_chapter1.tex
-----------------------------

\newcounter{fig.appendixA}
\setcounter{fig.appendixA}{0}
\renewcommand{\thefigure}{\Alph{chapter}-\arabic{fig.appendixA}}
\chapter{Appendix Chapter} \label{ch:appA}
Ipses datum gertum...

\addtocounter{fig.appendixA}{1}
\begin{figure}
\end{figure}


----//----

-----------------------------
appendix_chapter2.tex
-----------------------------

\newcounter{fig.apendiceB}
\setcounter{fig.apendiceB}{0}
\renewcommand{\thefigure}{\Alph{chapter}-\arabic{fig.apendiceB}}
\chapter{Second Appendix}

%same as above to figures

----//----

-----------------------------
annex_chapter1.tex
-----------------------------
%same ideia of the appendices

Good luck,
Márcio

P.S.: You may find mistakes on variables name, 'coz i have translated
it.

Werner Grundlingh

unread,
Feb 16, 2008, 1:14:43 AM2/16/08
to LaTeX Users Group
As suggested by Luis, remove the second \appendix command from your
LaTeX code. Then your appendices should be sequentially labelled
Appendix A
...
Appendix B
...
etc.

I'm not sure why you received a '??' in your output. Did you remember
to compile twice?

Also, you only have to use the
\renewcommand{\theequation}{...}
once to change the way you will reference and label equations. The
labelling change will occur from the location you place the command
onward.

Werner
Reply all
Reply to author
Forward
0 new messages