I was looking at recent questions here and was surprized that people were drawing diagrams in LaTeX, when it can be done in SmartDraw, OpenOffice or other programs. Is there any benefit to using LaTeX for diagrams (at least for normal diagrams like a layered architecture)?
|
|
LaTeX diagrams can be directly inserted in your LaTeX document, while you need to export them from other programs, which needs to be repeated every time you change the diagram. A big benefit of drawing your diagrams in LaTeX is also that you can use the same fonts as in the rest of your document and also ensure that the text is properly scaled. In addition you can use all the benefits of the (La)TeX typesetting system, like the great math support. If you import your diagram from OpenOffice or a similar tool the font may be different and not properly scaled and while such tools can also handle math, the result may look different. A further benefit is that you can code/program your diagrams in LaTeX. Especially TikZ and PSTricks allow for loops and conditionals. Coordinates can be directly given, which is a great benefit for technical diagrams. I, for example, had several ADC diagrams with a programmable step size in my PhD thesis and actually coded a general form of the document which a copied several times and then only adjusted internal variables to get a different number of curves with different step sizes. Such things are not possible with drawing tools and then take much more time. Another example is my Drawing the diagrams using a drawing program might be quicker in some cases, especially if you are new to LaTeX, but usually the LaTeX diagrams looks better and is more consistant as a manual drawn one. |
|||||||
|
|
To enforce Martin's answer, I would say that nowadays there are lots of specific drawing packages which are of help since:
Both lists are just examples I know: there are even more, also the ones belonging to the PSTricks family. Having such a choice is very helpful: if one needs to do a specific thing, very likely he can find a package ready. This allows to reduce the time needed to find some pre-existing drawings to start with and all the relative stuff (are there some specific rules/conventions to be respected? is such an example valid or not?). Indeed, the specific packages are developed to respect specific rules/conventions (when there are) and, since there are lots of examples, it is very easy to start with. Consider, as a starting point, to have a look to some tags here: tikz-pgf, pstricks, technical-drawing and diagrams. Notice also that, adopting TikZ, there's the possibility to easily make animation in Beamer presentations; a practical example with
To make more clear this concept, here is an example with
The interaction Beamer-TikZ really helps in save time since very often a TikZpicture from a standard document just needs few processing to be animated. The code of the previous diagram:
|
|||||
|
|
The main advantages of drawing with LaTeX are consistency, control, development, and maintenance. In the following I'm asuming you're using TikZ.
|
||||
|
|
|
Martin and Claudio have made good points for coding figures in LaTeX, so I'd like to take the other stance and offer some tricks to help :) I mostly use OmniGraffle to prepare figures; I consider that figures (like presentations) are visual artifacts and that its better to design them in a visual way. TikZ and Beamer are biased towards what's easy to express in code or using third-party packages, and so you might make compromises in shapes, or in placing elements in relation with their neighbors, that you just would not have to think about in a visual editor. I tend to be very picky in the curves of arrows, of text, the distribution of negative space, and I often need to tweak nearly each element. There is no simple law for those tweaks, as it follows optical and subjective visual qualities. Now of course, there are still the objections about font consistency, typesetting text to match the document, and exporting the graphics, but I have a few workarounds:
|
|||
|
|
|
I don't know the exact graphical features of See for example http://uweziegenhagen.de/?p=2488 where I created learning materials that can be switched between the show-answers and the dont-show-answers version with just a single word ( This kind of templating is why I love LaTeX! |
|||
|
|
If you can draw then that's great, good for you. But I cannot. For instance, I needed a diagram of a parallelogram generated by two first-octant vectors in three dimensions. I told the drawing program the coordinates, and instructed it to draw. The result looks perfectly acceptable and I was on to the next thing. |
|||||||
|


