0

Please consider this file:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
  \begin{tikzpicture}[scale=6]
    \draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;
  \end{tikzpicture}%
  \begin{tikzpicture}[scale=6]
    \draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;
  \end{tikzpicture}\par
  \begin{tikzpicture}[scale=6]
    \draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;
  \end{tikzpicture}%
  \begin{tikzpicture}[scale=6]
    \draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;
  \end{tikzpicture}
\end{center}
\end{document}

Obviously, the output should consist of four squares of the same size, two above and two below (plus the page number). What I got can be seen here:

enter image description here

As you can see, there is no horizontal space between the two top squares, and there is also no space between the two bottom squares. However, there is a small vertical space between the first pair and the second one. Why? And how can I remove it without trial and error. I know that adding \vspace{-1pt} at the right spot (that is, right after \par) solves my problem, but, precisely, that amount of space was obtained through trial and error.

3

1 Answer 1

1

Here's an answer, that I learned from the comments.

In such a situation (for more details, see this post or chapter 12 of The TeXBook), the length of the vertical space inserted between the lines is equal to \lineskip. So, the problem gets solved by putting \setlength{\lineskip}{0pt} (or \lineskip=0pt) after \begin{center}.

You must log in to answer this question.

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