LaTeX forum ⇒ 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

Postby Seanshine » Sat Jul 07, 2018 12:54 am

Hi Johannes, thanks for coming back to me!

This is my entire main.tex:

  1. \documentclass[
  2. 11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside,
  3. chapterinoneline, reqno, a4paper
  4. %consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
  5. ]{MastersDoctoralThesis}
  6.  
  7. \usepackage[utf8]{inputenc}
  8. \usepackage[T1]{fontenc}
  9. \usepackage{amsthm, amsmath, amssymb, amsfonts, exscale, latexsym, float, eucal, mathtools}
  10. \usepackage{booktabs, floatrow, threeparttable, adjustbox, textcomp, mathpazo, lipsum}
  11. \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}
  12. \usepackage[autostyle=true]{csquotes}
  13. \usepackage{apacite}
  14. \bibliographystyle{apacite}
  15. \addbibresource{References.bib}
  16.  
  17.  
  18. %----------------------------------------------------------------------------------------
  19. % ADDITIONAL THESIS FORMATTING
  20. %----------------------------------------------------------------------------------------
  21. \AtBeginDocument{
  22. \hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
  23. \hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
  24. \hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
  25. }
  26.  
  27. \renewcommand{\chapterbelowskip}{\vspace{20pt}} % spacing after chapter title
  28. \renewcommand*\chaptermarkformat{\chapapp \thechapter\enskip}
  29. \renewcommand{\chapterfont}{\LARGE\bfseries}
  30. \newcommand{\E}{\mathrm{E}}
  31. \newcommand{\Var}{\mathrm{Var}}
  32. \renewcommand{\baselinestretch}{1.2} % in-text line spacing
  33.  
  34. \makeatletter % align list of figures and tables
  35. \renewcommand*\l@figure{\@dottedtocline{2}{0em}{3.2em}}
  36. \renewcommand*\l@table{\@dottedtocline{2}{0em}{3.2em}}
  37. \makeatother
  38.  
  39. %----------------------------------------------------------------------------------------
  40. % MARGIN SETTINGS
  41. %----------------------------------------------------------------------------------------
  42. % \voffset = -2.54cm
  43. % \hoffset = -2.54cm
  44. % \textheight 23cm
  45. % \textwidth 16 cm
  46. % \topmargin 2.5cm
  47. % \oddsidemargin 2.50cm \evensidemargin 2.5cm \unitlength 1cm
  48.  
  49. \geometry{
  50. paper=a4paper, % Change to letterpaper for US letter
  51. inner=1.5cm, % Inner margin
  52. outer=2.5cm, % Outer margin
  53. bindingoffset=0.5cm, % Binding offset
  54. top=0.5cm, % Top margin
  55. bottom=1.0cm, % Bottom margin
  56. %showframe, % Uncomment to show how the type block is set on the page
  57. }
  58.  
  59. \begin{document}
  60. \frontmatter
  61. \pagestyle{plain}
  62.  
  63. %----------------------------------------------------------------------------------------
  64. % THESIS INFORMATION
  65. %----------------------------------------------------------------------------------------
  66. \thesistitle{Measuring the Natural rate of Interest \\ with an emphasis on the Euro Area} % Print it elsewhere with \ttitle
  67. \supervisor{prof. Dr. J. \textsc{Schaumburg}} % Print it elsewhere with \supname
  68. \examiner{} % Print it elsewhere with \examname
  69. \degree{Master of Science in Econometrics} % Print it elsewhere with \degreename
  70. \author{Sean R.E.A. \textsc{Bagcik}} % Print it elsewhere with \authorname
  71.  
  72. \subject{} % Print it elsewhere with \subjectname
  73. \keywords{} % Print it elsewhere with \keywordnames
  74. \university{\href{https://www.vu.nl}{Vrije Universiteit Amsterdam}} % Print it elsewhere with \univname
  75. \department{\href{}{Department of Econometrics and Operations Research}} % Print it elsewhere with \deptname
  76. \faculty{\href{https://sbe.vu.nl}{School of Business and Economics}} % Print it elsewhere with \facname
  77.  
  78. %----------------------------------------------------------------------------------------
  79. % TITLE PAGE
  80. %----------------------------------------------------------------------------------------
  81. \begin{titlepage}
  82. %----------------------------------------------------------------------------------------
  83. % HEADING SECTIONS
  84. %----------------------------------------------------------------------------------------
  85.  
  86. {\centering \includegraphics[width=80mm,scale=0.8]{Figures/VU_logo.png}\\
  87.  
  88. \Small School of Business and Economics\\
  89. \Small Master of Science in Econometrics\\[1.0cm]
  90.  
  91. %----------------------------------------------------------------------------------------
  92. % TITLE SECTION
  93. %----------------------------------------------------------------------------------------
  94.  
  95. {\huge Measuring the Natural Rate of Interest\\ \LARGE with an emphasis on the Euro Area}\\[1.0cm]
  96.  
  97. %----------------------------------------------------------------------------------------
  98. % AUTHOR SECTION
  99. %----------------------------------------------------------------------------------------
  100.  
  101. by\\[0.1cm]
  102. \large \authorname\\[0.5cm]
  103.  
  104. %----------------------------------------------------------------------------------------
  105. % COMMITTEE SECTION
  106. %----------------------------------------------------------------------------------------
  107. \begin{minipage}[t]{0.4\textwidth}
  108. \begin{flushleft}
  109. Supervisor: \\
  110. prof. dr. J. \textsc{Schaumburg}
  111. \end{flushleft}
  112. \end{minipage}
  113. ~
  114. \begin{minipage}[t]{0.4\textwidth}
  115. \begin{flushright}
  116. Second assessor: \\
  117. prof. dr. \textsc{X}\\
  118. \end{flushright}
  119. \end{minipage}\\[1.0cm]
  120.  
  121. {\large \today}\\[1.0cm]
  122.  
  123. \vspace{1cm}\textbf{\textsc{Abstract}}\par}
  124. \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
  125. \lipsum[2] \par
  126. \noindent\raisebox{.5ex}{\rule{\linewidth}{.4pt}}\par
  127. \noindent Keywords: Kalman filter, potential output, monetary policy
  128.  
  129. \end{titlepage}
  130.  
  131. %----------------------------------------------------------------------------------------
  132. % ACKNOWLEDGEMENTS
  133. %----------------------------------------------------------------------------------------
  134.  
  135. %\begin{acknowledgements}
  136. %\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents
  137. %\end{acknowledgements}
  138.  
  139. %----------------------------------------------------------------------------------------
  140. % LIST OF CONTENTS/FIGURES/TABLES PAGES
  141. %----------------------------------------------------------------------------------------
  142. \tableofcontents % Prints the main table of contents
  143. \newpage
  144. \listoffigures % Prints the list of figures
  145. \listoftables % Prints the list of tables
  146.  
  147. %----------------------------------------------------------------------------------------
  148. % THESIS CONTENT - CHAPTERS
  149. %----------------------------------------------------------------------------------------
  150.  
  151. \mainmatter
  152.  
  153. \makeatletter
  154. \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
  155. \makeatother
  156.  
  157. \pagestyle{thesis}
  158.  
  159. \include{Chapters/Chapter1}
  160. \include{Chapters/Chapter2}
  161. \include{Chapters/Chapter3}
  162. \include{Chapters/Chapter4}
  163. \include{Chapters/Chapter5}
  164. \include{Chapters/Chapter6}
  165. \include{Chapters/Chapter7}
  166.  
  167.  
  168. %----------------------------------------------------------------------------------------
  169. % THESIS CONTENT - APPENDICES
  170. %----------------------------------------------------------------------------------------
  171.  
  172. \appendix
  173. \renewcommand{\thefigure}{A\arabic{figure}}
  174. \setcounter{figure}{0}
  175. \include{Appendices/Appendix}
  176.  
  177. %----------------------------------------------------------------------------------------
  178. % BIBLIOGRAPHY
  179. %----------------------------------------------------------------------------------------
  180.  
  181. \printbibliography[heading=bibintoc, title={References}]
  182.  
  183. %----------------------------------------------------------------------------------------
  184. \end{document}


Where do you suggest to add in those lines? Because it didn't have the desired effect, yet.
What does
  1. \makeatletter
  2. \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
  3. \makeatother

do?

Thanks again! Best, Sean

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jul 07, 2018 7:22 am

  1. \usepackage{apacite}
  2. \bibliographystyle{apacite}

You [i]have[i] 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
  1. \makeatletter
  2. \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
  3. \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

Postby Seanshine » Sat Jul 07, 2018 10:32 am

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: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jul 07, 2018 10:44 am

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

Postby Seanshine » Sat Jul 07, 2018 10:57 am

  1. \documentclass[
  2. 11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside,
  3. chapterinoneline, reqno, a4paper
  4. %consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
  5. ]{MastersDoctoralThesis}
  6.  
  7. \usepackage[utf8]{inputenc}
  8. \usepackage[T1]{fontenc}
  9. \usepackage{amsthm, amsmath, amssymb, amsfonts, exscale, latexsym, float, eucal, mathtools}
  10. \usepackage{booktabs, floatrow, threeparttable, adjustbox, textcomp, mathpazo, lipsum}
  11. \usepackage[backend=bibtex, style=apa, natbib=true]{biblatex}
  12. \DeclareLanguageMapping{american}{american-apa}
  13. \usepackage[autostyle=true]{csquotes}
  14. \addbibresource{References.bib}
  15.  
  16. %----------------------------------------------------------------------------------------
  17. % ADDITIONAL THESIS FORMATTING
  18. %----------------------------------------------------------------------------------------
  19. \AtBeginDocument{
  20. \hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
  21. \hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
  22. \hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
  23. }
  24.  
  25. \renewcommand{\chapterbelowskip}{\vspace{20pt}} % spacing after chapter title
  26. \renewcommand*\chaptermarkformat{\chapapp \thechapter\enskip}
  27. \renewcommand{\chapterfont}{\LARGE\bfseries}
  28. \newcommand{\E}{\mathrm{E}}
  29. \newcommand{\Var}{\mathrm{Var}}
  30. \renewcommand{\baselinestretch}{1.2} % in-text line spacing
  31.  
  32. \makeatletter % align list of figures and tables
  33. \renewcommand*\l@figure{\@dottedtocline{2}{0em}{3.2em}}
  34. \renewcommand*\l@table{\@dottedtocline{2}{0em}{3.2em}}
  35. \makeatother
  36.  
  37. \makeatletter
  38. \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
  39. \newcommand{\checktoopen}{%
  40. \ifdef{\phantomsection}{\phantomsection}{}%
  41. }
  42. \makeatletter
  43.  
  44. \geometry{
  45. paper=a4paper, % Change to letterpaper for US letter
  46. inner=1.5cm, % Inner margin
  47. outer=2.5cm, % Outer margin
  48. bindingoffset=0.5cm, % Binding offset
  49. top=0.5cm, % Top margin
  50. bottom=1.0cm, % Bottom margin
  51. %showframe, % Uncomment to show how the type block is set on the page
  52. }
  53.  
  54. \begin{document}
  55. \frontmatter
  56. \pagestyle{plain}
  57.  
  58. \tableofcontents
  59. \newpage
  60. \listoffigures
  61. \listoftables
  62.  
  63. \mainmatter
  64. \pagestyle{thesis}
  65.  
  66. \include{Chapters/Chapter1}
  67. \include{Chapters/Chapter2}
  68. \include{Chapters/Chapter3}
  69. \include{Chapters/Chapter4}
  70. \include{Chapters/Chapter5}
  71. \include{Chapters/Chapter6}
  72. \include{Chapters/Chapter7}
  73.  
  74. \appendix
  75. \renewcommand{\thefigure}{A\arabic{figure}}
  76. \setcounter{figure}{0}
  77. \include{Appendices/Appendix}
  78.  
  79. \printbibliography[heading=bibintoc, title={References}]
  80.  
  81. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jul 07, 2018 4:14 pm

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.

  1. \documentclass[
  2. 11pt,english, onehalfspacing, nolistspacing, liststotoc, headsepline,oneside,
  3. hapterinoneline, reqno, a4paper,
  4. nohyperref% For the MWE
  5. %consistentlayout, change the layout of the declaration, abstract and acknowledgements pages to match the default layout
  6. ]{MastersDoctoralThesis}
  7.  
  8. \makeatletter
  9. \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
  10. \renewcommand{\checktoopen}{%
  11. \ifdef{\phantomsection}{\phantomsection}{}%
  12. }
  13. \makeatletter
  14.  
  15. \begin{document}
  16. \frontmatter
  17. \pagestyle{plain}
  18.  
  19. \tableofcontents
  20. \clearpage%\newpage% Do not use \newpage if you don't understand it
  21. \listoffigures
  22. \listoftables
  23.  
  24. \mainmatter
  25. \pagestyle{thesis}
  26.  
  27. \chapter{Wombat}
  28. \chapter{Capybara}
  29. \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

Postby Seanshine » Sat Jul 07, 2018 11:52 pm

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: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jul 08, 2018 7:12 am

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

Postby Seanshine » Sun Jul 08, 2018 9:39 am

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: 3854
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jul 08, 2018 12:34 pm

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.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 7 guests