5

When using standalone or article class, my TikZ figure renders as it should. But when changing to tufte-handout, I get some misalignments. Why is this? How can I solve it?

With tufte-handout, wrong

With article class, ok

The code of the figure in the following MWE is taken from the answer of @Tarass to this other question: Dimensioning of a technical drawing in TikZ. At first I thought it was a problem with his \Cote command (as the cotes appeared to be completely messed), but removing all but the figure, revealed this misalignment with the circle.

\documentclass[twoside,a4paper]{tufte-handout}
%\documentclass{article} %uncomment this to see what's happening
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\small
\draw[thick,blue,fill=blue!25]
        (0,1) coordinate (A)
    --  (3,1) coordinate (B)
    --  (5,2) coordinate (C)
    --  (5,4) coordinate (D)
    --  (3,4) coordinate (E)
    --  (2.5,3) coordinate (F)
    --  (2,4) coordinate (G)
    --  (0,4) coordinate (H)
    --cycle ;

\draw[red,fill=red!25] (2.5,3.9) circle (.39) ;

\end{tikzpicture}
\end{document}
Pablo B.
  • 537

1 Answers1

5

the class apparently sets up \small to set \spaceskip which seems wrong in general and is a disaster inside a tikzpicture You can avoid the problem by moving \small or you can reset \spaceskip:

\documentclass[twoside,a4paper]{tufte-handout}
%\documentclass{article} %uncomment this to see what's happening
\usepackage{tikz}

\begin{document}


\begin{tikzpicture}
\small
\spaceskip0pt
\draw[thick,blue,fill=blue!25]
        (0,1) coordinate (A)
    --  (3,1) coordinate (B)
    --  (5,2) coordinate (C)
    --  (5,4) coordinate (D)
    --  (3,4) coordinate (E)
    --  (2.5,3) coordinate (F)
    --  (2,4) coordinate (G)
    --  (0,4) coordinate (H)
    --cycle ;

\draw[red,fill=red!25] (2.5,3.9) circle (.39) ;

\end{tikzpicture}
\end{document}
David Carlisle
  • 757,742