LaTeX specific issues not fitting into one of the other forums of this category.
NELLLY
Posts: 113 Joined: Thu Nov 26, 2009 2:21 am
Post
by NELLLY » Mon Mar 14, 2016 12:03 am
Hello, I need to change the word "chapter" y "Appendix" in the appendices. By using the code below I get the customization in the appendices. I need also to get to customize the chapters of the appendices in the table of contents by getting for those chapters the word "Appendix" instead of "Chapter". Is there a solution?
Code: Select all
\documentclass{report}
\usepackage[english]{babel}
\usepackage[toc,page]{appendix}
\usepackage{tocloft}
\makeatletter
\@addtoreset{section}{part}
\makeatother
\newlength\mylen
\renewcommand\thepart{\Roman{part}}
\renewcommand\cftpartpresnum{Part~}
\settowidth\mylen{\bfseries\cftpartpresnum\cftpartaftersnum}
\addtolength\cftpartnumwidth{\mylen}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftchappagefont}{\bfseries}
\renewcommand{\cftchappresnum}{Chapter }
\renewcommand{\cftchapaftersnum}{}
\renewcommand{\cftchapnumwidth}{6em}
\begin{document}
\tableofcontents
\chapter{..}
\chapter{...}
\begin{appendices}
\renewcommand{\chaptername}{Appendix}
\chapter{Derivation of X}
The contents...
\chapter{Derivation of Y}
\section{A}
\end{appendices}
\end{document}
Last edited by
NELLLY on Mon Mar 14, 2016 2:03 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by Johannes_B » Mon Mar 14, 2016 11:25 am
Personally i am against writing stuff like appendix before entries, even more since you already have an entry stating that the appendices start. Well...
Code: Select all
\documentclass{report}
\usepackage[english]{babel}
\usepackage[toc,page]{appendix}
\usepackage{tocloft}
\makeatletter
\@addtoreset{section}{part}
\makeatother
\newlength\mylen
\renewcommand\thepart{\Roman{part}}
\renewcommand\cftpartpresnum{Part~}
\settowidth\mylen{\bfseries\cftpartpresnum\cftpartaftersnum}
\addtolength\cftpartnumwidth{\mylen}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftchappagefont}{\bfseries}
\renewcommand{\cftchappresnum}{Chapter }
\renewcommand{\cftchapaftersnum}{}
\renewcommand{\cftchapnumwidth}{7em}%This overwrites the calculation before
\begin{document}
\tableofcontents
\chapter{..}
\chapter{...}
\begin{appendices}
\addtocontents{toc}{\protect\renewcommand{\protect\cftchappresnum}{Appendix }}
\renewcommand{\chaptername}{Appendix}
\chapter{Derivation of X}
The contents...
\chapter{Derivation of Y}
\section{A}
\end{appendices}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
NELLLY
Posts: 113 Joined: Thu Nov 26, 2009 2:21 am
Post
by NELLLY » Mon Mar 14, 2016 2:00 pm
It works perfectly now. Thanks.