## News from goLaTeX

The web site and forum goLaTeX.de moved to a new server, which is maintained by me. Johannes already wrote about it on TeXwelt.de (Neuigkeiten bei goLaTeX), and I posted the news here: Server-Umzug.

The appearance stays the same but with improvements:

Continue Reading →

## writeLaTeX is now Overleaf

The company behind the collaborative writing and publishing system writeLaTeX.com, Writelatex Limited, decided to rebrand. From now on, the system will carry the name *Overleaf*.

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.

## PGFPlots 1.11 released

Christian Feuersänger released version 1.11 of PGFPlots. It’s already one week ago, but regarding this special package that news is important for me, so I share it also here. Furthermore, there are news about the future development.

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.

## Periodically, more or less

Recently I got my hands on the sine function, again. It’s the classic example for a periodic function. Everybody knows that horizontal wave in the cartesian coordinate system. Starting with a polar plot of a complex sine function in two dimensions I would like to visualize the function in three dimensions.

## Dynamic systems, bifurcations, procedural worlds

I’m using pgfplots a lot, so I will share some examples today.

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.

## Lorenz attractor (dynamic system)

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} |

## Fractal landscapes – the base for producing procedural worlds

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.

## Feigenbaum diagram (bifurkations)

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.

## Iterated fractals

I recently dealt with Iterated function systems , in short IFS. Here we got repeated transformations: the space will be mapped onto itself. There can be different map specifications. We do this an infinite number of times and take a look at the set in space, which stays invariant. This can be a fractal object.

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.

## TeX Live 2014 released – what’s new

TeX Live 2014 has been released and is now available for download. Let’s have a look at the changes.

### TeX

TeX and MetaFont have been updated. This previously happened 2008, and this year Donald Knuth provided another update. Now we got TeX version 3.14159265, included in TeX Live 2014. Well, the slight changes are essentially invisible: regarding TeX, the only change concerns the “null control sequence”`\csname\endcsname`, there was a missing space. if somebody wants to try, with this code by Oleg Bulatov, 2008:

\def\\#1{\message{#1bar}} \def\surprise{wunder} \let\foo=! \\\surprise \\{\csname\endcsname} \end |

you will get a message on the terminal

wunderbar \csname\endcsnamebar |

where one would expect just wunderbar bar. Well, that’s fixed now in the `print_cs` routine! Very nice to see, that the last known TeX bug is so “serious”.

Also MetaFont has been updated to version 2.7182818, which means just a fix of one bug, also discovered in 2008. A classic – a memory leak.

The remaining things are maintainance work. You can read more details about this in Donald Knuth’s article “The TeX tuneup of 2014“.

### pdfTeX

“Fake spaces” have been introduced. The original TeX does not insert space characters between words. Instead, words and punctuation characters are positioned for optimal full justification without an explicit space character inbetween. This is very good for printing, however today we often read documents on electronic devices such as laptops, tablet computers and smart phones. They use different screen widths, even on the same device it can change when you rotate the device. Text should reflow on-the-fly. For this it’s better to have a space character as a word delimiter.

## LaTeX2e got an update

Today an update of LaTeX2e has been released on CTAN. The previous update dates back to June 27, 2011. LaTeX2e has been stable for a long time, there are mainly maintenance work and bug fixes.

- The package
`fixltx2e`got an update: loading the package fixes bugs and improves bad design decisions of previous versions of LaTeX. Such corrections were put into an extra package for backwards compatibility. From this version on, placement arguments for floats will be checked and in case of errors, such as a wrong v in`\begin{figure}[tv]`, an error message will be raised. Furthermore the behavior in case of mixing one- and twocolumn floats has been improved, to fix that it was possible that placement got out of sync. - There’s a new package with the name
`fltrace`: the original internal LaTeX code for placing floats has been extracted and information output has been added, which can be switched off and on, to analyze and to understand how LaTeX works when placing the floats.`\usepackage{fltrace}\tracefloats`activates it. - The
`inputenc`package has been improved: there were problems with the Unicode based engines XeTeX and LuaTeX, now it’s compatible with option`utf8`or`ascii`, it runs and just issues a warning. Other options, i.e. really incompatible input encodings, cause the compiler to stop with an error message. - .ins files, used to extract code files from source files, are now provided for single files instead of complete subfolders, making updates easier.
- The
`multicol`package got corrections and an extension: code can be run dependent on in which column we currently are. `tabularx`relaxes restrictions for using`\tabularx`and`\endtabularx`in the definition of new environments.`showkeys`got bug fixes for using at the beginning of list items and with grouping by curly braces within the optional argument of`\cite`.- The
`color`package now provides the command`\nopagecolor`. - In
`graphicx`the command`\rotatebox`now accepts arguments containing paragraph breaks done by`\par`or an empty line. - Also
`keyval`now can deal with`\par`and empty lines in values.

## Who want’s to have a TeX or LaTeX book of choice?

After a contest on LaTeX-Community.org ended without contributions, because probably most of us have the prize, the LaTeX Companion, already in the shelf, there’s a new idea. It’s for our very active German speaking TeX community.

**Which book would you like to have?**

Choose any TeX or LaTeX book and tell us on TeXwelt.de, and you are in the game. The winner will be, who posts the best questions.

Just the sum of votes decides. That’s simply and all readers choice. No Jury. No complaints. No cheating. We would see that.

In the new year the question votes will be counted and the winner will get the book of his or her choice.

Why for questions? Because posting good questions is *really* hard. Try and you will understand.

## LaTeX Reference in German available for free

At Lehmanns there’s now a LaTeX reference available for free, written by Herbert Voß, in German language:

http://www.lehmanns.de/latex-referenz

You can order it for free as a soft cover book, or download it as PDF file.

On 32 pages the reference lists the most important LaTeX environments and commands with syntax and meaning, and it contains a list of LaTeX counters and lengths.

DANTE members will automatically get it together with the next DTK.

*Originally posted on LaTeX-Community.org News*.