1

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?

6
  • Where does the \line command come from?
    – Bernard
    Commented Aug 31, 2017 at 19:34
  • @Bernard it's part of the latex format Commented Aug 31, 2017 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} Commented Aug 31, 2017 at 19:37
  • @DavidCarlisle What command should I be using instead of \line?
    – MHW
    Commented Aug 31, 2017 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
    Commented Aug 31, 2017 at 19:48

1 Answer 1

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .