Page Layoutappendix package

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

appendix package

Post by spiegboy »

Appendix package is supposed to set the counter of chapter to zero according to its documentation. However the first chapter remains 1 when I tried it

Code: Select all

\documentclass[11pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum,appendix}

\begin{document}
\tableofcontents

\chapter{Diplomatic Memoirs}
\lipsum[1]
\chapter{Student Memoirs}
\lipsum[2-3]
\appendix
\addappheadtotoc
\chapter{published papers} % appeared as appendix A
\lipsum[2-3]
%\chapter{Equation deduction} % appeared as appendix B
%\lipsum[2-3]
\end{document} 

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: appendix package

Post by localghost »

I don't see the problem. Your example works as expected. You should describe you own expectations more clearly.


Best regards
Thorsten
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

appendix package

Post by spiegboy »

localghost wrote:I don't see the problem. Your example works as expected. You should describe you own expectations more clearly.


Best regards
Thorsten
Okay, I expect chapter starts counting from zero not from one. The appendix package documentation states it redefines the chapter counter as I expected. But it doesnt work for the codes I put on. Is there any solution?

Cheers
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

appendix package

Post by frabjous »

I believe what's going on here is that the chapter counter does start at 0, but goes up to 1 when you add the first \chapter{...} command. So if you want the first one to be chapter 0, you need to start it off with -1.

Code: Select all

\documentclass[11pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum,appendix}

\begin{document}
\tableofcontents
\setcounter{chapter}{-1}
\chapter{Diplomatic Memoirs}
\lipsum[1]
\chapter{Student Memoirs}
\lipsum[2-3]
\appendix
\addappheadtotoc
\chapter{published papers} % appeared as appendix A
\lipsum[2-3]
%\chapter{Equation deduction} % appeared as appendix B
%\lipsum[2-3]
\end{document} 
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: appendix package

Post by spiegboy »

oh, i see.
How smart!!
cheers
Post Reply