I am trying to understand tikz and coordinates when close to page margins.
I have the following MWE which is a 1cm graph paper, within a 1cm margin a4 page. There are no paragraph indentations.
I am expecting one page of grid.
What I get instead is a two-page document, where the grid is on the second page, as if it couldn't fit on the first page. And the page-numbering on both pages is pushed down so that only half the digit appears.
Is the line width that is making the picture slightly larger than the stated dimensions?
How do I fix this? And what is going wrong?
\documentclass{article}
\usepackage[a4paper, margin=1cm] {geometry}
\setlength{\parindent}{0ex}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[line width=.4pt,draw=black] (0,0) rectangle(\textwidth,\textheight);
\end{tikzpicture}
\end{document}




gridis tricky: last line is not visible, if the text area is the same width as grid. Here again is problem of some difference dependent on line width. I add to answer two example of drawing grid. – Zarko Jan 11 '17 at 19:44