0

I want to write some equations on graph paper generated by tikz.

The problem I have is the line spacing in an equation environment.

  • On left side of the following picture you see what I want.
  • On the right side you see what I got.

I don't understand why the line spacing is different. The right one should look like the left one.

enter image description here

MWE

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{tikz}

\begin{document} 

\begin{tikzpicture}
% Graph Paper
\draw[step=0.5,help lines,black!20] (-0.95,0.95) grid (15.95,-14.95);
% Equation 1
\draw (0.5,0) node[below right] {\(y = 5 - 3x\)};
\draw (0.5,-1) node[below right] {\(y = 5 - 3x\)};
\draw (0.5,-2) node[below right] {\(y = 5 - 3x\)};
\draw (0.5,-3) node[below right] {\(y = 5 - 3x\)};
\draw (0.5,-4) node[below right] {\(y = 5 - 3x\)};
% Equation 2
\draw (0.5,0.65) node[below right] {
  \begin{minipage}{\linewidth}
  \begin{align*}
  y &= 5 - 3x\\[0.5cm]
  y &= 5 - 3x\\[0.5cm]
  y &= 5 - 3x\\[0.5cm]
  y &= 5 - 3x\\[0.5cm]
  y &= 5 - 3x
  \end{align*}
  \end{minipage}
 };   
\end{tikzpicture}

\end{document}

Additional Information

To use an align-environment in tikz you have to put it in a minipage-environment (https://tex.stackexchange.com/a/106813/101831).

1 Answers1

-1

Why don't try this

\documentclass{scrartcl}
 \usepackage{amsmath}
\usepackage{tikz}




\begin{document} 

\begin{tikzpicture}

% Graph Paper

\draw[step=0.5,help lines,black!20] (-5,-5) grid (10,5);

% Equation 1

\node[anchor=base](a)  {\(y = 5 - 3x\)};

\node[below of=a] (b) {\(y = 5 - 3x\)};

\node[below of=b] (c) {\(y = 5 - 3x\)};

\node[below of=c] (d) {\(y = 5 - 3x\)};

\node[below of=d] (e) {\(y = 5 - 3x\)};

% right side

\node[right of=a,node distance=5cm](f)  {\(y = 5 - 3x\)};

\node[right of=b,node distance=5cm] (g) {\(y = 5 - 3x\)};

\node[right of=c,node distance=5cm] (h) {\(y = 5 - 3x\)};

\node[right of=d,node distance=5cm] (i) {\(y = 5 - 3x\)};

\node[right of=e,node distance=5cm] (j) {\(y = 5 - 3x\)};


\end{tikzpicture}

\end{document}
Aviroum
  • 1,504