LaTeX tableofcontents not rendering a new page? - latex

So im making a presentation and for some reason, i can't create a new page for my tableofcontents.
The list of the tableofcontents is longer and i need to split it up to two pages to be able to display all informations, but it doesn't work (i tried \clearpage and \newpage without success)
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{biblatex}
\addbibresource{sample.bib}
%%%% graphics
\usepackage{graphicx}
%%%START THEME SETTINGS
\usetheme{Dresden}
\usecolortheme{beaver}
\title{stuff}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
\section{x}
\subsection{Introduction}
\subsection{Use Cases}
%------------------------------------------------
\section{xyz}
\subsection{Introduction}
\subsection{Use cases}
\subsection{Hyypervisors}
\subsection{Hypervisors Types}
\subsection{Memory Management}
\subsection{Memory Overcommitment}
\subsection{Memory Compression}
\subsection{Memory Transparent Page Sharing}
\newpage %<- this doesn't work!
%--------------------------------------------
\section{xy}
\subsection{Motivation}
\subsection{Virtualization}
\subsection{Emulation}
\section{xx}
\subsection{CPU}
\subsection{Registers}
\subsection{Memory}
any ideas why this doesn't work?
As mentioned above..

You can add the allowframebreaks option to your outline frame and beamer will automatically break the frame into multiple slides:
\documentclass{beamer}
%\usepackage[utf8]{inputenc}
\usepackage{biblatex}
\addbibresource{sample.bib}
%%%% graphics
%\usepackage{graphicx}
%%%START THEME SETTINGS
\usetheme{Dresden}
\usecolortheme{beaver}
\title{stuff}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}[allowframebreaks]{Outline}
\tableofcontents
\end{frame}
\section{x}\begin{frame}\end{frame}
\subsection{Introduction}\begin{frame}\end{frame}
\subsection{Use Cases}\begin{frame}\end{frame}
%------------------------------------------------
\section{xyz}\begin{frame}\end{frame}
\subsection{Introduction}\begin{frame}\end{frame}
\subsection{Use cases}\begin{frame}\end{frame}
\subsection{Hyypervisors}\begin{frame}\end{frame}
\subsection{Hypervisors Types}\begin{frame}\end{frame}
\subsection{Memory Management}\begin{frame}\end{frame}
\subsection{Memory Overcommitment}\begin{frame}\end{frame}
\subsection{Memory Compression}\begin{frame}\end{frame}
\subsection{Memory Transparent Page Sharing}\begin{frame}\end{frame}
%\newpage %<- this doesn't work!
%--------------------------------------------
\section{xy}\begin{frame}\end{frame}
\subsection{Motivation}\begin{frame}\end{frame}
\subsection{Virtualization}\begin{frame}\end{frame}
\subsection{Emulation}\begin{frame}\end{frame}
\section{xx}\begin{frame}\end{frame}
\subsection{CPU}\begin{frame}\end{frame}
\subsection{Registers}\begin{frame}\end{frame}
\subsection{Memory}\begin{frame}\end{frame}
\end{document}
Or you can manually split your table of contents to get more fine control of the break point:
\documentclass{beamer}
%\usepackage[utf8]{inputenc}
\usepackage{biblatex}
\addbibresource{sample.bib}
%%%% graphics
%\usepackage{graphicx}
%%%START THEME SETTINGS
\usetheme{Dresden}
\usecolortheme{beaver}
\title{stuff}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}{Outline}
\only<1>{\tableofcontents[sections={1-2}]}
\only<2>{\tableofcontents[sections={3-4}]}
\end{frame}
\section{x}\begin{frame}\end{frame}
\subsection{Introduction}\begin{frame}\end{frame}
\subsection{Use Cases}\begin{frame}\end{frame}
%------------------------------------------------
\section{xyz}\begin{frame}\end{frame}
\subsection{Introduction}\begin{frame}\end{frame}
\subsection{Use cases}\begin{frame}\end{frame}
\subsection{Hyypervisors}\begin{frame}\end{frame}
\subsection{Hypervisors Types}\begin{frame}\end{frame}
\subsection{Memory Management}\begin{frame}\end{frame}
\subsection{Memory Overcommitment}\begin{frame}\end{frame}
\subsection{Memory Compression}\begin{frame}\end{frame}
\subsection{Memory Transparent Page Sharing}\begin{frame}\end{frame}
%\newpage %<- this doesn't work!
%--------------------------------------------
\section{xy}\begin{frame}\end{frame}
\subsection{Motivation}\begin{frame}\end{frame}
\subsection{Virtualization}\begin{frame}\end{frame}
\subsection{Emulation}\begin{frame}\end{frame}
\section{xx}\begin{frame}\end{frame}
\subsection{CPU}\begin{frame}\end{frame}
\subsection{Registers}\begin{frame}\end{frame}
\subsection{Memory}\begin{frame}\end{frame}
\end{document}

Related

"landscape" leads to page shrinking in Latex?

