0

I'm using LyX with the Book document class and the appendix package to include an appendix for each chapter. To avoid global switch issues, I'm wrapping each appendix in an appendices environment like this:

\begin{appendices} \chapter{Appendix for Chapter 1} content here \end{appendices} 

However, in my Table of Contents, the title "Appendices" appears repeatedly for each chapter's appendix. I tried using commands like \appendixtitleoff and even redefining \appendixname, but the unwanted "Appendices" heading still shows up in the TOC for every appendix chapter.

Has anyone encountered this issue or found a way to prevent the "Appendices" title from being inserted into the Table of Contents multiple times? Any advice or workarounds would be appreciated!

Edit: In Document setting preamble,

\usepackage[toc]{appendix} 

And in the document,

\documentclass{book} \begin{document} \chapter{Main Chapter 1} This is the content of the first chapter. \begin{appendices} \chapter{Appendix for Chapter 1} This is the appendix for Chapter 1. \end{appendices} \chapter{Main Chapter 2} This is the content of the second chapter. \begin{appendices} \chapter{Appendix for Chapter 2} This is the appendix for Chapter 2. \end{appendices} \end{document} 
8
  • welcome! can you provide us with code for a minimal document we can compile to reproduce the output you describe? Commented Jan 31 at 23:20
  • 2
    please don't quote code. instead use the {} button to format it as code. Commented Jan 31 at 23:21
  • In Document setting preamble, \usepackage[toc]{appendix} And in the document, \documentclass{book} \begin{document} \chapter{Main Chapter 1} This is the content of the first chapter. \begin{appendices} \chapter{Appendix for Chapter 1} This is the appendix for Chapter 1. \end{appendices} \chapter{Main Chapter 2} This is the content of the second chapter. \begin{appendices} \chapter{Appendix for Chapter 2} This is the appendix for Chapter 2. \end{appendices} \end{document} Commented Jan 31 at 23:28
  • If you want an appendix in each chapter, one should use subappendices and \section{Appendix for Chapter 1}. See page 4 of the appendix manual. Commented Jan 31 at 23:37
  • @JohnKormylo I'm guessing the OP wants each appendix to be a chapter rather than part of a chapter, although I think your suggestion would be more logical. Commented Jan 31 at 23:39

2 Answers 2

2

Remove the toc option when loading the package:

\usepackage{appendix} 

reduced toc

\documentclass{book} \usepackage[]{appendix} \begin{document} \tableofcontents \chapter{Main Chapter 1} This is the content of the first chapter. \begin{appendices} \chapter{Appendix for Chapter 1} This is the appendix for Chapter 1. \end{appendices} \chapter{Main Chapter 2} This is the content of the second chapter. \begin{appendices} \chapter{Appendix for Chapter 2} This is the appendix for Chapter 2. \end{appendices} \end{document} 
1
  • Thank you so much! Commented Feb 1 at 0:18
1

Here is the subappendices solution. You should get 1.A and 2.A for the sections. The toc option doesn't seem to matter.

\documentclass{book} \usepackage[toc]{appendix} \begin{document} \tableofcontents \chapter{Main Chapter 1} This is the content of the first chapter. \begin{subappendices} \section{Appendix for Chapter 1} This is the appendix for Chapter 1. \end{subappendices} \chapter{Main Chapter 2} This is the content of the second chapter. \begin{subappendices} \section{Appendix for Chapter 2} This is the appendix for Chapter 2. \end{subappendices} \end{document} 

demo

1
  • I think the toc option matters if you use appendices but not subappendices as the latter is designed for per chapter use. so it really depends what the relationship between chapter and appendix is intended to be .... Commented Feb 1 at 2:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.