Creating Free Software Magazine

The TeX side of the story

Download the whole article as PDF

Write a full post in response to this!


When I received the first email from Tony asking me to set up the typesetting subsystem for Free Software Magazine (FSM), I was proud… and terrified. I have spent the last six years of my life using LaTeX and, ultimately, TeX, to typeset single articles, songbooks, my thesis, CV’s, flyers, and letters. Even though my knowledge of the companion packages and classes was pretty good, the first thing I thought was: “How is it possible to compose a whole magazine, article by article, and at the same time build the table of contents (ToC) in the same way as the composition of books?” The problem is that every article has a title, a subtitle and one or more authors: all of this information has to be placed neatly in the ToC. Even after a bit of research, I was still wondering: “Will I be able to do a proper job?”

For the few readers who still don’t know what TeX and LaTeX are: TeX is a typesetting system **[1] **written by Donald E. Knuth, created to compose scientific books and papers. LaTeX is a macro package **[2] **based on TeX that was originally written by Leslie Lamport. It’s used to give a structure to the composition, and let the author concentrate on the paper’s content rather than the paper aspect.

When I received the first email from Tony asking me to set up the typesetting subsystem for Free Software Magazine (FSM), I was proud… and terrified

Of course, the first answer to every question about TeX can be found in the Comprehensive TeX Archive Network (CTAN) [3]. After a bit of research, I discovered that there was a class called journal, which included the class paper. Journal was written to accomplish something similar to what I was trying to do. However, we wanted to typeset a real magazine, and not a scientific journal; so, we needed quite a few additional features.

Following the LaTeX Project Public License [4], I renamed each of the classes to openjournal and openpaper (even if I didn’t plan on releasing them just yet). Well, the foundations were there: at that time we were able to compose the magazine, even if it wasn’t as fancy-looking as the average reader might expect.

In order to figure out which elements were required to compose a single paper (or article), Tony provided me with a sample xml file, containing all such elements. Some of these elements raised my eyebrows: zoom, and textbox; and then there were the more typical: figure, table, author, and title.

While some of them had a direct correspondence in LaTeX, others were more specific.

Well, at that point Tony received my answer (a brave “I think I can do it!”), and my part of this adventure started.

Organising the work

The journal class did a very good job creating the article’s basic layout, but it wasn’t enough for our goals. We wanted to create a magazine, not a journal; so our contents needed to be presented seriously and in colour, typographically speaking. I arranged a set of colours to characterise the elements of FSM, and programmed the class to use them.

I then had to choose a set of fonts to typeset the text. I chose the AvantGarde font as the sans serif. A serif is the light line or stroke projecting from the ends of the main stroke of a Roman character letter; a sans serif font is a font without serifs. The related package defines which font to use as the serif font and which font to use as the typewriter (TeX defines this as teletype, or tt) font.

It was time to organise the layout. I wanted a double column page, with a single-column title for every article. I also wanted footers and headers with information about:

  • the page number
  • the name, year and issue number of the magazine
  • the section’s name
  • the article title
  • and the author’s name

First, I started working on the columns. A characteristic of LaTeX is that:

Sure, compared to your off-the-shelf MS Word page, it looks awfully narrow. But take a look at your favourite book and count the number of characters on a standard text line. You will find that there are no more than about 66 characters on each line. [5]

I believed that it would be better for us not to have wide empty spaces around the actual text. So, I modified the dimensions of the page, while not changing the dimensions of the paper (DIN A4).

I gave Tony feedback allowing him to write the converter from XML tags to LaTeX commands and environments

That was the easier stage of the job, accomplished by modestly tweaking the class’ code.

At that point, I gave Tony some feedback allowing him to write the converter, which would translate the articles from XML into LaTeX. I arranged a document, which explained the correspondence of each XML tag with its LaTeX equivalent. While Tony wrote the finite state automaton that performed the conversion, I programmed the commands to put the text-boxes, the zooms, and the author’s biography on the page. I also wrote some code to implement a floating box for the listings, but in the end we decided not to use it.

