LATEX3 News
Issue 3, January 2010

Happy New Year
Welcome to the holiday season edition of ‘news of ouractivities’ for the LATEX3 team.

Recent developments
The last six months has seen two significant releases
in the LATEX3 code. In the ctan repository for thexpackages,1 you’ll find two items of interest:• A revised version of xparse; and• The new package xtemplate, a re-implementation oftemplate with a new syntax.
Special thanks to Joseph Wright who handled the implementations above almost single-handedly (with lotsof input and feedback from other members of the teamand members of the latex-l mailing list).
These two packages are designed for the LATEX
package author who wishes to define document commands and designer interfaces in a high-level manner.
xparse This package allows complex document commands to be constructed with all sorts of optional
arguments and flags. Think of how \newcommand allows you to create a command with a single optional
argument and xparse is a generalisation of that idea.
xtemplate This package requires more explanation.
Xtemplate is designed to separate the logical information in a document from its visual representation.
‘Templates’ are constructed to fulfil individual typesetting requirements for each set of arguments; to change
the look of a certain part of a document, instantiationsof templates can be swapped out for another without(a) having to change the markup of the source document, or (b) having to edit some internal LATEX macro.
LATEX 2ε packages, such as geometry or titlesec, already provide parameterized interfaces to specific document elements. For example, one may use titlesec tochange the layout of a \section: one modifies its layout parameters via \titleformat and \titlespacing.
In a way, such packages define a template for a specificdocument element and some manipulation commands
to instantiate it. However, the moment the intended
1 http://mirror.ctan.org/tex-archive/macros/latex/
contrib/xpackages/

layout is not achievable with one package you are on
your own: either you have to resort to low-level programming or find some other high-level package which,of course, comes with its own set of conventions andmanipulation commands.
The xtemplate package can be thought of a generalization of such ideas. It provides a uniform interface
for defining and managing templates for any kind ofdocument element and most importantly provides auniform interface for instantiating the layout.
Thus the designer activity of defining or modifying
a document class is limited to selecting the document
elements that should be provided by the class (e.g.,\chapter, \section \footnote, lists, . . . ), selecting
appropriate “named” templates for each of them, andinstantiating these templates by specifying values fortheir layout parameters. If a desired layout can’t beachieved with a given template a different template forthe same document element can be selected.
Programming is only necessary if no suitable template for the intended layout is available. It is then thata LATEX programmer has to build a new template that
supports the layout requirements. Once this task iscomplete, the template may be added to the selectionof templates that designers and users may choose fromto define or adjust document layouts seamlessly.
This is a slight gloss over the complexities of thepackage itself, which you can read about in the documentation. We’ve tried to document xtemplate clearly
but we’d love feedback on whether the ideas make sense
to you.
As an addendum to the introduction of xtemplate,the older template package will be retired in the near
future. To our knowledge there is only a single package
on ctan that uses template, namely xfrac, and membersof the LATEX team are in the process of switching thispackage over to xtemplate. If you have any private codethat uses template, please let us know!

Upcoming plansHaving announced the updated xparse and the new
xtemplate, the next stage of development will revolvearound using these two systems in the other components of the xpackages, feeding back our experience inpractise with the original ideas behind the designs andevaluating if the packages are meeting our expectations.

LATEX3 News, and the LATEX software, are brought to you by the LATEX3 Project Team; Copyright 2010, all rights reserved.

Packages to tackle
xhead The first work will be to create a new xpackage(probably called xhead), for typesetting section headings and other document divisions. Section headings
are one of the more complex areas to work with, so
the work should stress xtemplate enough to know if
its current design is sufficient for most needs. Nothinghas been released yet, but we’ll announce further developments on the latex-l mailing list2 in the meantime.
galley We also need to give galley the same treatment
as xparse and xtemplate have already had. That is, wehave an older implementation (in fact two) that needssome work before we’re ready to release it to ctan.
The galley package is used to place material into thevertical list while typesetting but before page breaks
occur. Since it works at such a low level, it is important to solidify this package before writing higher level
design templates.
An issue we have to face is that to achieve best results, galley cannot be used in concert with LATEX 2εcode. This could limit its usefulness, and we may decide that it’s better to scale back the features we’reattempting, to allow better interoperability for existing
packages and documents. More work remains before wecan decide between these options.

2 For details, see http://www.latex-project.org/code.html