0

I'm trying to ensure that the text between the two horizontal lines is of equal distance from each one. To try and achieve this I've tried the following:

\documentclass[11pt]{article}
 \begin{document}
    \begin{titlepage}
        \begin{center}
        \line(1,0){400}\\[1mm]
        \Huge{Title}\\[1mm]
        \line(1,0){400}
        \end{center}
    \end{titlepage}
\end{document}

But this certainly isn't giving me the result I want. How can I fix this?

  • Where does the \line command come from? – Bernard Aug 31 '17 at 19:34
  • @Bernard it's part of the latex format – David Carlisle Aug 31 '17 at 19:35
  • note \line is really only intended for the picture environment, ahd size commands such as \Huge do not take an argument so it should be \Huge Title not \Huge{Title} – David Carlisle Aug 31 '17 at 19:37
  • @DavidCarlisle What command should I be using instead of \line? – Si.0788 Aug 31 '17 at 19:42
  • @David Carlisle: Oh! yes, of course. I must say I haven't used the picture environment for more than 20 years, so I've completely forgotten. I fear Alzheimer's lurking around… – Bernard Aug 31 '17 at 19:48
1

You can do that with a tabularx, the rules from booktabs and ensure vertical centring between the rules with the cellspace package, which lets you define a minimal vertical spacing at the top and bottom of a cell in a table:

\documentclass[11pt]{article}
\usepackage{cellspace, tabularx, booktabs}
\usepackage[x11names]{xcolor}
\usepackage{garamondx}
\addparagraphcolumntypes{X}

\begin{document}

\begin{titlepage}
  \setlength{\cellspacetoplimit}{11pt}
  \setlength{\cellspacebottomlimit}{12pt}
  \begin{center}
    \huge \textit{Edward Lear}\vspace{10ex}
    \Huge\bfseries
    \begin{tabularx}{\linewidth}{S{>{\centering\arraybackslash}X}}
      \toprule
      \color{IndianRed3} The Pobble Who Has No Toes \\
      \bottomrule
    \end{tabularx}
  \end{center}
\end{titlepage}

\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.