0

I was trying to reduce the vertical line spacing in the title of a LaTeX article by using the titling package and the \vspace command. A MWE is shown below:

\documentclass[12pt, oneside, letterpaper]{article} 
\usepackage{geometry}
\usepackage{titling}

\geometry{tmargin=.75in, bmargin=.75in, lmargin=.75in, rmargin = .75in}  


% define custom styles for \maketitke
\setlength{\droptitle}{-3.5em}
\pretitle{\begin{center}\large\bf\rmfamily}
    \title{MWE Title}
    \posttitle{\par\end{center}}
\renewcommand\maketitlehookb{\vspace{-2em}}
\preauthor{\begin{center}\normalsize}
    \author{Author} 
    \postauthor{\par\end{center}}
\renewcommand\maketitlehookc{\vspace{-2em}}
\predate{\begin{center}\normalsize\scshape}
    \date{\today}
    \postdate{\par\end{center}}
\renewcommand\maketitlehookd{\vspace{-3.3em}}

\begin{document}

\maketitle

\par\noindent\rule{\textwidth}{0.4pt}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

enter image description here

However, when I add in \section{} near the end of the page, it seems that LaTeX is trying to cram things into one page so the section title would be at the top of the next page. In the process, it messes up the line spacing in my title:

\documentclass[12pt, oneside, letterpaper]{article} 
\usepackage{geometry}
\usepackage{titling}

\geometry{tmargin=.75in, bmargin=.75in, lmargin=.75in, rmargin = .75in}  

% define custom styles for \maketitke
\setlength{\droptitle}{-3.5em}
\pretitle{\begin{center}\large\bf\rmfamily}
    \title{MWE Title}
    \posttitle{\par\end{center}}
\renewcommand\maketitlehookb{\vspace{-2em}}
\preauthor{\begin{center}\normalsize}
    \author{Author} 
    \postauthor{\par\end{center}}
\renewcommand\maketitlehookc{\vspace{-2em}}
\predate{\begin{center}\normalsize\scshape}
    \date{\today}
    \postdate{\par\end{center}}
\renewcommand\maketitlehookd{\vspace{-3.3em}}

\begin{document}

\maketitle

\par\noindent\rule{\textwidth}{0.4pt}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 

\section{New Section}
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

enter image description here

Anyone know how I can fix the vertical line spacing within \maketitle? Thank you.

  • 1
    If you insert massive negative space like \vspace{-2em} into a document then surely over-printing is the expected outcome, what is the intention here? – David Carlisle Oct 29 '19 at 17:04
  • rather than add negative spaces you should not add so much space, for example use \centering not \begin{center} \end{center} – David Carlisle Oct 29 '19 at 17:05
  • Hi David, I am trying to reduce the vertical spacing between the title, author and date. Using \centering instead of a list environment like \begin{center} does help getting rid of the extra vertical spacing, thanks for pointing it out. As for reducing the line spacing after the date, which comes from the \begin{center} environment defined in article.cls, I used \vspace*{-0.5\baselineskip} and it works! My problem is solved. – Iustinius Oct 29 '19 at 19:18
  • the spacing around heading sis flexible so it can grow or shrink depending what else is on the page, if you put fixed negative spaces then you will always get over printing if the page fills and the stretch space shrinks to its smallest size, it is never the right fix. Better to set the lengths around the items to what you need rather than leaving default settings and inserting negative spaces. – David Carlisle Oct 29 '19 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.