Page LayoutAvoid blank space after chapters

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Avoid blank space after chapters

Post by Seanshine »

Hi Johannes, thanks for coming back to me!

This is my entire main.tex:

Code: Select all

\documentclass[
11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside, 
chapterinoneline, reqno, a4paper
%consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsthm, amsmath, amssymb, amsfonts, exscale, latexsym, float, eucal, mathtools}
\usepackage{booktabs, floatrow, threeparttable, adjustbox, textcomp, mathpazo, lipsum}
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}
\usepackage[autostyle=true]{csquotes}
\usepackage{apacite}
\bibliographystyle{apacite}
\addbibresource{References.bib}


%----------------------------------------------------------------------------------------
%	ADDITIONAL THESIS FORMATTING
%----------------------------------------------------------------------------------------
\AtBeginDocument{
\hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
\hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
\hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
}

\renewcommand{\chapterbelowskip}{\vspace{20pt}} % spacing after chapter title
\renewcommand*\chaptermarkformat{\chapapp \thechapter\enskip}
\renewcommand{\chapterfont}{\LARGE\bfseries}
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\renewcommand{\baselinestretch}{1.2} % in-text line spacing

\makeatletter % align list of figures and tables
 \renewcommand*\l@figure{\@dottedtocline{2}{0em}{3.2em}}
 \renewcommand*\l@table{\@dottedtocline{2}{0em}{3.2em}}
\makeatother

%----------------------------------------------------------------------------------------
%	MARGIN SETTINGS
%----------------------------------------------------------------------------------------
% \voffset = -2.54cm
% \hoffset = -2.54cm
% \textheight 23cm
% \textwidth 16 cm
% \topmargin 2.5cm
% \oddsidemargin 2.50cm \evensidemargin 2.5cm \unitlength 1cm

\geometry{
	paper=a4paper, % Change to letterpaper for US letter
	inner=1.5cm, % Inner margin
	outer=2.5cm, % Outer margin
	bindingoffset=0.5cm, % Binding offset
	top=0.5cm, % Top margin
	bottom=1.0cm, % Bottom margin
	%showframe, % Uncomment to show how the type block is set on the page
}

\begin{document}
\frontmatter
\pagestyle{plain}

%----------------------------------------------------------------------------------------
%	THESIS INFORMATION
%----------------------------------------------------------------------------------------
\thesistitle{Measuring the Natural rate of Interest \\ with an emphasis on the Euro Area} % Print it elsewhere with \ttitle
\supervisor{prof. Dr. J. \textsc{Schaumburg}} % Print it elsewhere with \supname
\examiner{} % Print it elsewhere with \examname
\degree{Master of Science in Econometrics} % Print it elsewhere with \degreename
\author{Sean R.E.A. \textsc{Bagcik}} % Print it elsewhere with \authorname

