GeneralAppendix

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mfiligree
Posts: 25
Joined: Tue Feb 03, 2009 7:52 pm

Appendix

Post by mfiligree »

Help, please. I am having trouble in referencing appendices. The normal procedure to reference a section or table or figure using its \label and \ref, as in "see section \ref{sec:3}" is just not working. Is there an abbreviation for appendix, as in "see Appendix \ref{app:12D}"? I have tried it about a thousand ways. I have a chapter with three appendices, A through C. All my efforts at referencing the appendix only give the chapter, not the specific letter, as in [see Appendix 12], instead of [see Appendix 12C], which is what I need it to say. Googling it did not help either. This is the only book division that I am having trouble citing, so any insight is appreciated.

Thank you,
Linda

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Appendix

Post by Juanjo »

You should provide a complete minimal working example, so people could compile, experiment and try to solve the problem. By default, in the book class, appendices are chapters, but it seems that you have transformed some sections in a chapter into appendices. Without seeing your code, I find very difficult to help.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
mfiligree
Posts: 25
Joined: Tue Feb 03, 2009 7:52 pm

Re: Appendix

Post by mfiligree »

Actually, each chapter of this multi-chapter document is treated like a book. I'm hoping that doesn't cause a formatting nightmare. In any case, attached please find my mwe. You can see that it only indicates the number, not the letter, of the appendix.

Thank you,
Linda
Attachments
mwe.tex
(4.11 KiB) Downloaded 894 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Appendix

Post by Juanjo »

You have misunderstood the \appendix command. In the book documentclass, it only resets the chapter counter and changes its format (from arabic numbers to letters). This command has no arguments. Each appendix is really started by a \chapter command. In this sense, the appendix package does not change the behaviour of \appendix. This package also provides the appendices environment as a replacement of the \appendix command, but, inside it, each appendix should still be produced by a \chapter command.

More adapted to your needs is the subappendices environment, also defined in the appendix package. Now, each appendix is produced by a \section command. Read carefully p. 4 in the manual of the package. The following code exemplifies this environment:

Code: Select all

\documentclass[12pt,oneside]{book}
\usepackage[titletoc,title]{appendix}
\usepackage[dotinlabels]{titletoc}
%\usepackage[titles]{tocloft}

\begin{document}
\tableofcontents
\chapter{RANDOM TITLE}\label{chap:1}

\newpage
\begin{subappendices}

\section{First appendix}\label{A}
Please refer to Appendix \ref{C}.

\section{Second appendix}\label{B}
Please refer to Appendix \ref{A}.

\section{Third appendix}\label{C}
Please refer to Appendix \ref{B}.

\end{subappendices}

\end{document}
Additional comments:
  • Both the titletoc and the tocloft packages modify the table of contents. Use one or another, but not both.
  • \bf is an obsolete command. Use \bfseries or \textbf instead. Please note that, contrarily to \textbf, the commands \bf and \bfseries have no argument. Thus, write {\bfseries text more text} or \textbf{text more text}.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
mfiligree
Posts: 25
Joined: Tue Feb 03, 2009 7:52 pm

Re: Appendix

Post by mfiligree »

Great ~ thanks for your help!
Post Reply