3

I have the following code here, wrapped in a nice MWE but alas it will not compile. Where is my grave mistake? =)

\documentclass{minimal}
\usepackage{tikz,tkz-euclide}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\tkzDefPoint(0,0){O}
\tkzDefPoint(1,2){A} \tkzDefPoint(3,0){B} \tkzDefPoint(4,2){C}
\tkzDrawSegments[ultra thick,-stealth,red](O,B)
\tkzDrawSegments[ultra thick,-stealth,blue](O,A)
\tkzDrawSegments[ultra thick,-stealth,green!40!black](B,A)
\tkzDrawSegments[ultra thick,-stealth](O,C)
\tkzDrawSegments[thick,-stealth,dashed](B,{3.8,1.6} A,{3.5,2})
\tkzLabelSegment[left,blue](O,A){\Large $u$} \tkzLabelSegment[below,red](O,B){\Large $v$}
\begin{scope}[shift={(0,1})]
\tkzLabelSegment[above=2ex,green!40!black](O,C){\Large $u+v$}
\end{scope}
\begin{scope}[shift={(1,1}]
\tkzLabelSegment[below=2ex](A,B){\Large $u-v$}
\end{scope}
\end{tikzpicture}
\end{document}
N3buchadnezzar
  • 11,348
  • 7
  • 55
  • 114

1 Answers1

6

Two things:

  1. You swapped the order of ) and } in the first shift, and forgot the ) in the second.

  2. You're using \Large, but the minimal documentclass doesn't provide that size. Don't use minimal.

Here's the corrected code:

\documentclass{article}
\usepackage{tikz,tkz-euclide}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\tkzDefPoint(0,0){O}
\tkzDefPoint(1,2){A} \tkzDefPoint(3,0){B} \tkzDefPoint(4,2){C}
\tkzDrawSegments[ultra thick,-stealth,red](O,B)
\tkzDrawSegments[ultra thick,-stealth,blue](O,A)
\tkzDrawSegments[ultra thick,-stealth,green!40!black](B,A)
\tkzDrawSegments[ultra thick,-stealth](O,C)
\tkzDrawSegments[thick,-stealth,dashed](B,{3.8,1.6} A,{3.5,2})
\tkzLabelSegment[left,blue](O,A){\Large $u$} \tkzLabelSegment[below,red](O,B){\Large $v$}
\begin{scope}[shift={(0,1)}]
\tkzLabelSegment[above=2ex,green!40!black](O,C){\Large $u+v$}
\end{scope}
\begin{scope}[shift={(1,1)}]
\tkzLabelSegment[below=2ex](A,B){\Large $u-v$}
\end{scope}
\end{tikzpicture}
\end{document}
Jake
  • 232,450