I'm writing a book class document and use the appendix package also. I'm having some problem with the table of contents and the appendix section that appears in the ToC. So, in the table of contents contents  I have :  1 chapter_name 2 chapter_name 3 chapter_name A appendix_name B appendix_name   What I would like to have is instead :  1 chapter_name 2 chapter_name 3 chapter_name appendix_name appendix_name   I'm not able to remove the "A" and "B" letters from the ToC. Maybe because of the book class?   Anyone that can please help me with this problem?  Thanks very much, Michele.  Edit1: I'm my thesis now I solved the problem but with this code the problem still exists. I'm still trying to understand differences between my thesis and the code that follows.      Edit2: I was freaking out but I found a workaround to the problem (but now I wouldn't say the problem is 100% solved).  The trick is compile the code that follows, than comment the line \backmatter and recompile the code. In this way the first letter "A" and "B" disappeared. If you recompile for a second time the code with %\backmatter the problem of letters magically reappears!             \documentclass[a4paper,10pt]{book}    \usepackage[utf8]{inputenc}    \usepackage[titletoc]{appendix}    \usepackage{lipsum}    \begin{document}    \tableofcontents    \cleardoublepage    \mainmatter    \chapter{Chapter 1}    \lipsum    \chapter{Chapter 2}    \lipsum    \chapter{Chapter 3}    \lipsum    \chapter{Chapter 4}    \lipsum    \backmatter    \appendix    \begin{appendix}    \chapter[Appendix A]{Appendix A}    \lipsum    \end{appendix}    \begin{appendix}    \lipsum    \chapter[Appendix B]{Appendix B}    \end{appendix}            \end{document}
123299
I am a newbie in Latex. My goal is to have the word "Chapter" in the title of any chapter, and the word "Appendix" in the title of appendix. I also want to add "Appendix" in TOC. However, using the following MWE from my university, I end up having "Appendix A" in TOC. How can I remove the letter "A" in TOC.  \documentclass[12]{thesis}  \RequirePackage{tocloft} \RequirePackage{titlesec} \usepackage[titletoc]{appendix}  \newcommand{\spacemultiplier}{1.5} \renewcommand{\baselinestretch}{\spacemultiplier}\normalsize  \renewcommand{\frontmatter}{ %TABLE OF CONTENTS \addcontentsline{toc}{chapter}{Contents} {\renewcommand{\baselinestretch}{1}\normalsize \tableofcontents } \newpage \titleformat{\chapter}[display]{\renewcommand{\baselinestretch}{1.5}\LARGE\sc\fillast}{Chapter   \thechapter}{0pt}{}[\renewcommand{\baselinestretch}{\spacemultiplier}\normalsize] \titlespacing{\chapter}{0pt}{1.4cm}{20pt} \setcounter{chapter}{0} }  % Appendix setup \newcommand{\universityappendix}{ \appendix \titleformat{\chapter}[display]{\renewcommand{\baselinestretch}{1.5}\normalsize \LARGE\sc\fillast}{Appendix}{0pt}{} \titlespacing{\chapter}{0pt}{-30pt}{20pt} \renewcommand{\baselinestretch}{1.5}\normalsize }   \begin{document}  \frontmatter  \chapter{blah blah} This is a chapter  \universityappendix \begin{appendices} \chapter{blah blah} this is appendix \end{appendices} \end{document}   Thanks
107513
The current code for my latex document is this:  \documentclass[12pt,notitlepage]{report}  \usepackage{lipsum}    \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \fancyhead[C]{\nouppercase{\textit \leftmark}}  \begin{document}  \pagenumbering{roman}  \thispagestyle{plain} \tableofcontents \addcontentsline{toc}{chapter}{Table of Contents} \thispagestyle{plain}  \newpage  \pagenumbering{arabic} \chapter{One} \lipsum[2-5]   \end{document}   I want to remove the "Chapter 1." keyword from my header "Chapter 1. One" and I want it like this: "1-One". How to do it?
74357
I'm finalizing my dissertation, and they require that the "Table of Contents - Continued" heading in the ToC (that shows if it flows onto a second page) be centered.  I thought I could find the code that generates the ToC and just customize it a bit, but I can't even find what's generating it...  Anybody have any ideas how I could work this out, or where the code is?
39041
I have a table of contents (\tableofcontents) in my document. How can I hide subsections in it? I want that only names of sections are displayed there.
114742
I need to include code in the appendix of my thesis. The code contains comments and the compilation instantly breaks returning:  Unicode char �\lst@FillFixed@ (U+5A8) (inputenc)                not set up for use with LaTeX. l.160       if (lastArg &lt; 0, lastArg = 360°                                               + lastArg);   This is only one of many characters which produce problems. I cannot change my entire code just because this won't compile. Is there any way to include code with arbitrary unicode characters? Thank you.   Edit: complete sample code, as requested.  \RequirePackage[l2tabu,orthodox]{nag}   \documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc]{scrbook} % one-sided   \usepackage[toc,page]{appendix} \usepackage{listings} \usepackage[utf8]{inputenc}  \lstset{     inputencoding=utf8,   extendedchars=true,   basicstyle=\footnotesize\ttfamily,   showstringspaces=false,   showspaces=false,   numbers=left,   numberstyle=\footnotesize,   numbersep=9pt,   tabsize=2,   breaklines=true,   showtabs=false,   captionpos=b,     literate={ö}{{\"o}}1 {ä}{{\"a}}1 {ü}{{\"u}}1  }  \begin{document}  \begin{appendices} \lstinputlisting{code/power_series.html} \end{appendices}  \end{document}   Relevant content of power_series.html:  if (lastArg &lt; 0, lastArg = 360° + lastArg);   There really is not much to say about this problem. I only want to be able to use all unicode characters inside a listing. Thank you.
75821
How do I remove "Chapter N" from the chapters when using the book document class?  This does not appear in the TOC (which I don't want, either).  But it appears at the beginning of a chapter, and on each page, in the header.
28690
How do I include a chapter reference within the table of contents without giving it a chapter number? I am using the report document class.  Normally, I would create a chapter as follows:  \chapter{Some Chapter}   but this results in the chapter being given a number. Currently I am using  \chapter*{Some Chapter}   which gets rid of the number, but then it is absent from the table of contents.
65804
I get a blank page between “Acknowledgement” and “Table of contents”. How can I remove it? I used a template from somewhere. The preamble is as follows:  \documentclass[openany,12pt]{ubthesis} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{srcltx} \usepackage{graphicx} \usepackage{amsmath} \usepackage{epsfig} \usepackage{dsfont} \usepackage{url} \usepackage{color, soul} \usepackage{natbib} \usepackage{lscape} \usepackage{subfigure} \usepackage{amsthm} \usepackage{indentfirst} \usepackage[subfigure]{graphfig} \usepackage{float} \floatstyle{plaintop} \restylefloat{table}  \usepackage{setspace} \usepackage{booktabs} \usepackage{tikz}  \usepackage[export]{adjustbox}  \usepackage[titletoc]{appendix} \usepackage{listings}  \usepackage{color}  \definecolor{mygreen}{RGB}{28,172,0}  \definecolor{mylilas}{RGB}{170,55,241} \input{gams.tex}%newly added 0803  \pagestyle{plain} \setulcolor{red} \bibpunct[, ]{(}{)}{;}{a}{,}{,} \def\bibfont{\small} \def\bibsep{\smallskipamount} \def\bibhang{24pt} \def\newblock{\ } \def\BIBand{and}  \widowpenalty=10000 \clubpenalty=10000 \raggedbottom  \newtheorem{theorem}{Theorem}[chapter] \renewcommand{\thetheorem}{\arabic{chapter}.\arabic{theorem}}   \newtheorem{acknowledgment}[theorem]{Acknowledgment} \newtheorem{algorithm}[theorem]{Algorithm} \newtheorem{axiom}[theorem]{Axiom} \newtheorem{case}[theorem]{Case} \newtheorem{claim}[theorem]{Claim} \newtheorem{conclusion}[theorem]{Conclusion} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{corollary}[theorem]{Corollary} \renewcommand{\thecorollary}{\arabic{chapter}.\arabic{corollary}} \newtheorem{criterion}[theorem]{Criterion} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{exercise}[theorem]{Exercise} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{notation}[theorem]{Notation} \newtheorem{problem}[theorem]{Problem} \newtheorem{prop}{Proposition}[chapter] \newtheorem{remark}[theorem]{Remark} \newtheorem{solution}[theorem]{Solution} \newtheorem{summary}[theorem]{Summary} \renewenvironment{proof}{\bf Proof:}{}
23136
I have the following code:  \documentclass[a4paper,12pt]{article} \usepackage[margin=2cm]{geometry} %showframe \begin{document} \tableofcontents \newpage \section*{Abstract} \section{Introduction} \newpage \bibliographystyle{apacite} \bibliography{references} \end{document}   And when I create the table of contents it adds the "References" in the TOC, how can I remove this to not be included in TOC? So far I have tried something like   \bibliography*{references}
24736
I'm new to latex, I'm thankful if someone can give me an example script to customize TOC that looks like  Chapter 1.XXXXXX                                                            (1-15)  1.1 Introduction 1.2 xxxxxxxx 1.3 xxxxxxxxxx 1.4 xxxxxxx ...............  Chapter 2.xxxxxxx  2.1 xxxxx ......                                                           (16-30)  because the (default) TOC appears to be very large for my book, since it arranges the section name row-by-row.
117086
Is it possible to omit a single specific subsection from the table of contents, while keeping it numbered as usual within the main body, and keeping other subsections listed?  (I am using the amsart class.)
31468
I am writing a large article type document with a series of complex appendices in it.  I have included a local table of contents with each appendix that lists the sections and subsections within that specific appendix (the local TOC for Appendix A lists only that appendix's subsections, etc) using tools from the etoc package.  What I would like to do is have my appendix sections contain numbered subsections/subsubsections, but have the subsections/subsubsections only appear in the appendix local TOC. However I still want the appendix sections to appear in the main TOC.  Here is a rough approximation of my setup:  \documentclass{article}  \usepackage{tocloft} % Adds tools for TOC customization \usepackage{etoc} % Local toc \usepackage[titletoc,title]{appendix}  \begin{document}    \setcounter{tocdepth}{3}   \tableofcontents    \section{First section}     \subsection{a Subsection}   \section{Second section}     \subsection{a Subsection}     \subsection{Another Subsection}    \begin{appendix}     \section{Appendix A} % &lt;- I want this to appear in the main TOC       \etocsetnexttocdepth{2}       \localtableofcontents       \subsection{Appendix Subsection} % &lt;- I want this to appear in the local TOC, but not the main TOC   \end{appendix}  \end{document}   And the output:
73392
As you can see from the image below, I have an issue with the text alignment of extra long chapter names. How can I fix it so that the text will not go further left than the start of the chapter name? That is, I don't want any text to be underneath the "Appendix A" part.  I added that red line just to show how I'd like it aligned, if possible.    Here's my MWE:  \documentclass{book} \let\cleardoublepage\clearpage  \RequirePackage{titletoc} \RequirePackage{tikz} \RequirePackage[explicit]{titlesec} \RequirePackage{DejaVuSansCondensed} \RequirePackage[normalem]{ulem} \RequirePackage[   left=2.25in,   right=0.75in,   top=1.25in,   bottom=1.25in,   marginparwidth=1.75in,   marginparsep=.25in,   asymmetric]{geometry}  \renewcommand*\familydefault{\sfdefault} % Set default font  %%% Table of Contents ---------------------------------------------------------- \setcounter{tocdepth}{1} % Show only Chapters and Sections  %%% Change font/color/layout of TOC \makeatletter \titlecontents{chapter}[-2em] {\color{cyan}\bfseries\LARGE\addvspace{3mm}} {\makebox[4.4em][r]{\@chapapp}\contentslabel{-0.25em}\hspace{1.9em}} {} {\hspace{3em}\contentspage} \g@addto@macro{\appendix}{%   \addtocontents{toc}{\protect\renewcommand*{\protect\@chapapp}{\protect\appendixname}}% } \makeatother  \titlecontents{section}[5.3em] {\color{cyan}\large\itshape\addvspace{3mm}} {\contentslabel{0em}\hspace{3.2em}} {} {\hspace{3em}\contentspage} [\addvspace{0mm}]  %%% Chapter Header ---------------------------------------------------------- \makeatletter \titleformat{\chapter}   {\normalfont\sffamily\Huge\scshape}   {}{0pt}   {\thispagestyle{empty}    % Remove page number on new chapters   %\setcounter{definition}{0}   \begin{tikzpicture}[remember picture,overlay]     \node[yshift=-3cm] at (current page.north west)       {\begin{tikzpicture}[remember picture, overlay]         \draw[fill=cyan] (0,-1) rectangle           (25cm,3cm);         \draw[fill=cyan] (0,-24) rectangle           (25cm,-25cm);         \ifttl@label% &lt;---------------------- Added condition on \ifttl@label           \node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]               {\color{white}\LARGE \MakeUppercase{\@chapapp} \Huge\thechapter};         \fi% &lt;------------------------------- end condition on \ifttl@label        \end{tikzpicture}       };    \end{tikzpicture}\endgraf   \vskip-.7cm   \color{cyan}\Huge\raggedright\leftskip-1cm    \noindent\MakeUppercase{#1}\endgraf   } \makeatother  \titlespacing*{\chapter}{0pt}{10pt}{0pt}{}  \titleformat{\section}{\color{cyan}\itshape\LARGE}{\llap{\thesection} #1}{1em}{}[\titleline{\color{cyan}\titlerule[1pt]}] \titleformat{\subsection}{\color{cyan}\normalfont\large}{\; #1}{1em}{}  \begin{document}   \tableofcontents   \chapter{Turing Machines}     \section{The Turing Machine}     \section{Variations of the Turing Machine}       %\subsection{Non-deterministic Turing Machines}     \section{The Church-Turing Thesis}   \chapter{Decidability}     \section{The Universal Turing Machine}    \appendix   \chapter{ON COMPUTABLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHEIDUNGSPROBLEM} \end{document}
86130
I am using example given here by @stephan .  Works great however I want to get rid of dots and page numbers.  I added this to the preamble   \let\Contentsline\contentsline  \renewcommand\contentsline[3]{\Contentsline{#1}{#2}{}}   that removed the page numbers, but do not know how to remove the dots. I would appreciate your help. Its hard to get result without understanding the basics.
70397
everybody.  I'm finishing my book and I have to solve one las problem: I need to custom the titles of Table of Contents, Introduction (is a \chapter* file), Bibliography and Index in order that they look like the rest of the chapters.  This is a MWE of how I could custom the titles (headers) of the chapters but it doesn't work with the ToC, bibliography, index and chapters marked with asterisk.  \documentclass[reqno]{book} \usepackage[spanish]{babel} \usepackage{fontspec} \usepackage[paperheight=254.81mm,paperwidth=184.81mm,text= {130mm,186mm},centering]{geometry} \usepackage[explicit]{titlesec} \usepackage[svgnames]{xcolor} \usepackage[titletoc]{appendix} \usepackage{titletoc} \usepackage{tocloft}  \newcommand*{\chapnumfont}{% \fontsize{3.2cm}{5cm}% \selectfont% } \newcommand*{\chaptitlefont}{% \fontsize{22}{26}% \selectfont% }  \titleformat{\chapter}[block] {\normalfont\huge\bfseries} {\hspace{-2cm}\parbox{0ex}{\includegraphics[width=1.2\textwidth,height=2 \baselineskip]{RecuadroChap_Original.pdf}}}  {0pt} {\begin{minipage}{11cm}\hspace{2cm}\filleft\chaptitlefont #1\end{minipage} \begin{minipage}{4cm} \filleft\chapnumfont\thechapter}[\end{minipage}]  \renewcommand{\cftchappresnum}{\bfseries Capítulo } \renewcommand{\cftchapaftersnum}{} \renewcommand{\cftchapaftersnumb}{\vskip0.5ex} \renewcommand{\cftchapnumwidth}{0mm}  \begin{document} \tableofcontents \chapter*{Introducción} \chapter{Álgebra de matrices} \begin{appendices} \chapter{Uso de los comandos en MATLAB y MuPAD} \end{appendices} \bibliography{Referencias} \begin{thebibliography}{0} \end{thebibliography} \end{document}   A few notes for providing more and important information: 1.  If I set the Introduction as a \chapter chapter, it shows its title like I need, but it doesn't when I set it as a \chapter* chapter. 2.  If I set the Introduction as a \chapter chapter but I position it into the \frontmatter part (if I use front, main and back matter parts), the title is not shown like I need, again! 3.  I guess that the problem rises because the \titleformat command is not defined for types of chapters like the ToC, bibliography, index and the "*" sections, parts,...  So, I was thinking of a way to set those parts like normal chapters (as \chapter) but I dont know if it is possible.  If it's not, how could I custom those title parts like I need?  This image is a sample (resume) of what I get with the code shown in my MWE   And this is the image of the gray frame for titles:   I need to get the titles of the Toc, Bibliogrphy, Introduction and Index in the same way that I got the titles of Chapter 1 and the Appendix A. How can I do it? By the way: why the bibliography counter is set on 1?  Thanks for your help.
105475
I have many unnumbered sections in my report (more than 100), all created with:  \section*{section name}  I want to find a way to easily add them all to the TOC (specifically to a minitoc). Since I use the * to remove the numbering, they won't appear in TOC. I found out in minitoc documentation that I should use:  \addcontentsline{toc}{section}{repeat here section title}   However, I don't want to have a duplicated title in every section, or even to change all the involved files to add those already written sections to the TOC. How to add those sections' names to the minitoc without using the addcontentsline command? Is it possible?
122296
I am failing to add a heading for the appendix to the ToC with the correct page number:  \documentclass{scrbook} \begin{document} \tableofcontents \chapter{test} \appendix \addcontentsline{toc}{part}{\appendixname} \chapter{First Appendix} \end{document}     I also tried to use the \addappheadtotoc command from the  package, but that changes nothing (expect that it writes 'Appendices' instead).  I assume that the appendix package provides the solution, but I could not figure out how to use it.