Sign up ×
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 would like to know how I would go about labeling the Euclidean vectors in a diagram. For example, if I use the code provided below to draw a diagram which depicts three vectors, how would I label the appropriate vectors as, say, u, v, and u - v?

I am disappointed by the lack of antialiasing and quality of rasterization of the lines when I view the generated postscript or PDF file using the GNU Document Viewer (for reference, I am using Ubuntu 10.10, 64-bit at the time of this writing). Would using an EPS file instead of providing the following inline commands result in a higher-quality output? If so, could you please recommend an application that can generate these kinds of vector diagrams?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

My solution to this would be to use PGF/Tikz, which is way nicer with rasterization. You could achieve the same drawing like this :

    \node (a) at (0,0)  {};
    \node (b) at (2,3)  {};
    \node (c) at (3,2)  {};

    \draw[->] (a) to node {u} (b);
    \draw[->] (b) to node {u-v} (c);
    \draw[->] (a) to node {v} (c);

Or something of the sort, you can consult the PGF/Tikz manual which is full of nice examples (for instance summing coordinates).

And no, an EPS file won't give a nicer result, since it has to be scaled at some point, and second it is not easy to change your diagram once you've included it with the EPS method.

share|improve this answer
Just tried out TikZ, and it works beautifully -- thanks! – void-pointer May 6 '11 at 1:05
I understand that this question was posted 4 1/2 years ago but I am just now learning Tikz. I repeated the above drawing of the vector diagram exactly (actually cut and paste copy) and the code works but with one slight foible. The edges do not meet exactly at a point at each corner. It is almost as if there were a tiny circular barrier around each corner that the edge line cannot penetrate. Maybe platform dependent? Using Macbook Pro with latest of all software (downloaded Mactex package about a week ago). – K7PEH Nov 8 at 18:50
@K7PEH It's because a node is not a point, it would be better to use \coordinate (a) at (0,0); for this, and similar for b and c. This does the same as \node[coordinate](a) at (0,0) {};. – Torbjørn T. Nov 14 at 16:20
@TorbjørnT. Thanks. – K7PEH Nov 14 at 17:29
@TorbjørnT. exactly, I didn't know about this 4 years ago (hadn't read the huge manual up to this point) – EEva Nov 15 at 17:12

\psStartPoint[A](0,0)% name prefix A for the vectors

enter image description here

share|improve this answer
Ah, this also looks very pleasing, and the code is compact and easily manageable. Thanks! – void-pointer May 5 '11 at 23:20

If you were almost satisfied with picture environment, probably you could just add


to the preamble. It turns latex picture into real vector pictures from pseudo-graphics and removes some strange limitations. For instance, you may plot circles of any radius and lines with any slope. Read package manual for the details.

share|improve this answer

Your Answer


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.