Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with drawing a line across the page (from margin to margin). I had to change default margins for title page (only for this page) and to do that I used changepage package.

\thispagestyle{empty}
\begin{adjustwidth}{-1cm}{-1cm}
...
...
...
\end{adjustwidth}

Everything looks great however lines which I draw using

\rule{\textwidth}{.1pt}

aren't drawn from margin to margin. The line starts at goo point however line clearly ends before text. How can I fix that ?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Use \linewidth instead:

\rule{\linewidth}{.1pt}

To understand the difference, have a look at Difference between \textwidth, \linewidth and \hsize.

Example:

\documentclass{book}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{changepage}
\begin{document}
\thispagestyle{empty}
\begin{adjustwidth}{-1cm}{-1cm}
\blindtext[2]
\rule{\linewidth}{.1pt}
\end{adjustwidth}
\blindtext[2]
\rule{\linewidth}{.1pt}
\end{document}

output

share|improve this answer
    
You beat me by 44 seconds. ;-) –  lockstep Sep 2 '11 at 15:33
    
@lockstep: just luck :-) so added some information, since there's the nice Q&A about the difference of those widths. –  Stefan Kottwitz Sep 2 '11 at 15:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.