# \rule not aligned

The \rules not aligned. I want to be in parallel to be each other and start from the same position horizontally.

Here is the code:

\documentclass[12pt]{book}
\begin{document}
\begin{titlepage}
\rule{\linewidth}{4pt}
\rule{\linewidth}{4pt}
\end{titlepage}
\end{document}


-
You could use \parindent=0pt... – Malipivo May 12 '14 at 17:00
In addition to what others have said, your two rules are on the same line separated by a word space. They only come one below the other as they are longer than half the line width, ans so Tex has broken the paragraph into two lines. so it's probably more natural to put a blank line between them then they would have both been indented (or not) by the same amount. – David Carlisle May 12 '14 at 17:22

You need to add a \noindent:

## Code:

\documentclass[12pt]{book}
\begin{document}
\begin{titlepage}
\noindent
\rule{\linewidth}{4pt}
\rule{\linewidth}{4pt}
\end{titlepage}
\end{document}

-

You're setting two blocks (\rules in this case) that form part of a single paragraph where the first line of a paragraph typically has an indentation (of length \parindent). You'll see exactly the same if you set a regular paragraph below the \rules.

\documentclass{book}
\begin{document}

\rule{\linewidth}{4pt}
\rule{\linewidth}{4pt}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent vel eleifend eros, congue egestas nibh. Donec quis
vulputate felis, id aliquet dolor. Praesent posuere pretium massa et scelerisque.

\noindent\rule{\linewidth}{4pt}
\rule{\linewidth}{4pt}

\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent vel eleifend eros, congue egestas nibh. Donec quis
vulputate felis, id aliquet dolor. Praesent posuere pretium massa et scelerisque.

\end{document}


\noindent removes the indentation of the paragraph causing them to be set flush with the left margin.

A global change can be initiated using \setlength{\parindent}{0pt}, or as in your titlepage case, the scope can be limited to

\begin{titlepage}
\setlength{\parindent}{0pt}%
...
\end{titlepage}

-

With the etoolbox package, you don't even have to think of adding whatever:

\documentclass{book}

\usepackage{etoolbox}
\pretocmd\rule{\noindent}{}{}

\begin{document}

\rule{\linewidth}{2pt}
\rule{\linewidth}{2pt}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent vel eleifend eros, congue egestas nibh. Donec quis
vulputate felis, id aliquet dolor. Praesent posuere pretium massa et scelerisque.

\end{document}


-