diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-02 21:38:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-02 21:38:04 +0000 |
commit | c4ee329d9de36c54e6715838a7617a385228e519 (patch) | |
tree | 425aed8cb12860211598c572beea774479d8b351 /Master/texmf-dist/source/latex/l3kernel/l3sys.dtx | |
parent | d59eb254bbc4402d6e35a1e112e652643512faa3 (diff) |
l3 (2sep20)
git-svn-id: svn://tug.org/texlive/trunk@56245 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3sys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3sys.dtx | 115 |
1 files changed, 105 insertions, 10 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 16cdfe6f3d5..b7dd54d2e85 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-08-07} +% \date{Released 2020-09-01} % % \maketitle % @@ -105,6 +105,22 @@ % |luatex|, |pdftex|, |ptex|, |uptex| or |xetex|. % \end{variable} % +% \begin{variable}[added = 2020-08-20]{\c_sys_engine_exec_str} +% The name of the standard executable for the current \TeX{} engine given +% as a lower case string: one of |luatex|, +% |luahbtex|, |pdftex|, |eptex|, |euptex| or |xetex|. +% \end{variable} +% +% \begin{variable}[added = 2020-08-20]{\c_sys_engine_format_str} +% The name of the preloaded format for the current \TeX{} run given +% as a lower case string: one of +% |lualatex| (or |dvilualatex|), +% |pdflatex| (or |latex|), |platex|, |uplatex| or |xelatex| for \LaTeX{}, +% similar names for plain \TeX{} (except \pdfTeX{} in DVI mode yields +% |etex|), and |cont-en| for Con\TeX{}t (i.e.~the +% \tn{fmtname}). +% \end{variable} +% % \section{Output format} % % \begin{function}[added = 2015-09-19, EXP, pTF] @@ -252,7 +268,7 @@ % Execute \meta{tokens} through shell escape at shipout. % \end{function} % -% \subsection{Loading configuration data} +% \section{Loading configuration data} % % \begin{function}[added = 2019-09-12]{\sys_load_backend:n} % \begin{syntax} @@ -277,7 +293,7 @@ % back deprecations, respectively. % \end{function} % -% \subsection{Final settins} +% \subsection{Final settings} % % \begin{function}[added = 2019-10-06]{\sys_finalise:} % \begin{syntax} @@ -361,6 +377,72 @@ % \end{variable} % \end{macro} % +% \begin{variable}{\c_sys_engine_exec_str,\c_sys_engine_format_str} +% Take the functions defined above, and set up the engine and format +% names. \cs{c_sys_engine_exec_str} differs from \cs{c_sys_engine_str} +% as it is the \emph{actual} engine name, not a \enquote{filtered} +% version. It differs for |ptex| and |uptex|, which have a leading +% |e|, and for |luatex|, because \LaTeX{} uses the \Lua HB\TeX{} +% engine. +% +% \cs{c_sys_engine_format_str} is quite similar to +% \cs{c_sys_engine_str}, except that it differentiates |pdflatex| from +% |latex| (which is \pdfTeX{} in DVI mode). This differentiation, +% however, is reliable only if the user doesn't change +% \cs{tex_pdfoutput:D} before loading this code. +% \begin{macrocode} +\str_const:Nx \c_sys_engine_exec_str + { + \sys_if_engine_pdftex:T { pdf } + \sys_if_engine_xetex:T { xe } + \sys_if_engine_ptex:T { ep } + \sys_if_engine_uptex:T { eup } + \sys_if_engine_luatex:T + { + lua \lua_now:e + { + if (pcall(require, 'luaharfbuzz')) then ~ + tex.print("hb") ~ + end + } + } + tex + } +\str_const:Nx \c_sys_engine_format_str + { + \cs_if_exist:NTF \fmtname + { + \bool_lazy_or:nnTF + { \str_if_eq_p:Vn \fmtname { plain } } + { \str_if_eq_p:Vn \fmtname { LaTeX2e } } + { + \sys_if_engine_pdftex:T + { \int_compare:nNnT { \tex_pdfoutput:D } = { 1 } { pdf } } + \sys_if_engine_xetex:T { xe } + \sys_if_engine_ptex:T { p } + \sys_if_engine_uptex:T { up } + \sys_if_engine_luatex:T + { + \int_compare:nNnT { \tex_pdfoutput:D } = { 0 } { dvi } + lua + } + \str_if_eq:VnTF \fmtname { LaTeX2e } + { latex } + { + \bool_lazy_and:nnT + { \sys_if_engine_pdftex_p: } + { \int_compare_p:nNn { \tex_pdfoutput:D } = { 0 } } + { e } + tex + } + } + { \fmtname } + } + { unknown } + } +% \end{macrocode} +% \end{variable} +% % \subsubsection{Randomness} % % This candidate function is placed there because @@ -415,22 +497,35 @@ \str_case:VnF #1 { { dvisvgm } { } - { xdvipdfmx } { } + { xdvipdfmx } { \tl_gset:Nn #1 { xetex } } + { xetex } { } } { \__kernel_msg_error:nnxx { sys } { wrong-backend } - #1 { xdvipdfmx } - \tl_gset:Nn #1 { xdvipdfmx } + #1 { xetex } + \tl_gset:Nn #1 { xetex } } } { \sys_if_output_pdf:TF { - \str_if_eq:VnF #1 { pdfmode } + \str_if_eq:VnTF #1 { pdfmode } { - \__kernel_msg_error:nnxx { sys } { wrong-backend } - #1 { pdfmode } - \tl_gset:Nn #1 { pdfmode } + \sys_if_engine_luatex:TF + { \tl_gset:Nn #1 { luatex } } + { \tl_gset:Nn #1 { pdftex } } + } + { + \bool_lazy_or:nnF + { \str_if_eq_p:Vn #1 { luatex } } + { \str_if_eq_p:Vn #1 { pdftex } } + { + \__kernel_msg_error:nnxx { sys } { wrong-backend } + #1 { \sys_if_engine_luatex:TF { luatex } { pdftex } } + \sys_if_engine_luatex:TF + { \tl_gset:Nn #1 { luatex } } + { \tl_gset:Nn #1 { pdftex } } + } } } { |