If you run this, you can see that all pages after \begin{landscape} are too small."Page 4" at the bottom for example should be 90% into the page, but it's more like 70%. How do I fix this?
\documentclass{exam}
\usepackage{pdflscape}
\usepackage{pdfpages}
\usepackage{lipsum}
\printanswers
\begin{document}
Page1
\newpage
Page2
\begin{landscape}
\begin{solution}
\includegraphics{example-image-a}
\end{solution}
\end{landscape}
\lipsum
\end{document}

How can I make the document title bold and larger in size?

I have this LaTeX code and I was wondering how can I make the document title bold and larger in size than the default size.
\documentclass{article}
\title{Document Title}
\begin{document}
\maketitle
The content of the document goes here.
\end{document}
I've noticed that \maketitle renders the content that is specified above in the preamble.
You could redefine \#maketitle:
\documentclass{article}
\title{Document Title}
\makeatletter
\def\#maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\Huge\bfseries\#title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\#author
\end{tabular}\par}%
\vskip 1em%
{\large \#date}%
\end{center}%
\par
\vskip 1.5em}
\makeatother
\begin{document}
\maketitle
The content of the document goes here.
\end{document}

Add some space befor TOC title in latex

I trying add some space before TOC , I used \vspace but it doesn't work
\documentclass[12pt, french,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
%...
\vspace*{.3\paperheight} %doesn't work
\tableofcontents
%...
\chapter{chapitre}
\section{section}
\subsection{subsection}
\newpage
\chapter{chapitre}
\section{section}
\subsection{subsection}
\end{document}
somebody have solution ?
The toc will automatically start a new chapter on a new page. If you use \vspace before it, this will still be on the previous page and not have any effect on your toc. However, you can change the definition of the toc and add some space there:
\documentclass[12pt, french,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\makeatletter
\renewcommand\tableofcontents{%
\if#twocolumn
\#restonecoltrue\onecolumn
\else
\#restonecolfalse
\fi
\chapter*{\vspace{5cm}\contentsname
\#mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\#starttoc{toc}%
\if#restonecol\twocolumn\fi
}
\makeatother
\begin{document}
%...
\tableofcontents
%...
\chapter{chapitre}
\section{section}
\subsection{subsection}
\newpage
\chapter{chapitre}
\section{section}
\subsection{subsection}
\end{document}

latex blank table of contents

why the contents table is blank
i am using texmaker , as a result i get contents title and the rest of the page is blank what did i do wrong
...
\documentclass[12pt , a4paper]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\newcommand{\HRule}{\rule{\linewidth}{1.5 mm}}
\pagenumbering{gobble}
\tableofcontents
\renewcommand{\arraystretch}{1.5}
\pagestyle{empty}
\newpage
~
\pagenumbering{arabic}
\chapter{introduction}
\end{document}
...

Vertically centering a title page

I'm trying to vertically center a title on a custom-sized page with latex. I've written the following code, but for some reason it doesn't center. Could someone please point me to what's wrong with it?
Thanks!
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\title{[[title]]}
\date{[[date]]}
\author{[[author]]}
\begin{document}
\vspace{\fill}
\maketitle
\vspace{\fill}
\newpage
[[text]]
\end{document}
There are two small bugs in your code.
First, if you want the \vspace to work at the beginning or end of a page, you should use the starred version (\vspace*).
This would work, but \maketitle is a pretty complicated macro, and if used like in your example, it just puts the title at the second page. You can use the titlepage environment, which gives you much more command over how the title page looks like -- including the spacing. For example, you could use the following code:
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\begin{document}
\begin{titlepage}
\vspace*{\fill}
\begin{center}
{Huge [[title]]}\\[0.5cm]
{Large [[author}\\[0.4cm]
[[date]]
\end{center}
\vspace*{\fill}
\end{titlepage}
[[text]]
\end{document}
\null % Empty line
\nointerlineskip % No skip for prev line
\vfill
\let\snewpage \newpage
\let\newpage \relax
\maketitle
\let \newpage \snewpage
\vfill
\break % page break
If you want to make everything work even with \maketitle put your \vspace*{\fill} inside the first and the last attribute, exp:
\title{**\vspace*{\fill}**[[title]]}
\date{[[date]]}
\author{[[author]]**\vspace*{\fill}**[[}
\begin{document}
\maketitle
\newpage
[[text]]
\end{document}
As in the answer by finrod, \maketitle is a pretty complicated macro, this is why I didn't feel like overwriting it myself (\renewcommand\maketitle{...). Nevertheless, copying, pasting and editing lines 170-201 of article.cls documentclass, I could add a new one to customize (\newcommand\mymaketitle{...) as follows:
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\title{Title}
\date{Date}
\author{Author}
\makeatletter
\newcommand\mymaketitle{%
\begin{titlepage}
\null\vfil\vskip 40\p#
\begin{center}
{\LARGE \#title \par}
\vskip 2.5em
{\large \lineskip .75em \#author \par}
\vskip 1.5em
{\large \#date \par}
\end{center}\par
\#thanks
\vfil\null
\end{titlepage}
}
\makeatother
\begin{document}
\mymaketitle
Text
\end{document}
The output:

Resources