1

I'm trying to draw horizontal lines above and below the title and adding some extra space between them and the text. I've being trying this code:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}

\title{
\rule{\textwidth}{2pt}
\vspace{1cm}
\textbf{Notas en Computación Cuántica}
\vspace{1cm}
\rule{\textwidth}{2pt}
}
\author{John Doe}
\date{April 2019}

\begin{document}

\maketitle

\section{Introduction}

\end{document}

However, the resulting document looks like both \vspace commands are adding the space only below the title, even the one that is placed right above. Can anyone help me?

enter image description here

1

It's simpler to do it with the tools of the titling package:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}

\usepackage{titling}
\pretitle{\noindent\rule{\textwidth}{2pt}\bigskip\begin{center}\LARGE\bfseries}
\posttitle{\end{center}\bigskip\noindent\rule{\textwidth}{2pt}}
\preauthor{\vspace*{10ex}\begin{center}\Large}
\postauthor{\end{center}}

\title{Notas en Computación Cuántica}
\author{John Doe}
\date{April 2019}

\begin{document}

\maketitle

\section{Introduction}

\end{document} 

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.