"\ExplSyntaxOff"
% \end{syntax}
% Issues a catcode regime where spaces are ignored and colon and
% underscore are letters.
% \end{function}
%
% \begin{function}{
% l3names |
% \ProvidesExplPackage |
% \ProvidesExplClass
% }
% \begin{syntax}
% "\RequirePackage{l3names}" \\
% "\ProvidesExplPackage" "{""}"
% "{""}" "{""}" "{""}"
% \end{syntax}
% The package "l3names" (this module) provides
% "\ProvidesExplPackage" which is a wrapper for "\ProvidesPackage"
% and sets up the \LaTeX3 catcode settings for programming
% automatically. Similar for the relationship between
% "\ProvidesExplClass" and "\ProvidesClass". Spaces are not ignored
% in the arguments of these commands.
% \end{function}
%
% \begin{function}{
% \GetIdInfo |
% \filename |
% \filenameext |
% \filedate |
% \fileversion |
% \filetimestamp |
% \fileauthor
% }
% \begin{syntax}
% "\RequirePackage{l3names}" \\
% "\GetIdInfo" "$Id:" "$" "{""}"
% \end{syntax}
% Extracts all information from a cvs or svn field. Spaces are not
% ignored in these fields. The information pieces are stored in
% separate control sequences with "\filename" for the part of the
% file name leading up to the period, "\filenameext" for the
% extension, "\filedate" for date, "\fileversion" for version,
% "\filetimestamp" for the time and "\fileauthor" for the author.
% \end{function}
%
% To summarize: Every single package using this syntax should identify
% itself using one of the above methods. Special care is taken so that
% every package or class file loaded with "\RequirePackage" or alike
% are loaded with usual \LaTeX\ catcodes and the \LaTeX3 catcode
% scheme is reloaded when needed afterwards. See implementation for
% details. If you use the "\GetIdInfo" command you can use the
% information when loading a package with
% \begin{verbatim}
% \ProvidesExplPackage{\filename}{\filedate}{\fileversion}{\filedescription}
% \end{verbatim}
%
%
%
%
% \StopEventually{}
%
% \section{Starters}
%
% This is the base part of \LaTeX3 defining things like |catcode|s
% and redefining the \TeX{} primitives.
%
% We start by setting up |\catcode|s that we need to define new
% commands. These are the ones for begin-group and end-group
% characters.\footnote{Well not needed while this file is running
% as a package on top of \LaTeXe, so omitted from the package code}
% \begin{macrocode}
%<*initex>
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 %
\catcode`\^^I=10 % ascii tab is a blank space
%
% \end{macrocode}
% Reason for |\endlinechar=32| is that a line ending with a backslash
% will be interpreted as the token \verb*|\ | which seems most natural
% and since spaces are ignored it works as we intend elsewhere.
% \begin{macrocode}
%<*initex|package>
\catcode126=10\relax % tilde is a space char.
\catcode32=9\relax % space is ignored
\catcode9=9\relax % tab also ignored
\endlinechar=32\relax % endline is space
\catcode95=11\relax % underscore letter
\catcode58=11\relax % colon letter
% \end{macrocode}
%
%
% \section{Setting up primitive names}
%
% Here is the function that renames \TeX{}'s primitives.
%
% Normally the old name is left untouched, but the possibility of
% undefining the original names is made available by docstrip and
% package options.
% If nothing else, this gives a way of checking what `old code' a
% package depends on\ldots\
%
% If the package option `removeoldnames' is used then some trick code
% is run after the end of this file, to skip past the code which has
% been inserted by \LaTeXe\ to manage the file name stack, this code
% would break if run once the \TeX\ primitives have been undefined.
% (What a surprise!) \textbf{The option has been temporarily
% disabled.}
%
% To get things started, give a new name for |\let|.
% \begin{macrocode}
\let\tex_let:D\let
%
% \end{macrocode}
%
% and now an internal function to possibly
% remove the old name.
%
% \begin{macrocode}
%<*initex>
\long\def\name_undefine:N#1{
\tex_let:D#1\c_undefined}
%
% \end{macrocode}
%
% \begin{macrocode}
%<*package>
\DeclareOption{removeoldnames}{
\long\def\name_undefine:N#1{
\tex_let:D#1\c_undefined}}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption{keepoldnames}{
\long\def\name_undefine:N#1{}}
% \end{macrocode}
%
% \begin{macrocode}
\ExecuteOptions{keepoldnames}
% \end{macrocode}
%
% \begin{macrocode}
\ProcessOptions
%
% \end{macrocode}
%
% The internal function to give the new name and possibly undefine
% the old name.
% \begin{macrocode}
%<*initex|package>
\long\def\name_primitive:NN#1#2{
\tex_let:D #2 #1
\name_undefine:N #1
}
% \end{macrocode}
%
% \subsection{Assignments}
%
% In the current incarnation of this package, all \TeX\ primitives
% are given a new name of the form |\tex_|\emph{oldname}|:D|.
% But first three special cases which have symbolic original names.
% These are given modified new names, so that they may be entered
% without catcode tricks.
% \begin{macrocode}
\name_primitive:NN \ \tex_space:D
\name_primitive:NN \/ \tex_italiccor:D
\name_primitive:NN \- \tex_hyphen:D
% \end{macrocode}
%
% Now all the other primitives.
% \begin{macrocode}
\name_primitive:NN \let \tex_let:D
\name_primitive:NN \def \tex_def:D
\name_primitive:NN \edef \tex_edef:D
\name_primitive:NN \gdef \tex_gdef:D
\name_primitive:NN \xdef \tex_xdef:D
\name_primitive:NN \chardef \tex_chardef:D
\name_primitive:NN \countdef \tex_countdef:D
\name_primitive:NN \dimendef \tex_dimendef:D
\name_primitive:NN \skipdef \tex_skipdef:D
\name_primitive:NN \muskipdef \tex_muskipdef:D
\name_primitive:NN \mathchardef \tex_mathchardef:D
\name_primitive:NN \toksdef \tex_toksdef:D
\name_primitive:NN \futurelet \tex_futurelet:D
\name_primitive:NN \advance \tex_advance:D
\name_primitive:NN \divide \tex_divide:D
\name_primitive:NN \multiply \tex_multiply:D
\name_primitive:NN \font \tex_font:D
\name_primitive:NN \fam \tex_fam:D
\name_primitive:NN \global \tex_global:D
\name_primitive:NN \long \tex_long:D
\name_primitive:NN \outer \tex_outer:D
\name_primitive:NN \setlanguage \tex_setlanguage:D
\name_primitive:NN \globaldefs \tex_globaldefs:D
\name_primitive:NN \afterassignment \tex_afterassignment:D
\name_primitive:NN \aftergroup \tex_aftergroup:D
\name_primitive:NN \expandafter \tex_expandafter:D
\name_primitive:NN \noexpand \tex_noexpand:D
\name_primitive:NN \begingroup \tex_begingroup:D
\name_primitive:NN \endgroup \tex_endgroup:D
\name_primitive:NN \halign \tex_halign:D
\name_primitive:NN \valign \tex_valign:D
\name_primitive:NN \cr \tex_cr:D
\name_primitive:NN \crcr \tex_crcr:D
\name_primitive:NN \noalign \tex_noalign:D
\name_primitive:NN \omit \tex_omit:D
\name_primitive:NN \span \tex_span:D
\name_primitive:NN \tabskip \tex_tabskip:D
\name_primitive:NN \everycr \tex_everycr:D
\name_primitive:NN \if \tex_if:D
\name_primitive:NN \ifcase \tex_ifcase:D
\name_primitive:NN \ifcat \tex_ifcat:D
\name_primitive:NN \ifnum \tex_ifnum:D
\name_primitive:NN \ifodd \tex_ifodd:D
\name_primitive:NN \ifdim \tex_ifdim:D
\name_primitive:NN \ifeof \tex_ifeof:D
\name_primitive:NN \ifhbox \tex_ifhbox:D
\name_primitive:NN \ifvbox \tex_ifvbox:D
\name_primitive:NN \ifvoid \tex_ifvoid:D
\name_primitive:NN \ifx \tex_ifx:D
\name_primitive:NN \iffalse \tex_iffalse:D
\name_primitive:NN \iftrue \tex_iftrue:D
\name_primitive:NN \ifhmode \tex_ifhmode:D
\name_primitive:NN \ifmmode \tex_ifmmode:D
\name_primitive:NN \ifvmode \tex_ifvmode:D
\name_primitive:NN \ifinner \tex_ifinner:D
\name_primitive:NN \else \tex_else:D
\name_primitive:NN \fi \tex_fi:D
\name_primitive:NN \or \tex_or:D
\name_primitive:NN \immediate \tex_immediate:D
\name_primitive:NN \closeout \tex_closeout:D
\name_primitive:NN \openin \tex_openin:D
\name_primitive:NN \openout \tex_openout:D
\name_primitive:NN \read \tex_read:D
\name_primitive:NN \write \tex_write:D
\name_primitive:NN \closein \tex_closein:D
\name_primitive:NN \newlinechar \tex_newlinechar:D
\name_primitive:NN \input \tex_input:D
\name_primitive:NN \endinput \tex_endinput:D
\name_primitive:NN \inputlineno \tex_inputlineno:D
\name_primitive:NN \errmessage \tex_errmessage:D
\name_primitive:NN \message \tex_message:D
\name_primitive:NN \show \tex_show:D
\name_primitive:NN \showthe \tex_showthe:D
\name_primitive:NN \showbox \tex_showbox:D
\name_primitive:NN \showlists \tex_showlists:D
\name_primitive:NN \errhelp \tex_errhelp:D
\name_primitive:NN \errorcontextlines \tex_errorcontextlines:D
\name_primitive:NN \tracingcommands \tex_tracingcommands:D
\name_primitive:NN \tracinglostchars \tex_tracinglostchars:D
\name_primitive:NN \tracingmacros \tex_tracingmacros:D
\name_primitive:NN \tracingonline \tex_tracingonline:D
\name_primitive:NN \tracingoutput \tex_tracingoutput:D
\name_primitive:NN \tracingpages \tex_tracingpages:D
\name_primitive:NN \tracingparagraphs \tex_tracingparagraphs:D
\name_primitive:NN \tracingrestores \tex_tracingrestores:D
\name_primitive:NN \tracingstats \tex_tracingstats:D
\name_primitive:NN \pausing \tex_pausing:D
\name_primitive:NN \showboxbreadth \tex_showboxbreadth:D
\name_primitive:NN \showboxdepth \tex_showboxdepth:D
\name_primitive:NN \batchmode \tex_batchmode:D
\name_primitive:NN \errorstopmode \tex_errorstopmode:D
\name_primitive:NN \nonstopmode \tex_nonstopmode:D
\name_primitive:NN \scrollmode \tex_scrollmode:D
\name_primitive:NN \end \tex_end:D
\name_primitive:NN \csname \tex_csname:D
\name_primitive:NN \endcsname \tex_endcsname:D
\name_primitive:NN \ignorespaces \tex_ignorespaces:D
\name_primitive:NN \relax \tex_relax:D
\name_primitive:NN \the \tex_the:D
\name_primitive:NN \mag \tex_mag:D
\name_primitive:NN \language \tex_language:D
\name_primitive:NN \mark \tex_mark:D
\name_primitive:NN \topmark \tex_topmark:D
\name_primitive:NN \firstmark \tex_firstmark:D
\name_primitive:NN \botmark \tex_botmark:D
\name_primitive:NN \splitfirstmark \tex_splitfirstmark:D
\name_primitive:NN \splitbotmark \tex_splitbotmark:D
\name_primitive:NN \fontname \tex_fontname:D
\name_primitive:NN \escapechar \tex_escapechar:D
\name_primitive:NN \endlinechar \tex_endlinechar:D
\name_primitive:NN \mathchoice \tex_mathchoice:D
\name_primitive:NN \delimiter \tex_delimiter:D
\name_primitive:NN \mathaccent \tex_mathaccent:D
\name_primitive:NN \mathchar \tex_mathchar:D
\name_primitive:NN \mskip \tex_mskip:D
\name_primitive:NN \radical \tex_radical:D
\name_primitive:NN \vcenter \tex_vcenter:D
\name_primitive:NN \mkern \tex_mkern:D
\name_primitive:NN \above \tex_above:D
\name_primitive:NN \abovewithdelims \tex_abovewithdelims:D
\name_primitive:NN \atop \tex_atop:D
\name_primitive:NN \atopwithdelims \tex_atopwithdelims:D
\name_primitive:NN \over \tex_over:D
\name_primitive:NN \overwithdelims \tex_overwithdelims:D
\name_primitive:NN \displaystyle \tex_displaystyle:D
\name_primitive:NN \textstyle \tex_textstyle:D
\name_primitive:NN \scriptstyle \tex_scriptstyle:D
\name_primitive:NN \scriptscriptstyle \tex_scriptscriptstyle:D
\name_primitive:NN \nonscript \tex_nonscript:D
\name_primitive:NN \eqno \tex_eqno:D
\name_primitive:NN \leqno \tex_leqno:D
\name_primitive:NN \abovedisplayshortskip \tex_abovedisplayshortskip:D
\name_primitive:NN \abovedisplayskip \tex_abovedisplayskip:D
\name_primitive:NN \belowdisplayshortskip \tex_belowdisplayshortskip:D
\name_primitive:NN \belowdisplayskip \tex_belowdisplayskip:D
\name_primitive:NN \displaywidowpenalty \tex_displaywidowpenalty:D
\name_primitive:NN \displayindent \tex_displayindent:D
\name_primitive:NN \displaywidth \tex_displaywidth:D
\name_primitive:NN \everydisplay \tex_everydisplay:D
\name_primitive:NN \predisplaysize \tex_predisplaysize:D
\name_primitive:NN \predisplaypenalty \tex_predisplaypenalty:D
\name_primitive:NN \postdisplaypenalty \tex_postdisplaypenalty:D
\name_primitive:NN \mathbin \tex_mathbin:D
\name_primitive:NN \mathclose \tex_mathclose:D
\name_primitive:NN \mathinner \tex_mathinner:D
\name_primitive:NN \mathop \tex_mathop:D
\name_primitive:NN \displaylimits \tex_displaylimits:D
\name_primitive:NN \limits \tex_limits:D
\name_primitive:NN \nolimits \tex_nolimits:D
\name_primitive:NN \mathopen \tex_mathopen:D
\name_primitive:NN \mathord \tex_mathord:D
\name_primitive:NN \mathpunct \tex_mathpunct:D
\name_primitive:NN \mathrel \tex_mathrel:D
\name_primitive:NN \overline \tex_overline:D
\name_primitive:NN \underline \tex_underline:D
\name_primitive:NN \left \tex_left:D
\name_primitive:NN \right \tex_right:D
\name_primitive:NN \binoppenalty \tex_binoppenalty:D
\name_primitive:NN \relpenalty \tex_relpenalty:D
\name_primitive:NN \delimitershortfall \tex_delimitershortfall:D
\name_primitive:NN \delimiterfactor \tex_delimiterfactor:D
\name_primitive:NN \nulldelimiterspace \tex_nulldelimiterspace:D
\name_primitive:NN \everymath \tex_everymath:D
\name_primitive:NN \mathsurround \tex_mathsurround:D
\name_primitive:NN \medmuskip \tex_medmuskip:D
\name_primitive:NN \thinmuskip \tex_thinmuskip:D
\name_primitive:NN \thickmuskip \tex_thickmuskip:D
\name_primitive:NN \scriptspace \tex_scriptspace:D
\name_primitive:NN \noboundary \tex_noboundary:D
\name_primitive:NN \accent \tex_accent:D
\name_primitive:NN \char \tex_char:D
\name_primitive:NN \discretionary \tex_discretionary:D
\name_primitive:NN \hfil \tex_hfil:D
\name_primitive:NN \hfilneg \tex_hfilneg:D
\name_primitive:NN \hfill \tex_hfill:D
\name_primitive:NN \hskip \tex_hskip:D
\name_primitive:NN \hss \tex_hss:D
\name_primitive:NN \vfil \tex_vfil:D
\name_primitive:NN \vfilneg \tex_vfilneg:D
\name_primitive:NN \vfill \tex_vfill:D
\name_primitive:NN \vskip \tex_vskip:D
\name_primitive:NN \vss \tex_vss:D
\name_primitive:NN \unskip \tex_unskip:D
\name_primitive:NN \kern \tex_kern:D
\name_primitive:NN \unkern \tex_unkern:D
\name_primitive:NN \hrule \tex_hrule:D
\name_primitive:NN \vrule \tex_vrule:D
\name_primitive:NN \leaders \tex_leaders:D
\name_primitive:NN \cleaders \tex_cleaders:D
\name_primitive:NN \xleaders \tex_xleaders:D
\name_primitive:NN \lastkern \tex_lastkern:D
\name_primitive:NN \lastskip \tex_lastskip:D
\name_primitive:NN \indent \tex_indent:D
\name_primitive:NN \par \tex_par:D
\name_primitive:NN \noindent \tex_noindent:D
\name_primitive:NN \vadjust \tex_vadjust:D
\name_primitive:NN \baselineskip \tex_baselineskip:D
\name_primitive:NN \lineskip \tex_lineskip:D
\name_primitive:NN \lineskiplimit \tex_lineskiplimit:D
\name_primitive:NN \clubpenalty \tex_clubpenalty:D
\name_primitive:NN \widowpenalty \tex_widowpenalty:D
\name_primitive:NN \exhyphenpenalty \tex_exhyphenpenalty:D
\name_primitive:NN \hyphenpenalty \tex_hyphenpenalty:D
\name_primitive:NN \linepenalty \tex_linepenalty:D
\name_primitive:NN \doublehyphendemerits \tex_doublehyphendemerits:D
\name_primitive:NN \finalhyphendemerits \tex_finalhyphendemerits:D
\name_primitive:NN \adjdemerits \tex_adjdemerits:D
\name_primitive:NN \hangafter \tex_hangafter:D
\name_primitive:NN \hangindent \tex_hangindent:D
\name_primitive:NN \parshape \tex_parshape:D
\name_primitive:NN \hsize \tex_hsize:D
\name_primitive:NN \lefthyphenmin \tex_lefthyphenmin:D
\name_primitive:NN \righthyphenmin \tex_righthyphenmin:D
\name_primitive:NN \leftskip \tex_leftskip:D
\name_primitive:NN \rightskip \tex_rightskip:D
\name_primitive:NN \looseness \tex_looseness:D
\name_primitive:NN \parskip \tex_parskip:D
\name_primitive:NN \parindent \tex_parindent:D
\name_primitive:NN \uchyph \tex_uchyph:D
\name_primitive:NN \emergencystretch \tex_emergencystretch:D
\name_primitive:NN \pretolerance \tex_pretolerance:D
\name_primitive:NN \tolerance \tex_tolerance:D
\name_primitive:NN \spaceskip \tex_spaceskip:D
\name_primitive:NN \xspaceskip \tex_xspaceskip:D
\name_primitive:NN \parfillskip \tex_parfillskip:D
\name_primitive:NN \everypar \tex_everypar:D
\name_primitive:NN \prevgraf \tex_prevgraf:D
\name_primitive:NN \spacefactor \tex_spacefactor:D
\name_primitive:NN \shipout \tex_shipout:D
\name_primitive:NN \vsize \tex_vsize:D
\name_primitive:NN \interlinepenalty \tex_interlinepenalty:D
\name_primitive:NN \brokenpenalty \tex_brokenpenalty:D
\name_primitive:NN \topskip \tex_topskip:D
\name_primitive:NN \maxdeadcycles \tex_maxdeadcycles:D
\name_primitive:NN \maxdepth \tex_maxdepth:D
\name_primitive:NN \output \tex_output:D
\name_primitive:NN \deadcycles \tex_deadcycles:D
\name_primitive:NN \pagedepth \tex_pagedepth:D
\name_primitive:NN \pagestretch \tex_pagestretch:D
\name_primitive:NN \pagefilstretch \tex_pagefilstretch:D
\name_primitive:NN \pagefillstretch \tex_pagefillstretch:D
\name_primitive:NN \pagefilllstretch \tex_pagefilllstretch:D
\name_primitive:NN \pageshrink \tex_pageshrink:D
\name_primitive:NN \pagegoal \tex_pagegoal:D
\name_primitive:NN \pagetotal \tex_pagetotal:D
\name_primitive:NN \outputpenalty \tex_outputpenalty:D
\name_primitive:NN \hoffset \tex_hoffset:D
\name_primitive:NN \voffset \tex_voffset:D
\name_primitive:NN \insert \tex_insert:D
\name_primitive:NN \holdinginserts \tex_holdinginserts:D
\name_primitive:NN \floatingpenalty \tex_floatingpenalty:D
\name_primitive:NN \insertpenalties \tex_insertpenalties:D
\name_primitive:NN \lower \tex_lower:D
\name_primitive:NN \moveleft \tex_moveleft:D
\name_primitive:NN \moveright \tex_moveright:D
\name_primitive:NN \raise \tex_raise:D
\name_primitive:NN \copy \tex_copy:D
\name_primitive:NN \lastbox \tex_lastbox:D
\name_primitive:NN \vsplit \tex_vsplit:D
\name_primitive:NN \unhbox \tex_unhbox:D
\name_primitive:NN \unhcopy \tex_unhcopy:D
\name_primitive:NN \unvbox \tex_unvbox:D
\name_primitive:NN \unvcopy \tex_unvcopy:D
\name_primitive:NN \setbox \tex_setbox:D
\name_primitive:NN \hbox \tex_hbox:D
\name_primitive:NN \vbox \tex_vbox:D
\name_primitive:NN \vtop \tex_vtop:D
\name_primitive:NN \prevdepth \tex_prevdepth:D
\name_primitive:NN \badness \tex_badness:D
\name_primitive:NN \hbadness \tex_hbadness:D
\name_primitive:NN \vbadness \tex_vbadness:D
\name_primitive:NN \hfuzz \tex_hfuzz:D
\name_primitive:NN \vfuzz \tex_vfuzz:D
\name_primitive:NN \overfullrule \tex_overfullrule:D
\name_primitive:NN \boxmaxdepth \tex_boxmaxdepth:D
\name_primitive:NN \splitmaxdepth \tex_splitmaxdepth:D
\name_primitive:NN \splittopskip \tex_splittopskip:D
\name_primitive:NN \everyhbox \tex_everyhbox:D
\name_primitive:NN \everyvbox \tex_everyvbox:D
\name_primitive:NN \nullfont \tex_nullfont:D
\name_primitive:NN \textfont \tex_textfont:D
\name_primitive:NN \scriptfont \tex_scriptfont:D
\name_primitive:NN \scriptscriptfont \tex_scriptscriptfont:D
\name_primitive:NN \fontdimen \tex_fontdimen:D
\name_primitive:NN \hyphenchar \tex_hyphenchar:D
\name_primitive:NN \skewchar \tex_skewchar:D
\name_primitive:NN \defaulthyphenchar \tex_defaulthyphenchar:D
\name_primitive:NN \defaultskewchar \tex_defaultskewchar:D
\name_primitive:NN \number \tex_number:D
\name_primitive:NN \romannumeral \tex_romannumeral:D
\name_primitive:NN \string \tex_string:D
\name_primitive:NN \lowercase \tex_lowercase:D
\name_primitive:NN \uppercase \tex_uppercase:D
\name_primitive:NN \meaning \tex_meaning:D
\name_primitive:NN \penalty \tex_penalty:D
\name_primitive:NN \unpenalty \tex_unpenalty:D
\name_primitive:NN \lastpenalty \tex_lastpenalty:D
\name_primitive:NN \special \tex_special:D
\name_primitive:NN \dump \tex_dump:D
\name_primitive:NN \patterns \tex_patterns:D
\name_primitive:NN \hyphenation \tex_hyphenation:D
\name_primitive:NN \time \tex_time:D
\name_primitive:NN \day \tex_day:D
\name_primitive:NN \month \tex_month:D
\name_primitive:NN \year \tex_year:D
\name_primitive:NN \jobname \tex_jobname:D
\name_primitive:NN \everyjob \tex_everyjob:D
\name_primitive:NN \count \tex_count:D
\name_primitive:NN \dimen \tex_dimen:D
\name_primitive:NN \skip \tex_skip:D
\name_primitive:NN \toks \tex_toks:D
\name_primitive:NN \muskip \tex_muskip:D
\name_primitive:NN \box \tex_box:D
\name_primitive:NN \wd \tex_wd:D
\name_primitive:NN \ht \tex_ht:D
\name_primitive:NN \dp \tex_dp:D
\name_primitive:NN \catcode \tex_catcode:D
\name_primitive:NN \delcode \tex_delcode:D
\name_primitive:NN \sfcode \tex_sfcode:D
\name_primitive:NN \lccode \tex_lccode:D
\name_primitive:NN \uccode \tex_uccode:D
\name_primitive:NN \mathcode \tex_mathcode:D
% \end{macrocode}
%
%
%
%
% Since \LaTeX3 will require at least the \eTeX{} extensions,
% we also rename the additional primitives. These are all
% given the prefix |\etex_|.
% \begin{macrocode}
\name_primitive:NN \ifdefined \etex_ifdefined:D
\name_primitive:NN \ifcsname \etex_ifcsname:D
\name_primitive:NN \unless \etex_unless:D
\name_primitive:NN \eTeXversion \etex_eTeXversion:D
\name_primitive:NN \eTeXrevision \etex_eTeXrevision:D
\name_primitive:NN \marks \etex_marks:D
\name_primitive:NN \topmarks \etex_topmarks:D
\name_primitive:NN \firstmarks \etex_firstmarks:D
\name_primitive:NN \botmarks \etex_botmarks:D
\name_primitive:NN \splitfirstmarks \etex_splitfirstmarks:D
\name_primitive:NN \splitbotmarks \etex_splitbotmarks:D
\name_primitive:NN \unexpanded \etex_unexpanded:D
\name_primitive:NN \detokenize \etex_detokenize:D
\name_primitive:NN \scantokens \etex_scantokens:D
\name_primitive:NN \showtokens \etex_showtokens:D
\name_primitive:NN \readline \etex_readline:D
\name_primitive:NN \tracingassigns \etex_tracingassigns:D
\name_primitive:NN \tracingscantokens \etex_tracingscantokens:D
\name_primitive:NN \tracingnesting \etex_tracingnesting:D
\name_primitive:NN \tracingifs \etex_tracingifs:D
\name_primitive:NN \currentiflevel \etex_currentiflevel:D
\name_primitive:NN \currentifbranch \etex_currentifbranch:D
\name_primitive:NN \currentiftype \etex_currentiftype:D
\name_primitive:NN \tracinggroups \etex_tracinggroups:D
\name_primitive:NN \currentgrouplevel \etex_currentgrouplevel:D
\name_primitive:NN \currentgrouptype \etex_currentgrouptype:D
\name_primitive:NN \showgroups \etex_showgroups:D
\name_primitive:NN \showifs \etex_showifs:D
\name_primitive:NN \interactionmode \etex_interactionmode:D
\name_primitive:NN \lastnodetype \etex_lastnodetype:D
\name_primitive:NN \iffontchar \etex_iffontchar:D
\name_primitive:NN \fontcharht \etex_fontcharht:D
\name_primitive:NN \fontchardp \etex_fontchardp:D
\name_primitive:NN \fontcharwd \etex_fontcharwd:D
\name_primitive:NN \fontcharic \etex_fontcharic:D
\name_primitive:NN \parshapeindent \etex_parshapeindent:D
\name_primitive:NN \parshapelength \etex_parshapelength:D
\name_primitive:NN \parshapedimen \etex_parshapedimen:D
\name_primitive:NN \numexpr \etex_numexpr:D
\name_primitive:NN \dimexpr \etex_dimexpr:D
\name_primitive:NN \glueexpr \etex_glueexpr:D
\name_primitive:NN \muexpr \etex_muexpr:D
\name_primitive:NN \gluestretch \etex_gluestretch:D
\name_primitive:NN \glueshrink \etex_glueshrink:D
\name_primitive:NN \gluestretchorder \etex_gluestretchorder:D
\name_primitive:NN \glueshrinkorder \etex_glueshrinkorder:D
\name_primitive:NN \gluetomu \etex_gluetomu:D
\name_primitive:NN \mutoglue \etex_mutoglue:D
\name_primitive:NN \lastlinefit \etex_lastlinefit:D
\name_primitive:NN \interlinepenalties \etex_interlinepenalties:D
\name_primitive:NN \clubpenalties \etex_clubpenalties:D
\name_primitive:NN \widowpenalties \etex_widowpenalties:D
\name_primitive:NN \displaywidowpenalties \etex_displaywidowpenalties:D
\name_primitive:NN \middle \etex_middle:D
\name_primitive:NN \savinghyphcodes \etex_savinghyphcodes:D
\name_primitive:NN \savingvdiscards \etex_savingvdiscards:D
\name_primitive:NN \pagediscards \etex_pagediscards:D
\name_primitive:NN \splitdiscards \etex_splitdiscards:D
\name_primitive:NN \TeXXETstate \etex_TeXXETstate:D
\name_primitive:NN \beginL \etex_beginL:D
\name_primitive:NN \endL \etex_endL:D
\name_primitive:NN \beginR \etex_beginR:D
\name_primitive:NN \endR \etex_endR:D
\name_primitive:NN \predisplaydirection \etex_predisplaydirection:D
\name_primitive:NN \everyeof \etex_everyeof:D
\name_primitive:NN \protected \etex_protected:D
% \end{macrocode}
%
%
% All major distributions\footnote{At the time of writing MiK\TeX\
% does not but I have a gut feeling that will change.} use
% pdf\eTeX{} as engine so we add these names as well. Since the
% pdf\TeX{} team has been very good at prefixing most primitives
% with |pdf| (so far only five do not start with |pdf|) we do not
% give then a double |pdf| prefix. The list below covers pdf\TeX
% v~1.30.4.
% \begin{macrocode}
%% integer registers:
\name_primitive:NN \pdfoutput \pdf_output:D
\name_primitive:NN \pdfminorversion \pdf_minorversion:D
\name_primitive:NN \pdfcompresslevel \pdf_compresslevel:D
\name_primitive:NN \pdfdecimaldigits \pdf_decimaldigits:D
\name_primitive:NN \pdfimageresolution \pdf_imageresolution:D
\name_primitive:NN \pdfpkresolution \pdf_pkresolution:D
\name_primitive:NN \pdftracingfonts \pdf_tracingfonts:D
\name_primitive:NN \pdfuniqueresname \pdf_uniqueresname:D
\name_primitive:NN \pdfadjustspacing \pdf_adjustspacing:D
\name_primitive:NN \pdfprotrudechars \pdf_protrudechars:D
\name_primitive:NN \efcode \pdf_efcode:D
\name_primitive:NN \lpcode \pdf_lpcode:D
\name_primitive:NN \rpcode \pdf_rpcode:D
\name_primitive:NN \pdfforcepagebox \pdf_forcepagebox:D
\name_primitive:NN \pdfoptionalwaysusepdfpagebox \pdf_optionalwaysusepdfpagebox:D
\name_primitive:NN \pdfinclusionerrorlevel\pdf_inclusionerrorlevel:D
\name_primitive:NN \pdfoptionpdfinclusionerrorlevel \pdf_optionpdfinclusionerrorlevel:D
\name_primitive:NN \pdfimagehicolor \pdf_imagehicolor:D
\name_primitive:NN \pdfimageapplygamma \pdf_imageapplygamma:D
\name_primitive:NN \pdfgamma \pdf_gamma:D
\name_primitive:NN \pdfimagegamma \pdf_imagegamma:D
%% dimen registers:
\name_primitive:NN \pdfhorigin \pdf_horigin:D
\name_primitive:NN \pdfvorigin \pdf_vorigin:D
\name_primitive:NN \pdfpagewidth \pdf_pagewidth:D
\name_primitive:NN \pdfpageheight \pdf_pageheight:D
\name_primitive:NN \pdflinkmargin \pdf_linkmargin:D
\name_primitive:NN \pdfdestmargin \pdf_destmargin:D
\name_primitive:NN \pdfthreadmargin \pdf_threadmargin:D
%% token registers:
\name_primitive:NN \pdfpagesattr \pdf_pagesattr:D
\name_primitive:NN \pdfpageattr \pdf_pageattr:D
\name_primitive:NN \pdfpageresources \pdf_pageresources:D
\name_primitive:NN \pdfpkmode \pdf_pkmode:D
%% expandable commands:
\name_primitive:NN \pdftexrevision \pdf_texrevision:D
\name_primitive:NN \pdftexbanner \pdf_texbanner:D
\name_primitive:NN \pdfcreationdate \pdf_creationdate:D
\name_primitive:NN \pdfpageref \pdf_pageref:D
\name_primitive:NN \pdfxformname \pdf_xformname:D
\name_primitive:NN \pdffontname \pdf_fontname:D
\name_primitive:NN \pdffontobjnum \pdf_fontobjnum:D
\name_primitive:NN \pdffontsize \pdf_fontsize:D
\name_primitive:NN \pdfincludechars \pdf_includechars:D
\name_primitive:NN \leftmarginkern \pdf_leftmarginkern:D
\name_primitive:NN \rightmarginkern \pdf_rightmarginkern:D
\name_primitive:NN \pdfescapestring \pdf_escapestring:D
\name_primitive:NN \pdfescapename \pdf_escapename:D
\name_primitive:NN \pdfescapehex \pdf_escapehex:D
\name_primitive:NN \pdfunescapehex \pdf_unescapehex:D
\name_primitive:NN \pdfstrcmp \pdf_strcmp:D
\name_primitive:NN \pdfuniformdeviate \pdf_uniformdeviate:D
\name_primitive:NN \pdfnormaldeviate \pdf_normaldeviate:D
\name_primitive:NN \pdfmdfivesum \pdf_mdfivesum:D
\name_primitive:NN \pdffilemoddate \pdf_filemoddate:D
\name_primitive:NN \pdffilesize \pdf_filesize:D
\name_primitive:NN \pdffiledump \pdf_filedump:D
%% read-only integers:
\name_primitive:NN \pdftexversion \pdf_texversion:D
\name_primitive:NN \pdflastobj \pdf_lastobj:D
\name_primitive:NN \pdflastxform \pdf_lastxform:D
\name_primitive:NN \pdflastximage \pdf_lastximage:D
\name_primitive:NN \pdflastximagepages \pdf_lastximagepages:D
\name_primitive:NN \pdflastannot \pdf_lastannot:D
\name_primitive:NN \pdflastxpos \pdf_lastxpos:D
\name_primitive:NN \pdflastypos \pdf_lastypos:D
\name_primitive:NN \pdflastdemerits \pdf_lastdemerits:D
\name_primitive:NN \pdfelapsedtime \pdf_elapsedtime:D
\name_primitive:NN \pdfrandomseed \pdf_randomseed:D
\name_primitive:NN \pdfshellescape \pdf_shellescape:D
%% general commands:
\name_primitive:NN \pdfobj \pdf_obj:D
\name_primitive:NN \pdfrefobj \pdf_refobj:D
\name_primitive:NN \pdfxform \pdf_xform:D
\name_primitive:NN \pdfrefxform \pdf_refxform:D
\name_primitive:NN \pdfximage \pdf_ximage:D
\name_primitive:NN \pdfrefximage \pdf_refximage:D
\name_primitive:NN \pdfannot \pdf_annot:D
\name_primitive:NN \pdfstartlink \pdf_startlink:D
\name_primitive:NN \pdfendlink \pdf_endlink:D
\name_primitive:NN \pdfoutline \pdf_outline:D
\name_primitive:NN \pdfdest \pdf_dest:D
\name_primitive:NN \pdfthread \pdf_thread:D
\name_primitive:NN \pdfstartthread \pdf_startthread:D
\name_primitive:NN \pdfendthread \pdf_endthread:D
\name_primitive:NN \pdfsavepos \pdf_savepos:D
\name_primitive:NN \pdfinfo \pdf_info:D
\name_primitive:NN \pdfcatalog \pdf_catalog:D
\name_primitive:NN \pdfnames \pdf_names:D
\name_primitive:NN \pdfmapfile \pdf_mapfile:D
\name_primitive:NN \pdfmapline \pdf_mapline:D
\name_primitive:NN \pdffontattr \pdf_fontattr:D
\name_primitive:NN \pdftrailer \pdf_trailer:D
\name_primitive:NN \pdffontexpand \pdf_fontexpand:D
%%\name_primitive:NN \vadjust [] { } (h, m)
\name_primitive:NN \pdfliteral \pdf_literal:D
%%\name_primitive:NN \special
\name_primitive:NN \pdfresettimer \pdf_resettimer:D
\name_primitive:NN \pdfsetrandomseed \pdf_setrandomseed:D
\name_primitive:NN \pdfnoligatures \pdf_noligatures:D
% \end{macrocode}
%
% What about Omega and Aleph? The status of both are unclear but let's
% start by adding a single primitive which we can use for testing if
% we have one of these engines.
% \begin{macrocode}
\name_primitive:NN \textdir \aleph_textdir:D
% \end{macrocode}
% \begin{macro}{\CodeStart}
% \begin{macro}{\CodeStop}
% Here we define functions that are used to turn on and off the
% special conventions used in the kernel of \LaTeX3.
%
% First of all, the space, tab and the return characters will all
% be ignored inside \LaTeX3 code, the latter because endline is set
% to a space instead. When space characters are needed in \LaTeX3
% code the |~| character will be used for that purpose.
%
% \begin{macrocode}
\tex_def:D\ExplSyntaxOn{
\tex_def:D\ExplSyntaxStatus{00}
\tex_catcode:D 126=10 \tex_relax:D % tilde is a space char.
\tex_catcode:D 32=9 \tex_relax:D % space is ignored
\tex_catcode:D 9=9 \tex_relax:D % tab also ignored
\tex_endlinechar:D =32 \tex_relax:D % endline is space
\tex_catcode:D 95=11 \tex_relax:D % underscore letter
\tex_catcode:D 58=11 \tex_relax:D % colon letter
}
% \end{macrocode}
%
% \begin{macrocode}
\tex_def:D\ExplSyntaxOff{
\tex_def:D\ExplSyntaxStatus{01}
\tex_catcode:D 126=13 \tex_relax:D
\tex_catcode:D 32=10 \tex_relax:D
\tex_catcode:D 9=10 \tex_relax:D
\tex_endlinechar:D =13 \tex_relax:D
\tex_catcode:D 95=8 \tex_relax:D
\tex_catcode:D 58=12 \tex_relax:D
}
% \end{macrocode}
% Temporary while names change.
% \begin{macrocode}
\tex_let:D \CodeStart \ExplSyntaxOn
\tex_let:D \CodeStop \ExplSyntaxOff
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\NamesStart}
% \begin{macro}{\NamesStop}
% Sometimes we need to be able to use names from the kernel of
% \LaTeX3 without adhering it's conventions according to space
% characters. These macros provide the necessary settings.
% \begin{macrocode}
\tex_def:D \NamesStart{
\tex_catcode:D `\_=11\tex_relax:D
\tex_catcode:D `\:=11\tex_relax:D
}
\tex_def:D \NamesStop{
\tex_catcode:D `\_=8\tex_relax:D
\tex_catcode:D `\:=12\tex_relax:D
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\GetIdInfo}
% \begin{macro}{\GetIdInfoAuxi:w}
% \begin{macro}{\GetIdInfoAuxii:w}
% \begin{macro}{\GetIdInfoAuxCVS:w}
% \begin{macro}{\GetIdInfoAuxSVN:w}
% Extract all information from a cvs or svn field. The
% formats are slightly different but at least the information is in
% the same positions so we check in the date format so see if it
% contains a "/" after the four-digit year. If it does it is cvs
% else svn and we extract information. To be on the safe side we
% ensure that spaces in the argument are seen.
% \begin{macrocode}
\tex_def:D\GetIdInfo{
\tex_begingroup:D
\tex_catcode:D 32=10 \tex_relax:D % needed? Probably for now.
\GetIdInfoAuxi:w
}
\tex_def:D\GetIdInfoAuxi:w$#1~#2.#3~#4~#5~#6~#7~#8$#9{
\tex_endgroup:D
\tex_def:D\filename{#2}
\tex_def:D\fileversion{#4}
\tex_def:D\filedescription{#9}
\tex_def:D\fileauthor{#7}
\GetIdInfoAuxii:w #5\tex_relax:D
#3\tex_relax:D#5\tex_relax:D#6\tex_relax:D
}
\tex_def:D\GetIdInfoAuxii:w #1#2#3#4#5#6\tex_relax:D{
\tex_ifx:D#5/
\tex_expandafter:D\GetIdInfoAuxCVS:w
\tex_else:D
\tex_expandafter:D\GetIdInfoAuxSVN:w
\tex_fi:D
}
\tex_def:D\GetIdInfoAuxCVS:w #1,v\tex_relax:D
#2\tex_relax:D#3\tex_relax:D{
\tex_def:D\filedate{#2}
\tex_def:D\filenameext{#1}
\tex_def:D\filetimestamp{#3}
% \end{macrocode}
% When creating the format we want the information in the log straight
% away.
% \begin{macrocode}
%\tex_immediate:D\tex_write:D-1
% {\filename;~ v\fileversion,~\filedate;~\filedescription}
}
\tex_def:D\GetIdInfoAuxSVN:w #1\tex_relax:D#2-#3-#4
\tex_relax:D#5Z\tex_relax:D{
\tex_def:D\filenameext{#1}
\tex_def:D\filedate{#2/#3/#4}
\tex_def:D\filetimestamp{#5}
%<-package>\tex_immediate:D\tex_write:D-1
%<-package> {\filename;~ v\fileversion,~\filedate;~\filedescription}
}
%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% Finally some corrections in the case we are running over \LaTeXe.
%
%
%
% We want to set things up so that experimental packages and regular
% packages can coexist with the former using the \LaTeX3 programming
% catcode settings. Since it cannot be the task of the end user to
% know how a package is constructed under the hood we make it so that
% the experimental packages have to identify themselves. As an example
% it can be done as
% \begin{verbatim}
% \RequirePackage{l3names}
% \ProvidesExplPackage{agent}{2007/08/28}{007}{bonding module}
% \end{verbatim}
% or by using the "\file"\meta{field} informations from "\GetIdInfo"
% as the packages in this distribution do like this:
% \begin{verbatim}
% \RequirePackage{l3names}
% \GetIdInfo$Id: l3names.dtx 621 2007-09-01 20:14:19Z morten $
% {L3 Experimental Box module}
% \ProvidesExplPackage
% {\filename}{\filedate}{\fileversion}{\filedescription}
% \end{verbatim}
%
%
% \begin{macro}{\ProvidesExplPackage}
% \begin{macro}{\ProvidesExplClass}
% First up is the identification. Rather trivial
% \begin{macrocode}
%<*package>
\tex_def:D \ProvidesExplPackage#1#2#3#4{
\ProvidesPackage{#1}[#2~v#3~#4]
\ExplSyntaxOn
}
\tex_def:D \ProvidesExplClass#1#2#3#4{
\ProvidesClass{#1}[#2~v#3~#4]
\ExplSyntaxOn
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\org@onefilewithoptions}
% \begin{macro}{\@onefilewithoptions}
% \begin{macro}{\@popfilename}
% The idea behind the code is to record whether or not the \LaTeX3
% syntax is on or off when about to load a file with class or
% package extension. This status stored in the parameter
% |\ExplSyntaxStatus| and set by |\ExplSyntaxOn| and
% |\ExplSyntaxOff| to |00| and |01| respectively is puched onto the
% stack |\ExplSyntaxStack|. Then the catcodes are set back to
% normal, the file loaded with its options and finally the stack is
% popped again.
%
% |\@popfilename| is appended with a preamble check. If the catcode
% of "@" is being reset it is a fair assumption that we are back in
% the usual preamble and so we switch off our syntax as well.
% \begin{macrocode}
\tex_let:D \org@onefilewithoptions\@onefilewithoptions
\tex_def:D \@onefilewithoptions#1[#2][#3]#4{
\tex_edef:D \ExplSyntaxStack{ \ExplSyntaxStatus\ExplSyntaxStack }
\ExplSyntaxOff
\org@onefilewithoptions{#1}[{#2}][{#3}]{#4}
\tex_expandafter:D\ExplSyntaxPopStack\ExplSyntaxStack\tex_relax:D
}
\g@addto@macro\@popfilename{%
\tex_ifnum:D\tex_the:D\tex_catcode:D`\@=12\tex_relax:D
\ExplSyntaxOff
\tex_fi:D
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ExplSyntaxPopStack}
% \begin{macro}{\ExplSyntaxStack}
% Popping the stack is simple: Take the first two tokens which are
% either the sequence "00" or "01" and use them in an if test. The
% stack is initially empty.
% \begin{macrocode}
\tex_def:D\ExplSyntaxPopStack#1#2#3\tex_relax:D{
\tex_def:D\ExplSyntaxStack{#3}
\tex_if:D#1#2
\ExplSyntaxOn
\tex_else:D
\ExplSyntaxOff
\tex_fi:D
}
\tex_def:D\ExplSyntaxStack{}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% A few of the `primitives' assigned above have already been stolen
% by \LaTeX, so assign them by hand to the saved real primitive.
% \begin{macrocode}
\tex_let:D\tex_input:D \@@input
\tex_let:D\tex_underline:D \@@underline
\tex_let:D\tex_end:D \@@end
\tex_let:D\tex_everymath:D \frozen@everymath
\tex_let:D\tex_everydisplay:D \frozen@everydisplay
\tex_let:D\tex_italiccor:D \@@italiccorr
\tex_let:D\tex_hyphen:D \@@hyph
% \end{macrocode}
%
% \TeX\ has a nasty habit of inserting a command with the name |\par|
% so we had better make sure that that command at least has a definition.
% \begin{macrocode}
\tex_let:D\par \tex_par:D
% \end{macrocode}
%
%
%
% \begin{macrocode}
\tex_ifx:D\name_undefine:N\@gobble
% \end{macrocode}
%
% \begin{macrocode}
\AtEndOfPackage{\ExplSyntaxOff}
\tex_def:D\name_pop_stack:w{}
% \end{macrocode}
%
% \begin{macrocode}
\tex_else:D
% \end{macrocode}
%
% But if traditional \TeX\ code is disabled, do this\ldots
%
% As mentioned above, The \LaTeXe\ package mechanism will insert some code
% to handle the filename stack, and reset the package options, this
% code will die if the \TeX\ primitives have gone, so skip past it
% and insert some equivalent code that will work.
%
% First a version of |\ProvidesPackage| that can cope.
% \begin{macrocode}
\tex_def:D\ProvidesPackage{
\tex_begingroup:D
\ExplSyntaxOff
\package_provides:w}
% \end{macrocode}
%
% \begin{macrocode}
\tex_def:D\package_provides:w#1#2[#3]{
\tex_endgroup:D
\tex_immediate:D\tex_write:D-1{Package:~#1#2~#3}
\tex_expandafter:D\tex_xdef:D
\tex_csname:D ver@#1.sty\tex_endcsname:D{#1}}
% \end{macrocode}
%
% In this case the catcode preserving stack is not maintained and
% |\CodeStart| conventions stay in force once on. You'll need
% to turn then off explicitly with |\CodeStop| (although as currently
% built on 2e, nothing except very experimental code will run in
% this mode!) Also note that |\RequirePackage| is a simple definition, just for
% one file, with no options.
% \begin{macrocode}
\tex_def:D\name_pop_stack:w#1\relax{%
\ExplSyntaxOff
\tex_expandafter:D\@p@pfilename\@currnamestack\@nil
\tex_let:D\default@ds\@unknownoptionerror
\tex_global:D\tex_let:D\ds@\@empty
\tex_global:D\tex_let:D\@declaredoptions\@empty}
% \end{macrocode}
%
% \begin{macrocode}
\tex_def:D\@p@pfilename#1#2#3#4\@nil{%
\tex_gdef:D\@currname{#1}%
\tex_gdef:D\@currext{#2}%
\tex_catcode:D`\@#3%
\tex_gdef:D\@currnamestack{#4}}
% \end{macrocode}
%
% \begin{macrocode}
\tex_def:D\NeedsTeXFormat#1{}
\tex_def:D\RequirePackage#1{
\tex_expandafter:D\tex_ifx:D
\tex_csname:D ver@#1.sty\tex_endcsname:D\tex_relax:D
\ExplSyntaxOn
\tex_input:D#1.sty\tex_relax:D
\tex_fi:D}
\tex_fi:D
% \end{macrocode}
%
%
% The |\futurelet| just forces the special end of file marker to vanish,
% so the argument of |\name_pop_stack:w| does not cause an end-of-file
% error. (Normally I use |\expandafter| for this trick, but here the next
% token is in fact |\let| and that may be undefined.)
% \begin{macrocode}
\tex_futurelet:D\name_tmp:\name_pop_stack:w
%