\subject{} % Print it elsewhere with \subjectname
\keywords{} % Print it elsewhere with \keywordnames
\university{\href{https://www.vu.nl}{Vrije Universiteit Amsterdam}} % Print it elsewhere with \univname
\department{\href{}{Department of Econometrics and Operations Research}} % Print it elsewhere with \deptname
\faculty{\href{https://sbe.vu.nl}{School of Business and Economics}} % Print it elsewhere with \facname

%----------------------------------------------------------------------------------------
%	TITLE PAGE
%----------------------------------------------------------------------------------------
\begin{titlepage}
%----------------------------------------------------------------------------------------
%	HEADING SECTIONS
%----------------------------------------------------------------------------------------

{\centering \includegraphics[width=80mm,scale=0.8]{Figures/VU_logo.png}\\

\Small School of Business and Economics\\
\Small Master of Science in Econometrics\\[1.0cm]

%----------------------------------------------------------------------------------------
%	TITLE SECTION
%----------------------------------------------------------------------------------------

{\huge  Measuring the Natural Rate of Interest\\ \LARGE with an emphasis on the Euro Area}\\[1.0cm]

%----------------------------------------------------------------------------------------
%	AUTHOR SECTION
%----------------------------------------------------------------------------------------

by\\[0.1cm]
\large \authorname\\[0.5cm]

%----------------------------------------------------------------------------------------
%	COMMITTEE SECTION
%----------------------------------------------------------------------------------------
\begin{minipage}[t]{0.4\textwidth}
\begin{flushleft} 
    Supervisor: \\
prof. dr. J. \textsc{Schaumburg}
\end{flushleft}
\end{minipage}
~
\begin{minipage}[t]{0.4\textwidth}
\begin{flushright}
Second assessor: \\
prof. dr. \textsc{X}\\
\end{flushright}
\end{minipage}\\[1.0cm]

{\large \today}\\[1.0cm]

\vspace{1cm}\textbf{\textsc{Abstract}}\par}
    \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
    \lipsum[2] \par
    \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
    \noindent Keywords: Kalman filter, potential output, monetary policy 

\end{titlepage}

%----------------------------------------------------------------------------------------
%	ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------

%\begin{acknowledgements}
%\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents
%\end{acknowledgements}

%----------------------------------------------------------------------------------------
%	LIST OF CONTENTS/FIGURES/TABLES PAGES
%----------------------------------------------------------------------------------------
\tableofcontents % Prints the main table of contents
\newpage
\listoffigures % Prints the list of figures
\listoftables % Prints the list of tables

%----------------------------------------------------------------------------------------
%	THESIS CONTENT - CHAPTERS
%----------------------------------------------------------------------------------------

\mainmatter

\makeatletter
\patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

\pagestyle{thesis}

\include{Chapters/Chapter1}
\include{Chapters/Chapter2}
\include{Chapters/Chapter3}
\include{Chapters/Chapter4}
\include{Chapters/Chapter5}
\include{Chapters/Chapter6}
\include{Chapters/Chapter7}


%----------------------------------------------------------------------------------------
%	THESIS CONTENT - APPENDICES
%----------------------------------------------------------------------------------------

\appendix
\renewcommand{\thefigure}{A\arabic{figure}}
\setcounter{figure}{0}
\include{Appendices/Appendix}

%----------------------------------------------------------------------------------------
%	BIBLIOGRAPHY
%----------------------------------------------------------------------------------------

\printbibliography[heading=bibintoc, title={References}]

%----------------------------------------------------------------------------------------
\end{document}
Where do you suggest to add in those lines? Because it didn't have the desired effect, yet.
What does

Code: Select all

\makeatletter
\patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother
do?

Thanks again! Best, Sean

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Avoid blank space after chapters

Post by Johannes_B »

Code: Select all

\usepackage{apacite}
\bibliographystyle{apacite}
You have to get errors with that. Those packages are incompatible with biblatex, which you are using a few lines earlier.

When did i tell you to use

Code: Select all

\makeatletter
    \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
    \makeatother
? Never.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Avoid blank space after chapters

Post by Seanshine »

I'll remove those few lines, not sure why I added them.

I've tried your suggestion in the preamble, but unfortunately it did not remove the blank spaces.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Avoid blank space after chapters

Post by Johannes_B »

I tested it, it does work.
Please show us a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Avoid blank space after chapters

Post by Seanshine »

Code: Select all

\documentclass[
11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside, 
chapterinoneline, reqno, a4paper
%consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsthm, amsmath, amssymb, amsfonts, exscale, latexsym, float, eucal, mathtools}
\usepackage{booktabs, floatrow, threeparttable, adjustbox, textcomp, mathpazo, lipsum}
\usepackage[backend=bibtex, style=apa, natbib=true]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage[autostyle=true]{csquotes}
\addbibresource{References.bib}

%----------------------------------------------------------------------------------------
%	ADDITIONAL THESIS FORMATTING
%----------------------------------------------------------------------------------------
\AtBeginDocument{
\hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
\hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
\hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
}

\renewcommand{\chapterbelowskip}{\vspace{20pt}} % spacing after chapter title
\renewcommand*\chaptermarkformat{\chapapp \thechapter\enskip}
\renewcommand{\chapterfont}{\LARGE\bfseries}
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\renewcommand{\baselinestretch}{1.2} % in-text line spacing

\makeatletter % align list of figures and tables
 \renewcommand*\l@figure{\@dottedtocline{2}{0em}{3.2em}}
 \renewcommand*\l@table{\@dottedtocline{2}{0em}{3.2em}}
\makeatother

\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\newcommand{\checktoopen}{%
	\ifdef{\phantomsection}{\phantomsection}{}%
}
\makeatletter

\geometry{
	paper=a4paper, % Change to letterpaper for US letter
	inner=1.5cm, % Inner margin
	outer=2.5cm, % Outer margin
	bindingoffset=0.5cm, % Binding offset
	top=0.5cm, % Top margin
	bottom=1.0cm, % Bottom margin
	%showframe, % Uncomment to show how the type block is set on the page
}

\begin{document}
\frontmatter
\pagestyle{plain}

\tableofcontents 
\newpage
\listoffigures 
\listoftables 

\mainmatter
\pagestyle{thesis}

\include{Chapters/Chapter1}
\include{Chapters/Chapter2}
\include{Chapters/Chapter3}
\include{Chapters/Chapter4}
\include{Chapters/Chapter5}
\include{Chapters/Chapter6}
\include{Chapters/Chapter7}

\appendix
\renewcommand{\thefigure}{A\arabic{figure}}
\setcounter{figure}{0}
\include{Appendices/Appendix}

\printbibliography[heading=bibintoc, title={References}]

\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Avoid blank space after chapters

Post by Johannes_B »

The error messages never bothered you? Never mentioned them?
I made a copy mistake, it needs to be \renewcommand{\checktoopen}

Nevertheless, the fix works for your example, if i just ignore all error messages. Like using float and floatrow together. Or the fact that `\chapapp` is undefined.

Code: Select all

\documentclass[
11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside, 
hapterinoneline, reqno, a4paper,
nohyperref% For the MWE
%consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis}

\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\renewcommand{\checktoopen}{%
        \ifdef{\phantomsection}{\phantomsection}{}%
}
\makeatletter

\begin{document}
\frontmatter
\pagestyle{plain}

\tableofcontents 
\clearpage%\newpage% Do not use \newpage if you don't understand it
\listoffigures 
\listoftables 

\mainmatter
\pagestyle{thesis}

 \chapter{Wombat}
 \chapter{Capybara}
\end{document}
What you see above is a minimal working example. What happens if you run exactly that code? Please show the log file as well (as attachment).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Avoid blank space after chapters

Post by Seanshine »

Errors:

1. Package floatrow Error: Do not use float package with floatrow.
2. Package biblatex Error: Biber backend is required by style.
3. Package biblatex Error: Option 'sorting=apa' invalid.

Is that what you need?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Avoid blank space after chapters

Post by Johannes_B »

Seanshine wrote:Errors:

1. Package floatrow Error: Do not use float package with floatrow.
2. Package biblatex Error: Biber backend is required by style.
3. Package biblatex Error: Option 'sorting=apa' invalid.

Is that what you need?
No, this is what you need to fix.
What happens if you run exactly that code? Please show the log file as well (as attachment).
You did not answer my question.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Avoid blank space after chapters

Post by Seanshine »

I am working in ShareLatex, I clicked ''logs and output files''.

With running 'exactly that code' you mean open a 'blank' MastersDoctoralClass.cls and post in your code in the main?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Avoid blank space after chapters

Post by Johannes_B »

Yes, use a fresh copy of the template and use the code i posted as main.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply