Just recently I convinced a friend of mine to use LaTeX for her papers. A huge step for her and a small one for me as I just had to copy my templates and show her a few hints about LaTeX. Well, that’s what I thought. It was actually even the very same day when she asked me for help: she needed an image in there. That was of course easy but when I saw it I felt like I needed to replace it (it was seriously awfull). So, drawing…
She needed three rectangles connected with arrows. Easy thing with pstricks one might think but then pstricks is a PITA when you need a pdf document. So I tried tikz (of course, Debian delivers it right away). And see how “easy” that looks like:
\begin{figure}[htbp] \centering \begin{tikzpicture} [<->, auto, block/.style = {rectangle, draw=blue, thick, fill=blue!20, text width=3.5cm, text centered, rounded corners, minimum height=2cm, font=\sffamily}, line/.style = {draw, thick}] \matrix [column sep=5mm, row sep=2cm] { % row 1 & \node [block] (top) {Rectangle A}; \\ % row 2 \node [block] (left) {Rectangle B}; & & \node [block] (right) {Rectangle C}; & \\ }; \begin{scope}[every path/.style=line] \path (left) -- node [midway,font=\sffamily\footnotesize] {Arrow desc 1} (top); \path (left) -- node [midway,font=\sffamily\footnotesize] {Arrow desc 2} (right); \path (top) -- node [midway,font=\sffamily\footnotesize] {Arrow desc 3} (right); \end{scope} \end{tikzpicture} \caption{My fancy image} \label{fancyimage} \end{figure}
Don’t you like it that way?
Liam says:
http://packages.debian.org/lenny/ipe
May 8, 2009, 15:33jhr says:
Nice, didn’t know about it. But it seems a little overkill for a small grafic like the above one… :)
May 8, 2009, 15:42Paul Tötterman says:
I usually make simple illustrations using graphviz and more complicated ones using dia. graphviz exports pdf and ps. dia exports eps which can be converted to pdf using epstopdf.
May 8, 2009, 15:46ulrik says:
That’s terrible. LaTeX is horrible.
But I almost always use latex, when plain text can’t do it, and that’s just because the alternatives are far worse.
But having to look up syntax and commands, and having to write long commands to do tweaks– that is something I decided I simply do not do.
So it might work for you to insert such figures.. but I wouldn’t tell your friend to do it or he/she will quickly find a horrible LaTeX track.
I use latex, and I don’t tweak almost anything that can’t be tweaked with simple one-liners. LaTeX is great in simplicity and beauty, only when you don’t have to work for it. So I don’t and I rely on simply LaTeX markup. That’s what I would suggest anyone to do.
May 8, 2009, 15:50jhr says:
To be honest, I just tried it to know how it works. As a matter of fact frawing pictures wit markup languages is not one of my hobbies. :)
Thanks for the suggestions and don’t worry — she’ll never learn that.
May 8, 2009, 16:26T. says:
Well, I use ps4pdf with pstricks. that’s a pain, too, but vaguely doable. I mainly miss srctex (evince is SO superior to that proprietary PDF viewer, if only for the reload button!).
May 8, 2009, 17:29Tet says:
Bleurgh! I’ll stick with pic, I think…
May 8, 2009, 17:52Aaron says:
Another tool that might be of interest is xfig; it’s a little clunky by today’s standards, but in conjunction with fig2dev from the transfig package can produce self-contained latex using various environments, including in particular the standard picture environment (which might suffice for your example) and the more versatile eepic package.
May 8, 2009, 19:49walter kehowski says:
Use MetaPost! Just be sure to insert
\DeclareGraphicsRule{*}{mps}{*}{}
right after \begin{document} in your .tex file and you will be able to input the .1, .2, etc files generated after compiling your MetaPost file. If your latex file is file.tex then a good idea is to name your MetaPost file file.mp and then you can input the graphics files with a command like
\includegraphics[options]{\jobname.1}
Much easier! ;)
May 8, 2009, 19:56Leonardo S. R. says:
Try it:
May 8, 2009, 22:40– http://piprim.tuxfamily.org/asymptote/ ;
– and http://marris.org/asymptote/ .
Yaroslav Halchenko says:
since noone yet mentioned that project: I’ve moved to inkscape: http://www.inkscape.org/ for drawing anything and everything. Inkscape is great — I only hope that at some point someone comes up with a conveniant ‘clipart’ of primitives for it so it becomes even easier to draw diagrams etc
for making incremental slides in presentation I made up a little script (svgtune) which from a single .svg file generates a list of resultant figures for inclusion in latex/pdf: http://github.com/yarikoptic/svgtune/tree/master
May 10, 2009, 06:03