GeneralCommand in LaTex

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Hakarl
Posts: 14
Joined: Sun Feb 18, 2018 7:59 pm

Command in LaTex

Post by Hakarl »

A friend of my was helping set up a master file for a book. It is been while since this happened but as I tried to add Appenices (As chapters not sections since it for a book) so odd things happened. In the TOC the Appendix headings repeated - such as in Appendix A Appendix A and moreover overprinted the title of the Appendix Chapter. Also he had include a command which I have % out since nothing ran with. So I have two questions: First, what is the command and what does it do? Second, why is the appendix heading showing up twice. I am at a loss. Here is the code:

Code: Select all

\begin{appendices}
\appendix
%\updatechaptername - what is this for and what does it do???
\addtocontents{toc}{\def\protect\cftchappresnum{\appendixname{} }}
\input{App1_ Chaps/Append_folder/AppendixChap1}
\input{App1_ Chaps/Append_folder/AppendixChap1}
\end{appendices}
I used "input" to load the Appendix chapter into the main document but changing that to "include" did not make a difference.

Thanks in advance,

Hakarl
Last edited by Stefan Kottwitz on Sat Jun 23, 2018 11:16 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Command in LaTex

Post by Stefan Kottwitz »

I saw that command defined like this:

Code: Select all

\newcommand{\updatechaptername}{%
   \addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{\@chapapp\ }}
}
You can try adding this definition in your document preamble, and compile two times, to update the table of contents.

Stefan
LaTeX.org admin
Hakarl
Posts: 14
Joined: Sun Feb 18, 2018 7:59 pm

Command in LaTex

Post by Hakarl »

Stefan,

Thanks for the suggestion. I will try it. By the way the segment I posted is in the Backmatter. Is that an issue?

Hakarl
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Command in LaTex

Post by Stefan Kottwitz »

That's not an issue. But if you see any other issue, try posting specific code that allows us to reproduce it in order to fix it.

Stefan
LaTeX.org admin
Hakarl
Posts: 14
Joined: Sun Feb 18, 2018 7:59 pm

Command in LaTex

Post by Hakarl »

Stefan,

Thanks again. I will give the old college try.

Hakarl
Post Reply