| Why should I be using TeX for graphics? |
|
|
|
| LaTeX - Graphics, Figures & Tables |
| Written by Pieter Belmans |
| Tuesday, 19 June 2012 19:00 |
|
By the time you read this the revolution that Donald Knuth has caused in typesetting by creating TeX has made all of our lives so much easier. And I believe we are not enough aware of it. Producing high-quality typesetting and beautiful typography, including mathematics, tables of contents, glossaries, ... It is all possible with a few backslashes and curly brackets. Over the last years a similar breakthrough has been occurring in the creation of graphics. This is no longer the territory of either big software suites or obscure programs. The current open-source software related to TeX has matured greatly and is now capable of what was previously only within reach of the happy few with specific knowledge and tools. This article is about how I have been experiencing the aforementioned breakthrough, hoping to convince you of trying some of the currently available tools yourself. - A contribution to the LaTeX and Graphics contest - PGF/TikZCentral in the TeX & graphics workflow is PGF/TikZ. Its first version was released in 2007 and in its current 2.10 release it is considered by myself and many others to be the indispensible tool for most of our graphics creating. It also provides the glue between many other things, which I will discuss later on. To quote the manual, and explaining the name: PGF means "Portable Graphics Format'' and TikZ stands for ``TikZ ist kein Zeichenprogramm''. This means that you, just like writing TeX is in a sense programming your text, the drawing consists of programming your graphics. This may sound hard and counterintuitive, but the pros are plenty:
Like Leslie Lamport said in his book LaTeX: A Document Preparation System: Making Greek letters is as easy as
This describes perfectly what a revolution TeX has caused in the area of typesetting. No more typewriters, handwritten mathematics or expensive publisher-only technology. The same can be said about PGF/TikZ: Drawing an orangle circle is as easy as
If you don't stick to drawing colored circles and decide to go all the way, you can get these examples from TeXample.net: Figure 1 The TeXtronics oscilloscope Figure 2 A complete graph on 16 nodes And a little example I created myself, automating the drawing of beating frequencies in TeX:\newcommand\frequencydiagram[5]{
\begin{tikzpicture}[scale = 0.85, domain = 0:10, samples = 5000]
\draw[very thin] (-0.1,-2.1) grid (10.1,2.1);
\draw[thick, ->] (-0.2,0) -- (10.2,0);
\draw[thick, ->] (0,-2.2) -- (0,2.2) node[above] {amplitude};
\draw[fill] (0,0) circle (2pt) node [below left] {$0$};
\draw[fill] (pi,0) circle (2pt) node [below] {$\pi$};
\draw[fill] (2*pi,0) circle (2pt) node [below] {$2\pi$};
\draw[fill] (3*pi,0) circle (2pt) node [below] {$3\pi$};
\draw[color = yellow] plot function{sin(#1*#2*x)} node[right] {\SI{#4}{\hertz}};
\draw[color = red] plot function{sin(#1*#3*x)} node[right] {\SI{#5}{\hertz}};
\draw[semithick, color = blue] plot function{2*sin(#1*(#3+#2)*x/2)*cos(#1*(#3-#2)*x/2)} node[right] {sum};
\end{tikzpicture}
}
\frequencydiagram{8}{1}{1.125}{8}{9}
Code 1 Drawing beating frequencies which gives
Figure 3 Beating frequencies
|
Latest Forum Posts
Re: GERMAN UMLAUTE D'ONT WORK
25/05/2013 07:08, sommerfee
Abstract and page numbers
25/05/2013 05:35, ndussex
Re: Combining texlive and Illustrator
25/05/2013 04:08, mas
Re: GERMAN UMLAUTE D'ONT WORK
25/05/2013 00:31, BLATEX
GERMAN UMLAUTE D'ONT WORK
24/05/2013 22:56, BLATEX
Combining texlive and Illustrator
24/05/2013 21:08, ghostanime2001
Re: 3 Parralel text
24/05/2013 21:00, tavariz91
Re: References in Presentation
24/05/2013 20:49, ys_g
Re: References in Presentation
24/05/2013 20:28, Johannes_B
Re: Problems with showing References in Beamer
24/05/2013 20:22, Johannes_B
















Comments
Thanks for the article!