0

I have a problem for making the table of contents in latex.

  1. Latex is making a blank page after the table of contents how to eliminate it?
  2. I want to reduce the font of the word Contents by setting the font Large
  3. I want to move the Content on the top of the page
  4. In the actual table of content the \subsubsection do not appear in the table of content
  5. I have four latex files. Do you suggest to join all the files in one latex or it would be better to keep them separate? I also have different style of numbering pages for the first 4 pages with roman letter instead the rest of the thesis is in arabic letter.

I just put the preamble and the latex option for the table of content

\documentclass[10pt,a4paper,titlepage]{book} 
\usepackage[paperwidth=165mm, paperheight=238mm, left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
%\usepackage[utf8]{inputenc}
\usepackage{tabularx}

\newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%

\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{empheq, nccmath}
%\usepackage{amsmath}
 %  \usepackage[overload]{empheq}

 \usepackage{empheq, nccmath}
\usepackage{amsfonts}
\usepackage{showframe} 
\usepackage{cases}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<-6> mathx5 <6-7> mathx6 <7-8> mathx7
<8-9> mathx8 <9-10> mathx9
<10-12> mathx10 <12-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}

\DeclareMathAccent{\widebar}{0}{mathx}{"73}  

%\usepackage{rotating}
\usepackage{subfloat}
\usepackage{subcaption}

\usepackage{adjustbox}
\usepackage{showframe} 

\usepackage{fontspec}

\usepackage{lineno}
%\linenumbers
%\renewcommand{\baselinestretch}{1.8} 
\setlength{\parindent}{4em}

\pagenumbering{arabic}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

%\bibliographystyle{plain}
\renewcommand\thesection{\arabic{section}}
\setcounter{secnumdepth}{5}
\usepackage{epstopdf}

\usepackage{nomencl}
\makenomenclature
\usepackage{cases}

\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{A}{Symbols}{%
  \ifstrequal{#1}{B}{Subscripts}{%
  \ifstrequal{#1}{C}{Superscripts}{%
  \ifstrequal{#1}{D}{Acronyms{}}}}}%
]}

 % This will add the units
%----------------------------------------------
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
%----------------------------------------------
\usepackage{titlesec}
\titleformat*{\section}{\bfseries\Large}
%\usepackage{imakeidx}

\usepackage[utf8]{inputenc}
\begin{document}

\tableofcontents 

\section{Hello}
..
\subsection{Hello 1.1}
..
\subsubsection{Hello1.1.1}


..
\section{Road}
..
\section{Road}
..
\section{Road}

...
\end{document}}

enter image description here

4
  • You want to achieve a lot of things in one question ;-) Please reduce your document to the absolute minimum that shows the feature, i.e. kick out unnecessary packages, especially some packages are loaded twice and fontspec and inputenc is completely useless to load both!
    – user31729
    May 26, 2016 at 11:02
  • Sorry, this preamble is a total mess. Use \setcounter{tocdepth}{3} to make the \subsubsections to show up in the ToC!
    – user31729
    May 26, 2016 at 11:08
  • It's also not really useful to post an example that does not show the blank page at all since the 'document' does have one page only :-(
    – user31729
    May 26, 2016 at 11:14
  • The shifting of Contents title upwards is explained in the answers to this question here: tex.stackexchange.com/questions/62125/…
    – user31729
    May 26, 2016 at 11:18

1 Answer 1

2

First of all: I kicked some (but not all) packages out that are not related to the problem.

  • I could not reproduce the blank page issue
  • The ToC title can be shifted upwards with \setlength{\cftbeforetoctitleskip}{0pt} for example (this requires tocloft package)
  • The ToC title font size (and other features) can be set with

    \renewcommand{\cfttoctitlefont}{\bfseries\Large}

    which requires tocloft as well

  • subsubsections do not appear by default in a ToC since the the tocdepth counter has a default value of 2, i.e. only down to subsections will make it to the ToC. Use a value of 3 or larger.


\documentclass[10pt,a4paper,titlepage]{book} 
\usepackage[paperwidth=165mm, paperheight=238mm, left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{tabularx}

\newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%  Where is this used?

\usepackage[english]{babel}
\usepackage{showframe} 


%\linenumbers
%\renewcommand{\baselinestretch}{1.8} 
\setlength{\parindent}{4em} %Sure???

\pagenumbering{arabic}

\usepackage{lineno}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

%\bibliographystyle{plain}
\renewcommand\thesection{\arabic{section}}
\setcounter{secnumdepth}{5}
\usepackage{epstopdf}

\usepackage{nomencl}
\makenomenclature

\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{A}{Symbols}{%
  \ifstrequal{#1}{B}{Subscripts}{%
  \ifstrequal{#1}{C}{Superscripts}{%
  \ifstrequal{#1}{D}{Acronyms{}}}}}%
]}

 % This will add the units
%----------------------------------------------
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
%----------------------------------------------
\usepackage{titlesec}
\titleformat*{\section}{\bfseries\Large}
%\usepackage{imakeidx}

\usepackage[utf8]{inputenc}

\usepackage{blindtext}
\usepackage{tocloft}

\setlength{\cftbeforetoctitleskip}{0pt}
\setlength{\cftaftertoctitleskip}{0pt}
\renewcommand{\cfttoctitlefont}{\bfseries\Large} % Only large font
\setcounter{tocdepth}{3}
\begin{document}

\tableofcontents 

\section{Hello}
\blindtext[5]
\subsection{Hello 1.1}
\subsubsection{Hello1.1.1}
\blindtext[5]

\section{Road}
\blindtext[5]
\section{Road}
\blindtext[5]
\section{Road}
\blindtext[5]
\end{document}}

enter image description here

2
  • Thanks again Christian. Unfortunately now, I have to push up the word Content till the upper side of the frame. Moreover, I) would like that the main number 1,2--10 are in bold font.I have a problem for visualizing the bibliography. I wrote the bibliography in this way \begin{thebibliography}{99} and it is not reportet in the content.
    – chrisis
    May 26, 2016 at 12:36
  • @chrisis: You did not wrote that the main number should be bold, as well as there's no indication in your post that you want to have the bib section in the ToC. Of course, I did not address this
    – user31729
    May 26, 2016 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .