TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.