Typesetting the magazine

When Tony had finished programming the converter, I carried on programming in TeX to add features to the LaTeX class.

The ToC

I didn’t think that the ToC as written by the paper class was appropriate for Free Software Magazine.

The Table of Contents as typeset by journal (on the left) and by openjournal (on the right)
The Table of Contents as typeset by journal (on the left) and by openjournal (on the right)

The main problem was that FSM had different sections: Focus, Tech world (technical articles), and Word world (non-technical articles). The section name was embedded in every article.

We didn’t want the section name to be repeated after the name of every article in the ToC

When rendering the ToC, we wanted the sections’ names to appear only once, before the articles, which were part of that section. However, when the class was instructed to write the section name before a paper entry in the ToC, it was repeated for every article.

To solve this problem I wrote a little function to count how many times a section name was read consecutively: only the first time that string was used would it actually be printed in the ToC.

The zooms

Another command involved the arrangement of the zooms (or “callouts”). The zooms are short sentences, which appear in bigger font within the article. They are important as they make composition possible: they allow the article’s length to be adjusted as needed, without changing its content. I wrote this command so that it placed the “zoomed text” where it is issued, without any automatic positioning.

A**nother “pretty” feature of published magazines is the “big character” starting an article (also called the _drop cap_)**

The paragraph start

Another “pretty” feature of published magazines is the “big character” starting an article (also called the drop cap). The first code I ever used to typeset this feature was that contained in the class IEEEtran. I changed the size of the font (four rows instead of two), as well as its colour and the font family: the original class used Times Roman as a replacement of Computer Modern Roman; our class used the AvantGarde sans serif font for issue 0 of FSM. I believed the code worked pretty well, but using it here was impossible due to several problems:

  • The “drop cap” character varied greatly in size, which was not acceptable
  • The rest of the word was placed in the wrong position, that is to say too close to, or too far from, the drop cap.

The author of the IEEEtran class tried to accomplish the IEEE transactions style, which says that the first word is all uppercase; this prevents the first problem, as will soon be clarified.

A miscellany of paragraph starting character problems
A miscellany of paragraph starting character problems

Let’s examine the problem in more detail (see the figure). The ‘T’ and the ‘M’ are slightly taller than the ‘I’; and the ‘A’ is shorter than the ‘I’. Why this strange behaviour? The dimension of the drop cap was calculated according to the height of the article’s first word.

Don't miss out on the other pages!
12next ›last »

Write a full post in response to this!

Similar articles

1

Do you like this post?
Vote for it!

Copyright information

This article is made available under the "Attribution-NonCommercial-NoDerivs" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-nc-nd/3.0/.

Biography

Gianluca Pignalberi: Gianluca is Free Software Magazine's Compositor.

luc.taesch's picture

woo !

Submitted by luc.taesch on Wed, 2007-10-31 10:38.

Vote!
0

this is juste terrific .. we are very far from the classical stern look from latex, still with its precissness of latex.. are these classes available somewhere ? ( they deserve it !)

Gianluca Pignalberi's picture

eh eh :)

Submitted by Gianluca Pignalberi on Wed, 2008-01-09 20:08.

Vote!
0

Hi Luc,
please, do send me an email, and I'll send you back our starter's kit. Unfortunately I've got no time to release our classes as they deserve ;)
And, of course, forgive me for answering so late.

luc.taesch's picture

Gianluca

Submitted by luc.taesch on Mon, 2008-01-14 10:16.

Vote!
0

Gianluca, I do not know where to find your email. can you help ?
any private message on this forum ?

Gianluca Pignalberi's picture

Email

Submitted by Gianluca Pignalberi on Wed, 2008-01-23 20:03.

Vote!
0

g.pignalberi ---@t--- free...com
Obvliously, remove " ---t--- " and fill the blanks with our magazine's complete name. Bye.