| 1 |
% Copyright 2016 The LaTeX3 Project |
| 2 |
\documentclass{ltnews} |
| 3 |
|
| 4 |
\PassOptionsToPackage{colorlinks}{hyperref} |
| 5 |
|
| 6 |
\usepackage{csquotes} |
| 7 |
\usepackage{hologo} |
| 8 |
\usepackage{ragged2e} |
| 9 |
\usepackage{underscore} |
| 10 |
|
| 11 |
\AtBeginDocument{% |
| 12 |
\renewcommand*{\LaTeXNews}{\LaTeX3~News}% |
| 13 |
\RaggedRight |
| 14 |
\setlength\parindent{1em}% |
| 15 |
} |
| 16 |
|
| 17 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 18 |
|
| 19 |
\publicationmonth{November} |
| 20 |
\publicationyear{2016} |
| 21 |
\publicationissue{10} |
| 22 |
|
| 23 |
% Avoid hyphenation of csnames |
| 24 |
\makeatletter |
| 25 |
\protected\edef\cs#1{% |
| 26 |
\noexpand\path{\@backslashchar#1}% |
| 27 |
} |
| 28 |
\makeatother |
| 29 |
|
| 30 |
\begin{document} |
| 31 |
|
| 32 |
\maketitle |
| 33 |
|
| 34 |
There has been something of a gap since the last \LaTeX3 News, but this does |
| 35 |
not mean that work has not been going on. The Team have been working on a |
| 36 |
number of areas, many of which reflect wider take-up of \pkg{expl3}. There have |
| 37 |
also been a number of significant new developments in the \LaTeX3 |
| 38 |
\enquote{sphere} in the last two years. |
| 39 |
|
| 40 |
\section{\pkg{l3build}: Testing \LaTeX{} packages} |
| 41 |
|
| 42 |
Testing has been an important part of the work of the team since they assumed |
| 43 |
maintenance of \LaTeX{} over twenty years ago. Various scripts have been used |
| 44 |
over that time by the team for testing, but these have until recently not been |
| 45 |
set up for wider use. |
| 46 |
|
| 47 |
With the general availability of \hologo{LuaTeX} it is now possible to be sure |
| 48 |
that every \TeX{} user has a powerful general scripting language available: |
| 49 |
Lua. The team have used this to create a new general testing system for \TeX{} |
| 50 |
code, \pkg{l3build}. This \emph{is} designed to be used beyond the team, so is |
| 51 |
now available in \TeX{} Live and \hologo{MiKTeX} and is fully documented. |
| 52 |
Testing using \pkg{l3build} makes use of a normalised version of the |
| 53 |
\texttt{.log} file, so can test any aspect of \TeX{} output (e.g., by using |
| 54 |
\cs{showbox}) or its algorithms (by displaying results in the \texttt{.log}). |
| 55 |
|
| 56 |
Part of the remit for creating \pkg{l3build} was to enable the team to work |
| 57 |
truly cross-platform and to allow testing using multiple \TeX{} engines |
| 58 |
(earlier systems were limited to a single engine, normally \eTeX{}). The new |
| 59 |
testing system means we are in a much stronger position to support a variety of |
| 60 |
engines (see below). It has also enabled us to give useful feedback on |
| 61 |
development of the \hologo{LuaTeX} engine. |
| 62 |
|
| 63 |
As well as the core capability in testing, \pkg{l3build} also provides a |
| 64 |
\enquote{one stop} script for creating release bundles. The script is |
| 65 |
sufficiently flexible that for many common \LaTeX{} package structures, setting |
| 66 |
up for creating releases will require only a few lines of configuration. |
| 67 |
|
| 68 |
In addition to the documentation distributed with \pkg{l3build}, the project |
| 69 |
website~\cite[publications in 2014]{10:project-publications} contains some |
| 70 |
articles, videos and conference presentations that explain how to use |
| 71 |
\pkg{l3build} to manage and test any type of (\LaTeX{}) package. |
| 72 |
|
| 73 |
\section{Automating \pkg{expl3} testing} |
| 74 |
|
| 75 |
As well as developing \pkg{l3build} for local use, the team have also set up |
| 76 |
integration testing for \pkg{expl3} using the Travis-CI system. This means that |
| 77 |
\emph{every} commit to the \LaTeX3 code base now results in a full set of tests |
| 78 |
being run. This has allowed us to significantly reduce the number of occasions |
| 79 |
where \pkg{expl3} needs attention before being released to CTAN. |
| 80 |
|
| 81 |
Automated testing has also enabled us to check that \pkg{expl3} updates do not |
| 82 |
break a number of key third-party packages which use the programming |
| 83 |
environment. |
| 84 |
|
| 85 |
\section{Refining \pkg{expl3}} |
| 86 |
|
| 87 |
Work continues to improve \pkg{expl3} both in scope and robustness. Increased |
| 88 |
use of the programming environment means that code which has to-date been |
| 89 |
under-explored is being used, and this sometimes requires changes to the code. |
| 90 |
|
| 91 |
The team have extended formal support in \pkg{expl3} to cover the engines |
| 92 |
p\TeX{} and up\TeX{}, principally used by Japanese \TeX{} users. This has been |
| 93 |
possible in part due to the \pkg{l3build} system discussed above. |
| 94 |
Engine-dependent variations between \hologo{pdfTeX}, \hologo{XeTeX}, |
| 95 |
\hologo{LuaTeX} and (u)p\TeX{} are now well-understood and documented. As part |
| 96 |
of this process, the \enquote{low-level} part of \pkg{expl3}, which saves all |
| 97 |
primitives, now covers essentially all primitives found in all of these |
| 98 |
engines. |
| 99 |
|
| 100 |
The code in \pkg{expl3} is now entirely self-contained, loading no other |
| 101 |
third-party packages, and can also be loaded as a generic package with plain |
| 102 |
\TeX{}, etc. These changes make it much easier to diagnose problems and |
| 103 |
make \pkg{expl3} more useful. In particular it can be used as a programming |
| 104 |
language for generic packages, that then can run without modifications under |
| 105 |
different formats! |
| 106 |
|
| 107 |
The team have made a range of small refinements to both internals and |
| 108 |
\pkg{expl3} interfaces. Internal self-consistency has also been improved, for |
| 109 |
example removing almost all use of \texttt{nopar} functions. Performance |
| 110 |
enhancements to the \pkg{l3keys} part of \pkg{expl3} are ongoing and should |
| 111 |
result in significantly faster key setting. As keyval methods are increasingly |
| 112 |
widely used in defining behaviours, this will have an impact on compile times |
| 113 |
for end users. |
| 114 |
|
| 115 |
\section{Replacing \cs{lowercase} and \cs{uppercase}} |
| 116 |
|
| 117 |
As discussed in the last \LaTeX3 News, the team have for some time been keen to |
| 118 |
provide new interfaces which do not directly expose (or in some cases even use) |
| 119 |
the \TeX{} primitives \cs{lowercase} and \cs{uppercase}. We have now created a |
| 120 |
series of different interfaces that provide support for the different |
| 121 |
conceptual uses which may flow from the primitives: |
| 122 |
\begin{itemize} |
| 123 |
\item For case changing text, \cs{tl_upper_case:n}, \cs{tl_lower_case:n}, |
| 124 |
\cs{tl_mixed_case:n} and related language-aware functions. These are |
| 125 |
Unicode-capable and designed for working with text. They also allow for |
| 126 |
accents, expansion of stored text and leaving math mode unchanged. At |
| 127 |
present some of the interface decisions are not finalised so they are |
| 128 |
marked as experimental, but the team expect the core concept to be stable. |
| 129 |
\item For case changing programming strings, \cs{str_upper_case:n}, |
| 130 |
\cs{str_lower_case:n} and \cs{str_fold_case:n}. Again these are |
| 131 |
Unicode-aware, but in contrast to the functions for text are not |
| 132 |
context-dependent. They are intended for caseless comparisons, constructing |
| 133 |
command names on-the-fly and so forth. |
| 134 |
\item For creating arbitrary character tokens, \cs{char_generate:nn}. This |
| 135 |
is based on the \cs{Ucharcat} primitive introduced by \hologo{XeTeX}, but |
| 136 |
with the ideas extended to other engines. This function can be used to |
| 137 |
create almost any reasonable token. |
| 138 |
\item For defining active characters, \cs{char_set_active_eq:NN} and |
| 139 |
related functions. The concept here is that active characters should be |
| 140 |
equivalent to some named function, so one does not directly define the |
| 141 |
active character. |
| 142 |
\end{itemize} |
| 143 |
|
| 144 |
\section{Extending \pkg{xparse}} |
| 145 |
|
| 146 |
After discussions at TUG2015 and some experimentation, the team have added a |
| 147 |
new argument type, \texttt{e} (\enquote{embellishment}), to \pkg{xparse}. |
| 148 |
This allows arguments similar to |
| 149 |
\TeX{} primitive sub- and superscripts to be accepted. Thus |
| 150 |
\begin{verbatim} |
| 151 |
\DeclareDocumentCommand\foo{e{^_}} |
| 152 |
{\showtokens{"#1"}} |
| 153 |
\foo^{Hello} world |
| 154 |
\end{verbatim} |
| 155 |
will show |
| 156 |
\begin{verbatim} |
| 157 |
"{Hello}{-NoValue-}". |
| 158 |
\end{verbatim} |
| 159 |
|
| 160 |
At present, this argument type is experimental: there are a number of models |
| 161 |
which may make sense for this interface. |
| 162 |
|
| 163 |
\section{A new \cs{parshape} model} |
| 164 |
|
| 165 |
As part of development of \pkg{l3galley}, Joseph Wright has proposed a new |
| 166 |
model for splitting up the functions of the \cs{parshape} primitive into three |
| 167 |
logical elements: |
| 168 |
\begin{itemize} |
| 169 |
\item Margins between the edges of the galley and the paragraph (for example |
| 170 |
an indented block); |
| 171 |
\item Cut-out sections running over a fixed number of lines, to support |
| 172 |
\enquote{in place} figures and so forth; |
| 173 |
\item Running or single-paragraph shape. |
| 174 |
\end{itemize} |
| 175 |
|
| 176 |
There are additional elements to consider here, for example whether lines are |
| 177 |
the best way to model the length of shaping, how to handle headings, cut-outs |
| 178 |
at page breaks, etc. |
| 179 |
|
| 180 |
|
| 181 |
\section{Globally optimized pagination of documents} |
| 182 |
|
| 183 |
Throughout 2016 Frank Mittelbach has worked on methods and algorithms for |
| 184 |
globally optimizing the pagination of documents including those that contain |
| 185 |
floats. Early research results have been presented at Bacho\TeX{} 2016, TUG |
| 186 |
2016 in Toronto and later in the year at \mbox{DocEng'16}, the ACM Symposium on |
| 187 |
Document Engineering in Vienna. A link to the ACM paper (that allows a download |
| 188 |
free of charge) can be found on the project |
| 189 |
website~\cite{10:project-publications}. The site also holds the speaker notes from |
| 190 |
Toronto and will host a link to a video of the presentation once it becomes |
| 191 |
available. |
| 192 |
|
| 193 |
The framework developed by Frank is based on the extended functionality |
| 194 |
provided by \hologo{LuaTeX}, in particular its callback functions that allow |
| 195 |
interacting with the typesetting process at various points. The algorithm that |
| 196 |
determines the optimal pagination of a given document is implemented in {Lua} |
| 197 |
and its results are then used to direct the formatting done by the \TeX{} |
| 198 |
engine. |
| 199 |
|
| 200 |
At the current point in time this a working prototype but not yet anywhere near |
| 201 |
a production-ready system. However, the work so far shows great potential and |
| 202 |
Frank is fairly confident that it will eventually become a generally usable |
| 203 |
solution. |
| 204 |
|
| 205 |
\section{Looking forward} |
| 206 |
|
| 207 |
The \hologo{LuaTeX} engine has recently reached version~1.0. This may presage a |
| 208 |
stable \hologo{LuaTeX} and is likely to result in wider use of this engine in |
| 209 |
production documents.If that happens we expect to implement some of the more |
| 210 |
complex functionality (such as complex pagination requirements and models) only |
| 211 |
for \hologo{LuaTeX}. |
| 212 |
|
| 213 |
\begin{thebibliography}{10} |
| 214 |
\raggedright |
| 215 |
\bibitem{10:project-publications} |
| 216 |
Links to various publications by members of the \LaTeX{} Project Team. |
| 217 |
\newblock \url{https://www.latex-project.org/publications}. |
| 218 |
\end{thebibliography} |
| 219 |
|
| 220 |
\end{document} |