4

This question already has an answer here:

Currently working on a document of type article. I'd like to add two horizontal lines above and below the title. I tried the following:

    \documentclass{article}
    \begin{document}

     \line(1,0){250}
     \title{A Title}
     \line(1,0){250}

     \author{FirstName LastName}
     \maketitle

    \clearpage
    \end{document} 

This does not give the desired effect, and splits the title page into multiple pages. Could you advise?

marked as duplicate by Johannes_B, CarLaTeX, Bobyandbob, Mensch, Stefan Pinnow Apr 2 '18 at 11:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @Johannes_B My question was posted in 2014, whereas the indicated question posted in 2016. I guess it makes sense to mark that question as duplicate??? – Melanie A Apr 2 '18 at 7:23
  • We often close older questions as duplicates of newer questions. – Johannes_B Apr 2 '18 at 7:24
  • @Johannes_B Why mark a question with a good answer as duplicate of a very generic one which does not show how to add lines? – user36296 Apr 2 '18 at 10:53
4

Try adding the line inside \titles argument:

\title{\line(1,0){250}\\A Title\\\line(1,0){250}}

Code:

\documentclass{article}
\begin{document}


 \title{\line(1,0){250}\\A Title\\\line(1,0){250}}

 \author{FirstName LastName}
 \maketitle

\clearpage
\end{document}

enter image description here

Same with titling package:

\documentclass{article}
\usepackage{titling}
\begin{document}
\pretitle{%
\begin{center}\LARGE
\rule{3in}{0.4pt}\par
}
\posttitle{\par\rule{3in}{0.4pt}\end{center}\vskip 0.5em}

 \title{A Title}

 \author{FirstName LastName}
 \maketitle

\clearpage
\end{document}
4

Well you can custom easily your title page with the titlepage environment. Belong your MWE we can get:

Titlepage environment result

Here is the code:

\documentclass{article}
\begin{document}

\begin{titlepage}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\vspace*{\stretch{1}}
\rule{\linewidth}{1pt}
\begin{flushright}
\Huge A Title \\[14pt]
First Name Last Name
\end{flushright}
\rule{\linewidth}{2pt}
\vspace*{\stretch{2}}
\end{titlepage}

\end{document}

Notice the way of build the lines and their thickness.

You don't need more. You can build manually a title page with this environment. If you do that will be useful to use commands such as \vspace, \vspace*, \vfill, between others.

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