How do I increase the spacing between the numbering and the text in the table of contents? Note that I am using the article class and use \addcontentsline{toc}.    Code:  \documentclass[12pt]{article}  \newcounter{chapternum} \newcounter{examplenum}  \newcommand{\example}{\stepcounter{examplenum} \noindent{\large{\color{Red}{Example \theexamplenum: }}}\addcontentsline{toc}{subsubsection}{Example \theexamplenum}} \renewcommand\thesection{\thechapternum.\arabic{section}} \renewcommand\thesubsection{\thesection.\arabic{subsection}}  \begin{document} \stepcounter{chapternum}  \tableofcontents %Ignore the page numbers; the picture is a screenshot from my document and this code is a MWE.  \section{Sets}  \subsection{Introduction to Sets}  \subsection{Union and Intersection}  \example  \subsection{Special Sets}  \subsection{Interval Notation}  \example  \end{document}
4071
Following minimal document:  \documentclass{report}  \begin{document} \renewcommand*\thechapter{\Roman{chapter}} \tableofcontents \setcounter{chapter}{6} % Problem starts at chapter 7 \chapter{Seven} \chapter{Eight} \section{Eight-one} \section{Eight-two} \end{document}   yields this output (cut to size for your convenience):    Clearly, the chapter (and section) headings hang into the chapter (section) numbers. For the previous chapter numbers, this isn’t a problem since all chapter titles are aligned to the same column and the numbers I–VI are sufficiently narrow.  (The same happens regardless of document type, I’m actually using scrreprt with the same result.)  How can I prevent this?
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.
108282
This is a follow up question on   How do I change the toc dept mid document while using packages (in this case only mathtools).  An example:  \documentclass[a4paper,10pt,oneside]{book}  \usepackage{mathtools}  \begin{document}   \frontmatter             \chapter{hello}  \section{hello}  \subsection{hello}  \subsubsection{hello}   \setcounter{tocdepth}{3}  \tableofcontents   \mainmatter   \chapter{hello}  \section{hello}  \subsection{hello}  \subsubsection{hello}   \chapter{hello}  \section{hello}  \subsection{hello}  \subsubsection{hello}   \appendix   \addtocontents{toc}{\setcounter{tocdepth}{0}}   \chapter{hello}  \section{hello}  \subsection{hello}  \subsubsection{hello}   \chapter{hello}  \section{hello}  \subsection{hello}  \subsubsection{hello}  \end{document}   This example generates an error and very strangely puts an exclamation mark in the ToC as you can see here   however when I comment out the \usepackage{mathtools} it suddenly works again or replacing it with a different package such as \usepackage[T1]{fontenc} also generates no errors.  But this is not limited to just this specific package, certain other packages also introduce the same behavior (I just took this package to keep the example small).
54132
I'm trying to add sample code to my document. It seems that the listing is left aligned with the margin, and the numbers go outside it. How should I align the number, instead of the code? Here is my latex code:  \documentclass[a4paper,10pt]{article} \usepackage[utf8x]{inputenc} \usepackage{listings}  %opening \title{} \author{}  \begin{document} Some dummy text. Some dummy text. Some dummy text. Some dummy text. \begin{figure} \begin{minipage}[b]{0.4\linewidth} \begin{lstlisting}[language=C, %frame=single, basicstyle=\footnotesize\ttfamily, numbers=left,stepnumber=1, morekeywords={assert} ] void test(int x, int y){   if(x &gt; 5){     x++;     if (x &lt; 3)        x--;     else        y = x;   }   assert (x &lt; 10 ); } \end{lstlisting} \caption{A simple example} \end{minipage}  %another minipage goes here  \end{figure}  \end{document}   Thank you.
51959
Below picture shows my table of contents  The title size (the word, Contents) is very big, maybe Huge. I never set it as Huge and I searched the whole LaTeX file, there is no the word "huge" at all.  And the number is start with 0, for example "0.1 Introduction", not the normal "1 Introduction"  Below is the only code related with ToC  \usepackage[subfigure]{tocloft} . . . \setcounter{tocdepth}{2} \tableofcontents   What problem it can be?  PS: I tried to use \usepackage{xpatch}, but this one does not work   I use report   \documentclass[a4paper,leqno,twoside]{report}   Thanks everyone! I changed report to article, the problem is gone!
85577
I work with documentclass report and use fancyhdr package for chapters in this way:  \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\chaptermark}[1]{\markright{\thechapter\ #1}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhf{} \fancyhead[LO]{\bfseries\nouppercase\rightmark} \fancyhead[RE]{\bfseries\nouppercase\leftmark} \fancyhead[RO]{\bfseries\nouppercase\thepage}  \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\footrulewidth}{0pt} \addtolength{\headheight}{0.5pt} \fancypagestyle{plain}{ \fancyhead{}  \renewcommand{\headrulewidth}{0pt}  }   I would like to change space between the line and the following text. Can anyone help me?
26938
With the following example, I get a different vertical distance between "Contents" and "1 bar 5" and "foo" and "Lorem". How do I get the first entry of the TOC to the same height as "Lorem ipsum", that is the base line should be the red rule in the image below:    \documentclass{book} \begin{document} \tableofcontents  \chapter*{foo} Lorem ipsum  \chapter{bar} Lorem ipsum   \end{document}
105933
In a book, I have several numbered sections followed by an unnumbered section. I have placed an \addcontentsline following the \section* that introduces the unnumbered section, so that it will appear (unnumbered) in the ToC; that works fine. However, the page headers for the unnumbered section are continued from the last numbered section.  I am using fancyhdr with the following setup:  \pagestyle{fancy} \fancyheadoffset{0in} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}  \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[C]{\bfseries \draftinfo} \fancyhead[LO]{\sf\rightmark} \fancyhead[RE]{\sf\leftmark} \fancyfoot[C]{\bfseries \draftinfo} \fancypagestyle{plain}{%   \fancyhead{} % get rid of headers   \renewcommand{\headrulewidth}{0pt} % and the line }
25166
Consider this example:  \documentclass[a4paper]{article} \usepackage{listings} \lstnewenvironment{shell}{}{} %\usepackage{verbatim} %\let\shell\verbatim %\let\endshell\endverbatim \begin{document}  \subsubsection{Test1}  \begin{shell} test \end{shell} Some text  \subsubsection{Test2}  More text, Test2 has no spacing above  \subsubsection{Test3}  Looks ok \end{document}   When I compile this I get    where did the space above section Test2 go? If I don't use listings, say the commented stuff, things are ok.  Any ideas?  Versions listed below.   article.cls    2007/10/19 v1.4h Standard LaTeX document class   size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option) listings.sty    2013/08/26 1.5b (Carsten Heinz)   keyval.sty    1999/03/16 v1.13 key=value parser (DPC)  lstmisc.sty    2013/08/26 1.5b (Carsten Heinz) listings.cfg    2013/08/26 1.5b listings configuration
81973
I'm writing my thesis and I woud like to add a minitoc at the beginning of each chapter. However, I don't like the standard format where the titles of the sections are listed as in the main TOC and I would like to align the titles on the same row (a format I saw in several books), maybe sperated by a comma or a textbullet. I mean something like this:     Chapter 1      Contents      1.1 Sec 1, 1.2 Sec 2, 1.3 Sec3, 1.4 Sec 4   I can do this for the main TOC through the titletoc package, but I need it for minitoc. Is there a way to have this customization of the minitoc? Thank you in advance.
64897
How can I learn the horizontal distance between the chapter number and the chapter title both in ToC  and the body text where I use \documentclass[12pt,reqno]{book}. Which keys hold these values?
39576
How do I temporarily increase line spacing? I have some text on my title page:  \begin{center} { \Large \textbf{The Great Thesis About Some Very Great Things Indeed With a Pretty Long Title That Will Probably Be Split Between at Least Two Lines Or So} } \end{center}   I'm finding that the line spacing here is too small, but it's fine elsewhere in the document. How can I make the spacing bigger for just this piece of text?
102224
I have found that for only one page (so far) the spacing between the header and content is different from the spacing on all the other pages. You can see this behavior in the images below (from pages 2 and 3 of the document):     My .tex file contents are shown below.  \documentclass[a4paper]{report} \usepackage{fullpage} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \setlength{\headsep}{0.5cm}  \begin{document} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\chaptermark}[1]{\markboth{\thechapter. #1}{}} \fancyhead[L]{\bfseries \leftmark} \fancyhead[R]{\bfseries \rightmark}  \chapter{Version Control} \lipsum \lipsum \lipsum \lipsum  \end{document}
4677
I would like to add a dot between the number of the section and section name. I used   \makeatletter \renewcommand*{\@seccntformat}[1]{% \csname the#1\endcsname .} \makeatother   The problem is that, obviously, it put a dot also among subsection number and subsection name which I do not want. Is it possible to add the dot only between section number and section using low level instructions i.e. without any additional package?
67691
In a table of contents that has been generated with LaTeX's \tableofcontents command, I would like to add a vertical space before a Chapter item in the table of contents. One way that I have in my notes is to use  \addtocontents{toc}{\protect\vspace{10pt}}   at a desired location in the document so that this gets processed by \tableofcontents to include an appropriate vertical space in the table of contents. I have two questions:   Is the above the correct way to get a vertical space in a table of contents? Why is it necessary to use the \protect command here?   Thank you...
115242
I need to adjust the vertical spacing between three tables as defined in the following MWE.   \vspace{30pt} only works for between the second and third table. I'm suspecting this has something to do with the minipages defined but I need them for the footers beneath the tables.   Any clues?  \documentclass[12pt, a4paper]{report}  \begin{document} \begin{table}[t] \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline     \multicolumn{1}{|c|}{X} &amp; \multicolumn{1}{c|}{Y} &amp; \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} &amp; \multicolumn{1}{c|}{62.9\% (73.2\%)} &amp; \multicolumn{1}{c|}{213} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} &amp; \multicolumn{1}{c|}{81.5\% (92.8\%)} &amp; \multicolumn{1}{c|}{638} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} &amp; \multicolumn{1}{c|}{80.9\% (93.8\%)} &amp; \multicolumn{1}{c|}{560} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} &amp; \multicolumn{1}{c|}{94.8\% (98.7\%)} &amp; \multicolumn{1}{c|}{155} \\ \hline \end{tabular} \caption{Results for a} \end{minipage} \vspace{30pt} \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline   \multicolumn{1}{|c|}{X} &amp; \multicolumn{1}{c|}{Y} &amp; \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} &amp; \multicolumn{1}{c|}{67.7\% (81.7\%)} &amp; \multicolumn{1}{c|}{344} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} &amp; \multicolumn{1}{c|}{80.4\% (92.6\%)} &amp; \multicolumn{1}{c|}{810} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} &amp; \multicolumn{1}{c|}{82.1\% (94.2\%)} &amp; \multicolumn{1}{c|}{727} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} &amp; \multicolumn{1}{c|}{90.6\% (97.0\%)} &amp; \multicolumn{1}{c|}{267} \\ \hline \end{tabular} \caption{Results for B} \end{minipage} \vspace{30pt} \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline   \multicolumn{1}{|c|}{X} &amp; \multicolumn{1}{c|}{Y} &amp; \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} &amp; \multicolumn{1}{c|}{73.2\% (79.4\%)} &amp; \multicolumn{1}{c|}{97} \\     \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} &amp; \multicolumn{1}{c|}{86.0\% (94.0\%)} &amp; \multicolumn{1}{c|}{315} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} &amp; \multicolumn{1}{c|}{88.5\% (95.5\%)} &amp; \multicolumn{1}{c|}{157} \\    \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} &amp; \multicolumn{1}{c|}{90.5\% (95.9\%)} &amp; \multicolumn{1}{c|}{74} \\ \hline \end{tabular} \caption{Results for C} \end{minipage} \end{table}  \end{document}
123065
I would like to obtain an advice regarding the TOC for an article. I wonder if the following serpent-like output caused by numbers of subsections being longer than those of sections is my mistake or is intended like that by amsart? If not, I'd like to know, even manually, how to correct it? I have tried a double title (one in square brackets having more space before the text) but no result.  \documentclass{amsart} % \usepackage{titletoc} \usepackage{amsthm} \usepackage[english]{babel}   \begin{document}    \tableofcontents  %% --------------------------  \section{First Movement}  \subsection{Allegro con brio}    \subsection{Allegro senza brio}    \section{Second Movement}   \subsection{Adagio}   \subsection{Piu adagio}   \subsection{Ancora piu adagio}   \section{Third Movement: ``la sveglia''}  \section{Finale}  \subsection{Prestisisimo}   \end{document}