# Remove far left bleed on geometry and TikZ (overlay)

I am getting some sort of undesirable left bleed despite my attempts to eradicate it when I try to use geometry together with TikZ:

\documentclass{article}

\usepackage{tikz}
\pagestyle{empty}
\setlength{\topskip}{0in}

\usepackage[%
margin=0in,
paperwidth= 8in,
paperheight= 10in
]{geometry}

\begin{document}

\pagecolor{blue}

\begin{tikzpicture}[overlay]
\draw[color=yellow, fill=yellow,opacity=0.5] (0in,0in) rectangle (8in,-10in);
\end{tikzpicture}

\end{document}


The result is below. This must be an obvious error, probably some magic parameter incantation that I am missing, but I am not sure where to look.

• What you wanna achieve from this? Adding background color to the page? If you set the margin to be zero what is the rest of the document layout should be?
– Tom
Jun 20 at 6:51

This simply happens because of the indentation. Compare

Lorem ipsum

\noindent
Lorem ipsum


Thus, the solution is simply to add \noindent before your tikz

\documentclass{article}

\usepackage{tikz}
\pagestyle{empty}
\setlength{\topskip}{0in}

\usepackage[%
margin=0in,
paperwidth= 8in,
paperheight= 10in
]{geometry}

\begin{document}

\pagecolor{blue}

\noindent
\begin{tikzpicture}[overlay]
\draw[color=yellow, fill=yellow,opacity=0.5] (0in,0in) rectangle (8in,-10in);
\end{tikzpicture}

\end{document}


• dumb me...I should have realized this! probably the 6,000th version of this error on tex.stackexchange. Jun 20 at 18:21