Generalappendix in a report --- section numbers

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
marcoslatex
Posts: 1
Joined: Tue Dec 08, 2009 6:41 pm

appendix in a report --- section numbers

Post by marcoslatex »

Hello,

I am using the report class to produce a document divided into chapters, and after some chapters I have an appendix. I am using the command appendix to generate them.

The problem is that I get the appendix only numbered as "A". Name of the apppendix, but I would also like to have the chapter on it: say, "3.A", "3.B", etc. (in both the apendix page itself and table of contents which uses hyperref)

The code is:

Code: Select all

\renewcommand\appendix{\par

\footnotesize
\numberwithin{equation}{section}

 \def\section@prefix{\footnotesize\appendixname\ }%
\def\section@numbersep{:}%
\setcounter{section}{0}%
\gdef\thesection{\@Alph\c@section}
\renewcommand*{\theHsection}{\Alph{section}}

}
I tried the code:

Code: Select all

\gdef{\thechapter\thesection{\@Alph\c@section}}
but I get 4.1, 4.2 for the appendix and I want 4.A, 4.B, etc... :?:

What am I doing wrong?

Thanks very much!


Marcos

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

appendix in a report --- section numbers

Post by kaiserkarl13 »

Does the following work?

Code: Select all

\let\stdsection\thesection
\renewcommand{\appendix}{%
  \renewcommand{\thesection}{\thechapter.\Alph{section}}%
  \setcounter{section}{0}
}
\let\oldchapter\chapter
\renewcommand{\chapter}{\let\thesection\stdsection\oldchapter}
By the way, it's uncommon for reports to have appendices at the end of each chapter (which is why \appendix is defined to simply redefine the labels on the chapters).
Post Reply