Event tip: TeX Users Group meeting 2016 Toronto

Early bird registration discount ends soon!

The TeX Users Group meeting 2016 will be in Toronto, July 25-27. There will be presentations about typesetting, fonts, tools, and more.

tuglogoUntil May 15 there’s a registration discount. That’s tomorrow! So there’s still the chance to register for less than the full price. In case you might miss it: I read in the fine print, that rates will increase after May 23, so there might be some further time to get that rate.

For students, no matter if member or not, there’s a significant discount: $100 instead of $350 (non student members). That’s an incredible offer, since the registration includes lunch on each day as well as morning and afternoon coffee breaks (breakfest usually included in the hotel fee).

Look at the program to see a list of presentation topics as of today. There you also can see how many people already registered from a lot of countries. You can find me there too, I plan to talk about TeX in industry.

Meet people from our TeX Users Group, that made TeX big, that provides the TeX Live software and ensures worldwide support!

Programming network switches and routers using TeX

I’m a network engineer, and a part of my job is configuring switches, routers and firewalls. I usually work with projects that have some thousands switches each: some core switches, server switches, many distribution switches, and a large amount of small access switches for users. I mainly make networks for cruise ships – just imagine a cruise ship with about 3000 passengers and 1000 crew: each cabin gets network access for IP-TV, IP telephone, air condition, programmable door lock, computer port. Not to forget let’s say 1000 WiFi access points, 300 CCTV cameras, cash machines, vending machines, office computers everywhere, even in the Spa, IP clocks, engine and nautical workstations, broadcast center and of cause redundant data centers with racks full of servers. For security reasons, there are hundreds of VLANs (virtual networks) in several (virtual) security domains.

How to configure and to manage all of this?

Let’s take a look at configurations:

Continue reading

Use rotating.sty for wide tables/figures

You can use the rotating package to automatically rotate wide figures or tables. It provides {sidewaystable}/{sidewaysfigure} as a alternatives for {table}/{figure} and rotates the environment content by 90°. The direction of the rotation can be set with package options clockwise or counterclockwise; if you set twoside as class or package option the tables/figures are rotated by extra 180° on odd pages.

PS: Use booktabs for a nicer styling of your tables 😉

Add a prefix to your labels

To keep track of (the target of) your labels you might want to add a prefix to their names indicating the thing they are referring to. E.g. sec for sections, eq for equations, fig for figures etc. It is common to separate the prefix with a colon from the label name like in the following example:

Then when you read your code you always know that \ref{sec:test} refers to a section.

In some cases the colon can cause troubles, e.g. when you type a french document with babel, varioref, hyperref and cleveref (see this and this post on TeX.SX for example). In that case you may use another character to separate the prefix.

scrpage2 is obsolete

With KOMA-Script version 3.12 the bundled package scrpage2 became obsolete and should no longer be used. Instead use the new package scrlayer-scrpage, which provides nearly the same interface but has much more power than scrpage2. For example with the new package instead of

you can use

to set the same mark content for plain and normal style pages. That is shorter and is more consistent: For instance if you have a more complex definition than \pagemark now there’s only one place to make changes.

For more details check the manual: scrguien.pdf (or the german version scrguide.pdf), chapter 5.

When changing font size don’t forget the \par

When you change the font size with commands like \Large inside a group you must end the paragraph either with a blank line or  \par before the group ends to get the right line spacing.

TeX always uses the baseline skip settings of the site active at the paragraph end, which is actually \normalsize in the first code.

Download a complete example from my website …

Crossing lines

Sometimes it’s not possible in diagrams or charts, that a line goes over another one. To not let this crossing look like a real connection of the two lines, we can let the top line go over a gap in the bottom line. It would require to calculate the intersection of the lines.

However, there’s an easy way: draw the firsts line normally, then draw the top line with a bit whitespace around. Or the top line first thicker and white (or background color), then again thin and black (foreground color).

The probably easiest way in TikZ is: draw a “double” line (TikZ manual, 15.3.4 Graphic Parameters: Double Lines and Bordered Lines). Originally, it gives two parallel lines with space in-between filled by a color. But we want to get a single line. Solution: a double line in white, the gap between them filled in black. This results in a black line with white space around.

Many words, short and simple code example:

This way, double distance is the width of the actual black line, while line width stands for the white space on each side.

Use it such as:

It can look like:

datacenter1

Or:

datacenter2

Flipping images

When I defined an image as a TikZ node, I easily create and use a flipped version: I define a mirror style that does a reflection for me:

As my original style was defined this way

I simply override the image style by adding the mirror style:

This way I can get a diagram with a focus to its center:

network-physical