[Tex/LaTex] How to skip the complete left-hand margin

indentationmargins

How LaTeX calculates margins has already seemed somewhat complicated to me. In my attempt to improve my answer to this question about how to have a graphics span the complete paper with I tried again to understand it – and after reading the answer of TH to this question I thought I got it how the left margin is calculated:

\hoffset + 1in + \oddsidemargin + \leftskip

My expectation was that if I skip the given amount to the left, I will end up at the real paper margin. However, apparently that does not work:

\documentclass{article}
\usepackage{lipsum}
\begin{document}
  \lipsum[3]
  \hskip\dimexpr -\hoffset-1in-\oddsidemargin-\leftskip\relax\rule{\paperwidth}{4pt}
  \lipsum[3]
\end{document}

This gives the following result:

enter image description here

So there is still some space between the left-hand paper margin and the output of the \rule command. So which length is still missing?

Best Answer

After a paragraph break, LaTeX inserts a \parindent at the start of the next paragraph. To suppress this \parindent, you should insert a \noindent at the start of the next paragraph.

\documentclass{article}
\usepackage{lipsum}
\begin{document}
 \lipsum[3]
 \noindent\hskip\dimexpr -\hoffset-1in-\oddsidemargin-\leftskip\relax\rule{\paperwidth}{4pt}
  \lipsum[3]
\end{document}