LaTeX forum ⇒ Page Layout ⇒ appendix package

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

appendix package

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

\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}

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
I don't see the problem. Your example works as expected. You should describe you own expectations more clearly.

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am
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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
Location: Amherst, MA
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.

\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
oh, i see.
How smart!!
cheers