Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.