12

Apologies if this is a duplicate. It would seem like it would be a well-known problem, but I was unable to track a solution.

In words: the grid lines do not extend enough to form sharp corners. I would like sharp corners. Thanks.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1]
  \draw (0, 0) grid (1, 1);
\end{tikzpicture}
\end{document}

enter image description here

0

1 Answer 1

11

I do not know why it is not default for grid, but it helps to set the line cap to rect.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[line cap=rect] (0, 0) grid (1, 1);
\end{tikzpicture}
\end{document}
2
  • 3
    Great. Indeed, if anyone knows why this isn't the default, please chime in.
    – PatrickT
    Commented Jan 21, 2019 at 13:18
  • 7
    @PatrickT You can also try round (instead of rect). The initial value is butt for grid and for all other drawing operations as in PDF standard. Commented Jan 21, 2019 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .