For further information and updates and background production story you can visit: LaTeX Community forum announcement.

This is a special thanks to all LaTeX supporters for helping in forums and Q&A sites and personally. I know, our experienced LaTeX supporters don’t need this book, but feel free to get it for curiosity. Your download will prove interest to the publisher, so I could offer them a revised updated edition.

Our LaTeX friends, who may be new in this topic, may benefit. And I thank all for their questions in online forums, because they would not exist without you!

More details, including table of contents and sample chapter: Publisher’s LaTeX book page.

Tell your friends to download a free copy.

We are always happy to welcome LaTeX friends in the LaTeX Community forum, so it would be great if you would join us in the forum. I will answer any question to the book’s contents there. Experts: our forum also needs your help, perhaps have a look at the unanswered questions. Are you able to answer one, even if it’s older? Orginal poster and later readers would be happy!

]]>This 36th annual meeting will take place July 20 – 22 in Darmstadt, Germany. It’s about 30 kilometers away from Frankfurt, so I plan to fly from Hamburg, where I live, to Frankfurt, then take the direct bus connection. Since I’m an employee of the Lufthansa airline, I’ll take a standby ticket for a nice rate.

Apropos rate: students can register for 75 Euro (TUG member normal price: 260 Euro) And great news: DANTE members can get 50 Euro discount! More details on the above linked web page.

]]>

It’s a project of Paulo Cereda and me. While I maintain the web server and the TeX installation, he contributes layout and programming for the interface. Today Paulo provided a completely new version. Together we tested and adjusted the code. What was developed on his Fedora laptop, now runs on the Debian web server, adaption went like a clockwork while skyping.

Now, TeXdoc runs on the dwoo PHP5 template engine. Something new for me after OSQA, Django, Joomla, WordPress, phpBBx, having Drupal still on the list.

What is it all about? Well, TeXdoc.net provides an interface to the current TeX documentation, understanding search keywords but also allowing topic browsing. It bases on the texdoc and texdoctk scripts which belong to a TeX Live installation. Via the server, you an access current manuals without having the newest installation or using an tablet like an iPad or a smartphone.

The main motivation was to provide a generic shortcut for web forums. By highlighting a package name, and clicking a button, you can generate a link to the package documentation. Handy while talking. It is integrated for example on LaTeX-Community.org, TeXwelt.de and goLaTeX.de by buttons and markup code but used anywhere people know the link syntax.

Finally, its OpenSearch feature integrates with the quick-search field in browsers such as Firefox.

]]>

I’m happy to read that our fellow Matheplanet members voted to present me with the award. Thank you very much! It means much to me, because it’s the first Internet forum I joined. This was in 2005, ten years ago. At that time I used LaTeX a lot for math. Even student homework makes fun when it’s written and presented like in a science publication. As reading source code and programming is a lot easier than math I mostly wrote answers in the LaTeX forum. Another reason is, that I don’t do other student’s math homework, which seems to be asked sometimes, but LaTeX is a working tool where I can freely help. Because it’s not homework or an assigned task but a great tool for maths which we gladly support.

The annual member’s award is the feedback from users for user’s contributions and a nice event every year. There’s no voting for posts, in contrast to Stack Exchange sites where each single post has a “like” button. However, they have a concept similar to the SE badges. In 2005, the Matheplanet introduced colored sticks called “Stäbchen” which stand for certain contributions. They are collected in the user’s profile. This was three years before SE aka StackOverflow was founded. My profile can be looked at as a sample.

The Matheplanet still looks similar like at its beginning, being a classical web forum. Today, it has LaTeX support and is even capable of compiling TikZ snippets. It became popular to embed TikZ drawings directly within forum posts, which is really nice. I noticed cis doing it a lot. Before supporting LaTeX, the forum provided its own formula editor. Its syntax is quite intuitive, which is very good for easy and quick posting, but students and mathematicians are mostly already used to LaTeX, so direct LaTeX support is nice to have.

]]>The appearance stays the same but with improvements:

- All advertisements have been removed
- Cleaner look and faster loading
- One-click-opening of code in online LaTeX editor (Overleaf aka writeLaTeX)
- Buttons and bbCode shortcuts for
- Typewriter Markup of inline code
- Adding CTAN package links
- Linking to documentation
- Link to MWE explanation

- Adding attachments has been fixed
- Image attachments can now be directly embedded via IMG button or bbCode

An update to a newer version of the same forum software is planned, but requires time for testing and reimplementing existing customizations.

Being a classic discussion forum, it is different to the straight Q&A approach of TeXwelt. While the latter is very focused and efficient, a discussion forum is still a meaningful support way, such as for beginners and bachelor thesis writers with complex challenges.

We may think of migration paths between goLaTeX forum and TeXwelt Q&A site depending on content and user wish, also taking revised fundamental content of both over to the goLaTeX wiki. Not to forget discussing unsolved issues in English in the LaTeX-Community forum. Further ideas are connecting user profiles across sites in some way if desired, having stats across sites, combined RSS feeds for new topics, and overall searching, tagging and index browsing.

For now, I hope that the quickly implemented improvements already add fun to the forum life.

]]>It continues as a free service with additional advanced features for paid subscriptions. Existing projects, files and links will remain fully accessible, even though a major upgrade is planned for 2015. We can expect faster rendering and higher quality of the real-time preview.

Changing the name is often a challenge. They chose a rather quite time of the year, so it won’t affect users much. More of a risk may be dropping a popular name and needing to establish a new brand, but the advantages seem to outweigh the disadvantages. Specifically, the rich text mode may hide to occasional co-authors that there’s LaTeX under the hood: like in LyX there’s a WYSIWYM mode which makes editing possible for users without LaTeX knowledge. So it’s just consequent to omit LaTeX also in the service name.

You can read the official announcement here: WriteLaTeX is continued Overleaf.

]]>I would live to highlight two of the new features. Now you can use radian in arguments for trigonometric functions, besides degree. Before, we could convert radian to degree using the `deg()` function, such as by `sin(deg(x))`, if x wasn’t given in degree. So the input of complex trigonometric expressions can be simplified. You just need to specify `trig format plots=rad` once as an option.

The code for the picture on the right shows “before and after”, in the answer by Christian on TeXwelt to the question, if you can switch from degree to radian with PGFPlots together with the announcement of the upcoming feature.

Or let’s have a look how it’s applied in a small example – here I plotted a spherical harmonics map (used in quantum mechanics), originally requested by Henri in PSTricks:

\documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{trig format plots=rad, compat=1.11} \usepgfplotslibrary{colormaps} \begin{document} \begin{tikzpicture} \begin{axis}[colormap/violet, hide axis] \addplot3[ surf, domain = 0:pi, domain y = 0:2*pi, samples = 50, samples y = 70, z buffer = sort ] ( {sin(x)*cos(y)*(sqrt(3/(4*pi))*sin(x)*cos(y))^2}, {sin(x)*sin(y)*(sqrt(3/(4*pi))*sin(x)*cos(y))^2}, {cos(x)*(sqrt(3/(4*pi))*sin(x)*cos(y))^2} ); \end{axis} \end{tikzpicture} \end{document} |

Furthermore, adding custom annotations became simpler. Until now, you could refer to the coordinate system using the `axis cs:`syntax, for drawing additional lines, arrows, labels or annotations. In contrast to low level pgf/TikZ coordinates, axis cs applies logarithms, data scaling and custom transformations, so that should be choosen. Now, that’s implicitly done. For example, it could look like Elke’s filled area below a normal distribution:

\draw [dotted] (axis cs:2.698,-4) -- (axis cs:2.698,4.5); \node at (axis cs:0,1.4) [anchor=east, rotate=90] {50\,\%}; |

With the new version it can be simplified to

\draw [dotted] (2.698,-4) -- (2.698,4.5); \node at (0,1.4) [anchor=east, rotate=90] {50\,\%}; |

So less writing work and easier to read, especially if i’s used many times, such as in Elke’s plot.

That small update fixed also several bugs. With my frequent usage I stumbled only across one of them, which as now been fixed (too much whitespace with the units library under certain circumstances – i.e. bounding box too big). The README file provides further information.

Regarding the future development: in a comment to zu a question about rotation transformation with PGFPlots Christian announced, that current development of PGFPlots focuses on scalability and performance, motivated by the many 3d surface plots on TeXwelt. He already finished a prototype version, which can double the speed. This version bases on a Lua backend. I look forward to this development, since I frequently generate complex plots and compile a lot of times, until viewing angle, sampling rate, coloring and further options result in the best possible visualization.

You can use your package manager for updating PGFPlots, alternatively you can download the new version from SourceForge or from CTAN.

]]>

In polar coordinates, the presentation of the sine function is a simple circle, which is repeatedly tun through with raising or falling angle. The full circle matches the period length.

\documentclass[border=10pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar} \begin{document} \begin{tikzpicture} \begin{polaraxis}[ domain = 0:180, samples = 100, ] \addplot[thick, blue] {sin(x)}; \legend{$\sin(x)$} \end{polaraxis} \end{tikzpicture} \end{document} |

Shortening the period length, we get:

We can go farther – instead of a huge factor we could take a fraction, which isn’t a big divider of a small multiple of 360 degrees. We can get nice images, which won’t look like a simple sine or circle.

\documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar,colormaps} \begin{document} \begin{tikzpicture} \begin{polaraxis}[ domain = -14400:14400, samples = 3000, colormap/cool, hide axis ] \addplot[no markers,mesh,opacity=0.5] {1-sin(40*x/39}; \end{polaraxis} \end{tikzpicture} \end{document} |

If we would add a sine with different factor, we would get more movement – this is a plot I recently had onTeXwelt:

\documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar} \begin{document} \begin{tikzpicture} \begin{polaraxis}[ domain = -3600:3600, samples = 4000 ] \addplot[blue!50!black] {1 - sin(50*x/49) - sin(8*x)}; \end{polaraxis} \end{tikzpicture} \end{document} |

It’s hard to see the actual path though. To better see it, we could color it, dependent on the number of rotations around the origin, which means the angle. Or we take it to the third dimension: going higher with raising angle. This could provide a better view.

We generate a parametrical 3d plot in x and y. x runs through the full circle from -180 degrees to 180 degrees. We specify a sampling for y which stands for the number of rotations around the origin. We add y times 360 degrees to the function value. y serves as third dimension, as the height, while the angle x and the function value are the original two dimensions. Further explanation: here on TeXwelt.

\documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ domain = -180:180, y domain = -19:19, samples y = 39, samples = 100, z buffer = sort, colormap/cool, grid ] \addplot3[data cs = polar, surf] ( {x}, {1 - sin(50*(x+360*y)/49) - sin(8*(x+360*y))}, {y} ); \end{axis} \end{tikzpicture} \end{document} |

That shows the original intention of the blog post: showing how to use the third dimension for visualizing a complex polar two-dimensional function.

]]>Here, I benefit from these features of pgfplots, going beyond base TikZ:

- Simple plotting with 3d coordinates and axonometric projection
- Presentation of required coordinate axes
- Using color gradients
- Reading in files with externally calculated data

In any case we can use Lua for calculating data. Lua generates the TeX commands for printing, which will be processed in a pgfplots axis environment.

Here are the samples, just click on it to get to the corresponding thread on TeXwelt with full source code.

While I posted a Python calculated version on TeXwelt.de, Henri added one, which bases on LuaTeX. Let’s see his picture at first:

Of pgfplots I used the transparency feature besides the standard 3d plot, so I got an impression of the density:

Once we calculated the data, the code is simple:

\documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin = -25, xmax = 25, ymin = -25, ymax = 25, zmin = 0, zmax = 50, hide axis, ] \addplot3[mark=none, mesh, shader=interp, color=black, opacity=0.2] file { lorenz.dat }; \end{axis} \end{tikzpicture} \end{document} |

Between adjacent points, new points will be calculated, with random but limited variation. Finally we will get a mountainous landscaoe. The calculated points get color according to their height: blue for sea level and below, green for mountains and white above the snowline.

Next step: specify nice starting values, for beginning with a certain base structure, such as an island in the water.

This is a classic of the chaos theory und closely related to the Mandelbrot set. Also here, we use transparency for an impression of the point density.

I often started such topics on TeXwelt.de. LaTeX support for thesis writers is not the only talking point there. It became established, that TeX connoisseurs post their ideas in shape of a question, often themselves posting the first answer, opening a discussion. The final goal is a knowledge database, built on top of questions and answers.

]]>Enough of theory, there are great books on it, and Wikipedia provides a nice starting point. How do we generate such a fractal image? The simplest approach is the so called *chaos game*: wie nehmen einen Punkt her, and apply one of the transformations, randomly chosen. Because we got point sets, which are invariant under those transformations, the mapped point will be in the set again. We take the new point and repeat it, thousands of times, until a clear shape appears.

Let’s do this with the famous Barnsley fern!

But how? We need loops and the possibility of calculating affine transformations. It can be done with pgfmath, but I think it’s hardly readable. So I rather take Lua, integrating a programming language in the classical sense into the macro expansion language TeX. It’s easily written in Lua. I put the transformation parameters and probabilities into a matrix, so it can easily be changed for experiments. Let’s start the chaos game!

For compiling, we need LuaTeX and patience. For testing and playing with parameters and probabilities, it’s recommendable to choose a low number of iterations.

\documentclass[tikz,border=10pt]{standalone} \usepackage{luacode} \begin{luacode*} function barnsley(iterations,options) local x = math.random() local y = math.random() local m = { 0.0, 0.0, 0.0, 0.16, 0.0, 0.0, 0.01, 0.85, 0.04, -0.04, 0.85, 0.0, 1.6, 0.85, 0.2, -0.26, 0.23, 0.22, 0.0, 1.6, 0.07, -0.15, 0.28, 0.26, 0.24, 0.0, 0.44, 0.07 } local pm = { m[7], m[7] + m[14], m[7] + m[14] + m[21] } if options ~= [[]] then tex.sprint("\\draw[" .. options .. "] ") else tex.sprint("\\addplot coordinates{") end for i=1, iterations do p = math.random() if p < pm[1] then case = 0 elseif p < pm[2] then case = 1 elseif p < pm[3] then case = 2 else case = 3 end newx = (m[7*case+1] * x) + (m[7*case+2] * y) + m[7*case+5] y = (m[7*case+3] * x) + (m[7*case+4] * y) + m[7*case+6] x = newx tex.sprint("("..x..","..y..") circle (0.05pt)") end tex.sprint(";") end \end{luacode*} \begin{document} \begin{tikzpicture} \directlua{barnsley(100000, [[color=green!50!black,fill]])} \end{tikzpicture} \end{document} |

On TeXwelt.de I produced variations, printed using pgfplots.

Also the famous Sierpinski triangle can be generated using the chaos game instead of the L-System approach, the similar source code is on TeXwelt.de, like linked above:

Now in three dimensions? No joke – in analogy to the triangle there’s the squarish Sierpinski carpet, wich becomes the so called Menger sponge in three dimensions.

]]>