summaryrefslogtreecommitdiff
path: root/macros/latex/required/l3kernel/l3news03.tex
blob: e3e245f051f50fc30415fd46b2da7db330305e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
% Copyright 2009,2010 The LaTeX Project
\documentclass{ltnews}
\PassOptionsToPackage{colorlinks}{hyperref}

\usepackage{metalogo,ragged2e}

\AtBeginDocument{
  \renewcommand{\LaTeXNews}{\LaTeX3~News}
  \RaggedRight
}

\usepackage{url}

\publicationmonth{January}
\publicationyear{2010}
\publicationissue{3}

\begin{document}
\maketitle
\raisefirstsection

\section{Happy New Year}

Welcome to the holiday season edition of `news of our activities' for
the \LaTeX3 team.

\section{Recent developments}

The last six months has seen two significant releases in the \LaTeX3 code.
In the \textsc{ctan} repository for the \pkg{xpackages},\footnote{\url{http://mirror.ctan.org/tex-archive/macros/latex/contrib/xpackages/}} you'll find two items of interest:
\begin{itemize}
\item A revised version of \textsf{xparse}; and
\item The new package \textsf{xtemplate}, a re-implementation of \textsf{template} with a new syntax.
\end{itemize}
Special thanks to Joseph Wright who handled the implementations above almost single-handedly (with lots of input and feedback from other members of the team and members of the \textsc{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.

\paragraph{\textsf{xparse}}
This package allows complex document commands to be constructed with all sorts of optional arguments and flags. Think of how \verb|\newcommand| allows you to create a command with a single optional argument and \textsf{xparse} is a generalisation of that idea.

\paragraph{\textsf{xtemplate}}
This package requires more explanation.
\textsf{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, instantiations of 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.


\LaTeXe{} packages, such as \textsf{geometry} or \textsf{titlesec}, already provide
parameterized interfaces to specific document elements.  For example,
one may use \textsf{titlesec} to change the
layout of a \verb|\section|: one modifies its layout parameters via \verb|\titleformat| and \verb|\titlespacing|.
In a way, such packages define a template for a specific document element and
some manipulation commands to instantiate it.
\pagebreak
However, the moment the intended
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 and manipulation commands.

The \textsf{xtemplate} package can be thought of a generalization of such
ideas. It provides a uniform interface for defining and managing templates for
any kind of document element and most importantly provides a uniform 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., \verb|\chapter|, \verb|\section| \verb|\footnote|, lists, \ldots), selecting
appropriate ``named'' templates for each of them, and instantiating these
templates by specifying values for their layout parameters. If a desired
layout can't be achieved with a given template a different template for the
same document element can be selected.

Programming is only necessary
if no suitable template for the intended layout is available.
It is then that a \LaTeX{} programmer has to build a new template
that supports the layout requirements. Once this task is complete, the
template may be
added to the selection of templates that designers and users may choose from
to define or adjust document layouts seamlessly.

This is a slight gloss over the complexities of the package itself, which you can read about in the documentation. We've tried to document \textsf{xtemplate} clearly but we'd love feedback on whether the ideas make sense to you.

As an addendum to the introduction of \textsf{xtemplate}, the older \textsf{template} package will be retired in the near future. To our knowledge there is only a single package on \textsc{ctan} that uses \textsf{template}, namely \textsf{xfrac}, and members of the \LaTeX\ team are in the process of switching this package over to \textsf{xtemplate}. If you have any private code that uses \textsf{template}, please let us know!


\section{Upcoming plans}

Having announced the updated \textsf{xparse} and the new \textsf{xtemplate}, the next stage of development will revolve around using these two systems in the other components of the \textsf{xpackages}, feeding back our experience in practise with the original ideas behind the designs and evaluating if the packages are meeting our expectations.

\subsection{Packages to tackle}

\paragraph{\textsf{xhead}}
The first work will be to create a new \textsf{xpackage} (probably called \textsf{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 \textsf{xtemplate} enough to know if its
current design is sufficient for most needs.  Nothing has been
released yet, but we'll announce further developments on the
\textsc{latex-l} mailing
list\footnote{For details, see
  \url{http://www.latex-project.org/code.html}} in the
mean time.


\paragraph{\textsf{galley}}
We also need to give \textsf{galley} the same treatment as
\textsf{xparse} and \textsf{xtemplate} have already had. That is, we have an
older implementation (in fact two) that needs some work before we're ready to release it to \textsc{ctan}.

The \textsf{galley} package is used to place material into the
vertical 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,
\textsf{galley} cannot be used in concert with \LaTeXe\ code.  This
could limit its usefulness, and we may decide that it's better to
scale back the features we're attempting, to allow better
interoperability for existing packages and documents.  More work
remains before we can decide between these options.


\end{document}