LaTeX/Inserting diagrams

LaTeX, diagrams, pictures, drawing

You may use the picture environment in latex and "programme" the picture with your keyboard like

%drawing a line "/" in latex
%this is a compilable file!


If you have a picture which is a little more sophisticated, such programming would be a nightmare and you may wish to use your mouse to help. There is a number of free CAD tools for TeX. jPicEdt [1] is one which is easy to install - you would need Java if you haven't got it yet, but the installation of java is straightforward, and you will find it useful in the future anyway.

You can download the .jar file, install it, and draw a picture with it, and save the file (e.g. with the title "jPic-test1.tex") in the same directory of your other .tex files. To embed the picture in your LaTeX/helloworld.tex, simply insert the following code in your helloworld.tex:


or, if you like


And then compile your helloworld.tex as before : type "latex helloworld".

If you get error messages, you may need to remove the offending (and redundant) lines. A typical problem is such a line as "\qbezier(80,80)(80,80)(80,80)" which tries to draw a quadratic bezier curve on the same point, which crashes the compiler.

See also