diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/expl3.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/expl3.dtx | 133 |
1 files changed, 80 insertions, 53 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 9a757ce9240..a36906f5137 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -36,8 +36,8 @@ %<*driver|generic|package> \def\ExplFileName{expl3} \def\ExplFileDescription{L3 programming layer} -\def\ExplFileDate{2014/05/20} -\def\ExplFileVersion{4814} +\def\ExplFileDate{2014/06/10} +\def\ExplFileVersion{5105} %</driver|generic|package> %<*driver> \documentclass[full]{l3doc} @@ -946,10 +946,10 @@ % Selects the driver to be used for color, graphics and related operations that % are driver-dependent. Options available are % \begin{itemize}[font = \texttt] -% \item[latex2e] Use the \pkg{graphics} package to select the driver, rather -% than \LaTeX3 code. This is the standard setting. % \item[auto] Let \LaTeX3 determine the correct driver. With DVI output, this -% will select the \texttt{dvips} back-end. +% will select the \texttt{dvips} back-end. This is the standard setting. +% \item[latex2e] Use the \pkg{graphics} package to select the driver, rather +% than \LaTeX3 code. % \item[dvips] Use the \texttt{dvips} driver. % \item[dvipdfmx] Use the \texttt{dvipdfmx} driver. % \item[pdfmode] Use the \texttt{pdfmode} driver (direct PDF output from @@ -1156,13 +1156,6 @@ ] % \end{macrocode} % -% For handling driver options the \pkg{ifpdf} package will be needed. To -% avoid issues during package loading, it's most convenient to load this before -% setting up any of the code environment. -% \begin{macrocode} -\RequirePackage{ifpdf} -% \end{macrocode} -% % \begin{macro}[aux]{\expl@create@bool@option} % \begin{variable}[int] % { @@ -1253,6 +1246,7 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[int, TF]{\__expl_if_pdf:} % \begin{variable}[int]{\l__expl_driver_tl} % \begin{variable}[int]{\l__expl_native_drivers_bool} % With the code now loaded, options can be handled using a real key--value @@ -1268,19 +1262,35 @@ active~engine.~LaTeX3~will~use~the~'#2'~driver~instead. } \tl_new:N \l__expl_driver_tl +\bool_if:nTF + { + \cs_if_exist_p:N \pdftex_pdfoutput:D + && \int_compare_p:nNn \pdftex_pdfoutput:D > \c_zero + } + { + \cs_new_eq:NN \__expl_if_pdf:T \use:n + \cs_new_eq:NN \__expl_if_pdf:F \use_none:n + \cs_new_eq:NN \__expl_if_pdf:TF \use_i:nn + } + { + \cs_new_eq:NN \__expl_if_pdf:T \use_none:n + \cs_new_eq:NN \__expl_if_pdf:F \use:n + \cs_new_eq:NN \__expl_if_pdf:TF \use_ii:nn + } \keys_define:nn { expl } { driver .choice:, driver / auto .code:n = { - \xetex_if_engine:TF - { \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } + \tl_set:Nx \l__expl_driver_tl { - \ifpdf - \tl_set:Nn \l__expl_driver_tl { pdfmode } - \else - \tl_set:Nn \l__expl_driver_tl { dvips } - \fi + \xetex_if_engine:TF + { xdvipdfmx } + { + \__expl_if_pdf:TF + { pdfmode } + { dvips } + } } }, driver / dvipdfmx .code:n = @@ -1290,14 +1300,15 @@ { \__msg_kernel_error:nnnn { expl } { wrong-driver } { dvipdfmx } { xdvipdfmx } - \tl_set:Nn \l__expl_driver_tl { xdvipdmx } + \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { - \ifpdf - \__msg_kernel_error:nnnn { expl } { wrong-driver } - { dvipdfmx } { pdfmode } - \tl_set:Nn \l__expl_driver_tl { pdfmode } - \fi + \__expl_if_pdf:T + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvipdfmx } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + } } }, driver / dvips .code:n = @@ -1310,11 +1321,12 @@ \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { - \ifpdf - \__msg_kernel_error:nnnn { expl } { wrong-driver } - { dvips } { pdfmode } - \tl_set:Nn \l__expl_driver_tl { pdfmode } - \fi + \__expl_if_pdf:T + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvips } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + } } }, driver / latex2e .code:n = @@ -1329,12 +1341,12 @@ \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { - \ifpdf - \else - \__msg_kernel_error:nnnn { expl } { wrong-driver } - { pdfmode } { dvips } - \tl_set:Nn \l__expl_driver_tl { dvips } - \fi + \__expl_if_pdf:F + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { pdfmode } { dvips } + \tl_set:Nn \l__expl_driver_tl { dvips } + } } }, driver / xdvipdfmx .code:n = @@ -1342,18 +1354,20 @@ \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } \xetex_if_engine:F { - \ifpdf - \__msg_kernel_error:nnnn { expl } { wrong-driver } - { xdvipdfmx } { pdfmode } - \tl_set:Nn \l__expl_driver_tl { pdfmode } - \else - \__msg_kernel_error:nnnn { expl } { wrong-driver } - { xdvipdfmx } { dvips } - \tl_set:Nn \l__expl_driver_tl { dvips } - \fi + \__expl_if_pdf:TF + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { xdvipdfmx } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + } + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { xdvipdfmx } { dvips } + \tl_set:Nn \l__expl_driver_tl { dvips } + } } }, - driver .initial:n = { latex2e } , + driver .initial:n = { auto } , native-drivers .choice:, native-drivers .default:n = { true }, native-drivers / false .meta:n = { driver = latex2e }, @@ -1371,6 +1385,7 @@ % \end{macrocode} % \end{variable} % \end{variable} +% \end{macro} % % \begin{macro} % { @@ -1446,8 +1461,17 @@ % loader, \cs{ProvidesExplFile} is temporarily redefined here. % \begin{macrocode} { - \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4 - { \ProvidesFile {#1} [ #2~v#3~#4 ] } + \cs_set_protected:Npn \ProvidesExplFile + { + \group_begin: + \char_set_catcode_space:n { `\ } + \ProvidesExplFileAux + } + \cs_set_protected:Npn \ProvidesExplFileAux #1#2#3#4 + { + \group_end: + \ProvidesFile {#1} [ #2~v#3~#4 ] + } \tl_const:Nn \c__expl_def_ext_tl { def } \@onefilewithoptions { l3 \l__expl_driver_tl } [ ] [ ] \c__expl_def_ext_tl \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4 @@ -1455,6 +1479,7 @@ \ProvidesFile {#1} [ #2~v#3~#4 ] \ExplSyntaxOn } + \cs_undefine:N \ProvidesExplFileAux } % \end{macrocode} % \end{variable} @@ -1649,11 +1674,13 @@ \xetex_if_engine:TF { xdvipdfmx } { - \ifpdf - pdfmode - \else - dvips - \fi + \bool_if:nTF + { + \cs_if_exist_p:N \pdftex_pdfoutput:D + && \int_compare_p:nNn \pdftex_pdfoutput:D > \c_zero + } + { pdfmode } + { dvips } } .def \scan_stop: \cs_undefine:N \ProvidesExplFile |