Tikz.net – Graphics with TikZ in LaTeX
tikz.net
tikz.net
I love that I can build up a diagram from specific constructs using macros. For instance, if I'm expressing a lot of linked lists, I can define a single macro for how I want to express "route the next pointer from the previous element around this element to the following element by arcing over this element", and do that consistently throughout the document.
I love that I can easily express "draw a line from 30° above the axis on this object to 150° around the axis on this object", and TikZ will connect those in a smooth way no matter where the objects are placed.
I love that I can express "create a point at the intersection of this line and this curve, and let me reference that point by name later".
It's a programming language, and a powerful one. I recommend it for any non-trivial diagramming or schematic task.
All that said, for cases where you need to express semantics and not worry as much about how the result looks, and you want the simplest possible way to express "connect a to b to c, and b to d, and d to c and back", and not worry about where the nodes are placed, I recommend graphviz. Graphviz is great for "let me dump the structure of this program's data structures out as text and turn it into a diagram". The biggest distinguishing factor between graphviz and TikZ, for me, is node placement and style: if you care how it looks and where nodes are placed, use TikZ; if you don't, use graphviz.
https://lwn.net/Articles/640302/
So you can get the best of both worlds, doing everything within TikZ/LuaLaTeX.
TikZ has an easy to use DSL for expressing graphs :) you can write
\graph a -> {b, c} -> d;
and it will produce something like a –– b -- d
\ /
\ c /Documentation is so great that you are sure you will find an answer. TeX.SE is also very helpful. The quality of graphics produced is stunning that I never manage to like alternatives. The control it gives you over your drawings is enormous. Heck, I can have Sam font in my text and diagram!
I remember spending 5 hours on the first drawing I made in Tikz for a research paper. My coauthor was amused. He thought it would have taken max 30 mins if I used a 'normal tool'. But he was impressed by neatly rotated text, scaling and alignment. Pity that I coundnt play with colors since IEEE accepted b/w images back then.
Love it or hate it, nothing come remoty close to it when you have mastered it. Something akin to vim editor. Huge respect for Till Tantau.
It’s because of this that I think working with Tikz (or other very-high-friction-for-most-people tools) is to the detriment of the end product. Being able to be agile, especially when displaying technical and complicated graphics, is paramount to those graphics ending up good.
It’s worth mentioning that drawing complex diagrams with Tikz can take time. You need to code such that the plot is flexible if later you make a change, as much as possible.
The output is also good, more so with latex terminal. However, Tikz/PGFplots is much more adjustable, has broader scope, and overall a much better tool for plotting.
GnuPlot syntax is also archaic, and documentation is scant.
As mentioned above, you can use GnuPlot backend to compute the function. At that point, pgfplots is well positioned to render an excellent plot!
* Fonts and line widths are always correct. It looks really unprofessional when your figures have completely different fonts and line widths to the rest of your document,
* Symbolic/declarative description of figures. No need to guess or manually calculate where an equidistant point is or how to draw an arrow between two points, you can just write it down. Your figure will be perfect, not "close enough",
* Ability to write macros and other stuff you would expect from programming your figures.
It's useful to throw together basic 2d diagrams, which can then be refined later
Beware though, if you include too many graphs in a paper it will take longer than Overleaf's free compilation time limit, so consider compiling locally.
% Tikz caching (use make -f main.makefile to rebuild figures).
\usetikzlibrary{external}
\tikzexternalize[mode=list and make,prefix=tikzcache/] % Comment out this line to disable caching.
\newcommand{\includetikz}[1]{%
\tikzsetnextfilename{#1}%
\tikzpicturedependsonfile{#1.tikz}%
\input{#1.tikz}%
}
I would have all Tikz sources in a tikz/ directory, and include them where needed using e.g. \includetikz{tikz/foo}. Then the above would add an extra step to the compilation (make -f main.makefile), but in return all images would only be recompiled as necessary and otherwise included as a cached .pdf.Reduces the clutter inside the paper tex file.
Two weeks ago I had only seen TikZ mentioned in passing, as something key which a publisher wasn't supporting in their pipeline.
https://texample.net/tikz/examples/
With the CS ones at:
I saw this tool on HN some time back and it seems to have evolved into a very promising product: LaTeX typesetting, manual drawing, programmable with Lua. The price seems excellent too ($25).
If you write LaTeX, invest some time in learning Tikz if you need to do a drawing, it's worth it.
PGF/TikZ is a very well written program. What impresses me is that it does have the right amount of abstraction. It comes in different layers, starting from the Front End (TikZ), Basic Layer (which TikZ) uses This layer is built on top of the system layer. Whereas the system layer just provides the absolute minimum for drawing graphics, the basic layer provides numerous commands that make it possible to create sophisticated graphics easily and also quickly.
The basic layer does not provide a convenient syntax for describing graphics, which is left to frontends like TikZ. For this reason, the basic layer is typically used only by “other programs”. For example, the beamer package (can be used for presentations) uses the basic layer extensively, but does not need a convenient input syntax. Rather,speed and flexibility are needed when beamer creates graphics
The system layer, and drivers then create the the graphics in various formats, such as postscript, pdf etc.
I suspect starting from TikZ proper would make some of the wiring easier; there's a lot of naming nodes and connecting between them that seemed unintuitive, and like I always missed an easier way to draw a circuit.