4

I have a simple problem but I didn't manage to find any answer for it. In my title page, I just used

\title{Name of the title}

then

\hrule height 0,1cm \leavevmode \\[0,5cm] 
   {\Huge{\textbf{\@title}}}\\[0,5cm]
\hrule height 0,1cm \leavevmode \\[0,5cm]

to print the title of my document. But it takes more than 3 lines on the PDF file, and I have a different spacing between the 1st and 2nd line compared to the 2nd and 3rd, which is a bit frustrating.

Anyone got an idea of why ?

4
  • 3
    Welcome to TeX SX! Could you post a minimal (and compilable) working example?
    – Bernard
    May 16, 2016 at 13:08
  • Word of advice, don't even use those line. Your title is enough to get attention, it won't need those line to further attract possible readers.
    – Johannes_B
    May 16, 2016 at 13:12
  • Please post your MWE meta.tex.stackexchange.com/q/3343/90087
    – A Feldman
    May 16, 2016 at 13:16
  • May i ask where the original snippet is coming from? Maybe they want to improve their stuff.
    – Johannes_B
    May 16, 2016 at 14:04

2 Answers 2

4

You gotta use paragraphs, not line breaks.

They guy who invented that dreadful rule business put that on wikibooks and it lives on. Better use no lines at all.

\documentclass{article}
\usepackage{showframe}
\begin{document}
\hrule height 0,1cm \leavevmode \\[0,5cm] 
{\Huge\textbf{ The incredible journey of Walter~Wombat }}\\[0,5cm]
\hrule height 0,1cm \leavevmode \\[0,5cm]

%Output of the screenshot
\begin{center}
\rule{\textwidth}{.4pt}\par
{\huge\bfseries The incredible journey of Walter~Wombat \par}
\rule{\textwidth}{.4pt}\par
\bigbreak
{\Large Carl Capybara\par}
\end{center}
\end{document}

quentinTitle

10
  • That is what I was looking for. For what is the showframe package, though ?
    – Quentin
    May 16, 2016 at 13:35
  • @Quentin Showing the frame of the text block. My title with your method is faulty and sticks into the margin. When stuff like that happens, something's dodgy.
    – Johannes_B
    May 16, 2016 at 13:37
  • i'd be inclined to "tie" Walter~Wombat to avoid the ungraceful splitting of a proper name. Aug 7, 2016 at 16:54
  • @barbarabeeton Very good point, edited.
    – Johannes_B
    Aug 7, 2016 at 17:01
  • uh, please take a look at what you've got there -- two code instances of the title, but the title only appears once. i'm confused. Aug 7, 2016 at 19:14
1

I find a 1mm thick rule is too heavy. Anyhow, you can use \hrule so the spacing is better controlled. The trick is that TeX doesn't insert interline glue around \hrule

Add \vspace*{-\topskip} if you want the top rule to start from at the very beginning of the type block.

\documentclass{article}
\usepackage{showframe}
\begin{document}

\begin{center}
\vspace*{-\topskip}
\Huge\bfseries
\hrule height 1mm

\vspace{1ex}

The incredible journey of Walter Wombat

\vspace{1ex}

\hrule height 1mm
\end{center}
\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 .