6

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?

3
  • @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??? Commented Apr 2, 2018 at 7:23
  • We often close older questions as duplicates of newer questions. Commented Apr 2, 2018 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? Commented Apr 2, 2018 at 10:53

2 Answers 2

6

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} 
5

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.