diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3sys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3sys.dtx | 165 |
1 files changed, 158 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index baf4bfc8756..6d2e81b4b03 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id$ +\GetIdInfo$Id: l3sys.dtx 6087 2015-09-25 10:29:53Z joseph $ {L3 Experimental system/runtime functions} %</driver|package> %<*driver> @@ -68,10 +68,39 @@ % % \begin{documentation} % -% \subsection{Engine-specific conditionals} +% \section{The name of the job} % -% \begin{function}[added = 2015-09-07, EXP, pTF]^^A -% {^^A +% \begin{variable}[added = 2015-09-19]{\c_sys_jobname_str} +% Constant that gets the \enquote{job name} assigned when \TeX{} starts. +% \begin{texnote} +% This copies the contents of the primitive \tn{jobname}. It is a constant +% that is set by \TeX{} and should not be overwritten by the package. +% \end{texnote} +% \end{variable} +% +% \section{Date and time} +% +% \begin{variable}[added = 2015-09-22] +% { +% \c_sys_minute_int, +% \c_sys_hour_int, +% \c_sys_day_int, +% \c_sys_month_int, +% \c_sys_year_int, +% } +% The date and time at which the current job was started: these are +% all reported as integers. +% \begin{texnote} +% Whilst the underlying primitives can be altered by the user, this +% interface to the time and date is intended to be the \enquote{real} +% values. +% \end{texnote} +% \end{variable} +% +% \subsection{Engine} +% +% \begin{function}[added = 2015-09-07, EXP, pTF] +% { % \sys_if_engine_luatex:, % \sys_if_engine_pdftex:, % \sys_if_engine_ptex: , @@ -89,6 +118,33 @@ % |\sys_if_engine_ptex_p:| is true for \epTeX{} but false for \eupTeX{}. % \end{function} % +% \begin{variable}[added = 2015-09-19]{\c_sys_engine_str} +% The current engine given as a lower case string: will be one of +% |luatex|, |pdftex|, |ptex|, |uptex| or |xetex|. +% \end{variable} +% +% \subsection{Output format} +% +% \begin{function}[added = 2015-09-19, EXP, pTF] +% { +% \sys_if_output_dvi:, +% \sys_if_output_pdf: +% } +% \begin{syntax} +% \cs{sys_if_output_dvi:TF} \Arg{true code} \Arg{false code} +% \end{syntax} +% Conditionals which give the current output mode the \TeX{} run is +% operating in. This will always be one of two outcomes, DVI mode or +% PDF mode. The two sets of conditionals are thus complementary and +% are both provided to allow the programmer to emphasise the most +% appropriate case. +% \end{function} +% +% \begin{variable}[added = 2015-09-19]{\c_sys_output_str} +% The current output mode given as a lower case string: will be one of +% |dvi| or |pdf|. +% \end{variable} +% % \end{documentation} % % \begin{implementation} @@ -99,16 +155,59 @@ %<*initex|package> % \end{macrocode} % -% \subsubsection{Detecting the engine} +% \subsection{The name of the job} +% +% \begin{variable}{\c_sys_jobname_str} +% Inherited from the \LaTeX3 name for the primitive: this needs to +% actually contain the text of the job name rather than the name of +% the primitive, of course. +% \begin{macrocode} +%<*initex> +\tex_everyjob:D \exp_after:wN + { + \tex_the:D \tex_everyjob:D + \str_const:Nx \c_sys_jobname_str { \tex_jobname:D } + } +%</initex> +%<*package> +\str_const:Nx \c_sys_jobname_str { \tex_jobname:D } +%</package> +% \end{macrocode} +% \end{variable} +% +% \subsection{Time and date} % -% \begin{macro}[pTF, EXP]^^A -% {^^A +% \begin{variable} +% { +% \c_sys_minute_int, +% \c_sys_hour_int, +% \c_sys_day_int, +% \c_sys_month_int, +% \c_sys_year_int, +% } +% Copies of the information provided by \TeX{} +% \begin{macrocode} +\int_const:Nn \c_sys_minute_int + { \int_mod:nn { \tex_time:D } { 60 } } +\int_const:Nn \c_sys_hour_int + { \int_div_truncate:nn { \tex_time:D } { 60 } } +\int_const:Nn \c_sys_day_int { \tex_day:D } +\int_const:Nn \c_sys_month_int { \tex_month:D } +\int_const:Nn \c_sys_year_int { \tex_year:D } +% \end{macrocode} +% \end{variable} +% +% \subsection{Detecting the engine} +% +% \begin{macro}[pTF, EXP] +% { % \sys_if_engine_luatex:, % \sys_if_engine_pdftex:, % \sys_if_engine_ptex:, % \sys_if_engine_uptex:, % \sys_if_engine_xetex: % } +% \begin{variable}{\c_sys_engine_str} % Set up the engine tests on the basis exactly one test should be true. % Mainly a case of looking for the appropriate marker primitive. For % \upTeX{}, there is a complexity in that setting |-kanji-internal=sjis| @@ -128,6 +227,7 @@ \cs_gset_eq:NN \sys_if_engine_luatex:F \use_none:n \cs_gset_eq:NN \sys_if_engine_luatex:TF \use_i:nn \cs_gset_eq:NN \sys_if_engine_luatex_p: \c_true_bool + \str_const:Nn \c_sys_engine_str { luatex } } \cs_if_exist:NT \pdftex_pdftexversion:D { @@ -135,6 +235,7 @@ \cs_gset_eq:NN \sys_if_engine_pdftex:F \use_none:n \cs_gset_eq:NN \sys_if_engine_pdftex:TF \use_i:nn \cs_gset_eq:NN \sys_if_engine_pdftex_p: \c_true_bool + \str_const:Nn \c_sys_engine_str { pdftex } } \cs_if_exist:NT \ptex_kanjiskip:D { @@ -148,12 +249,14 @@ \cs_gset_eq:NN \sys_if_engine_uptex:F \use_none:n \cs_gset_eq:NN \sys_if_engine_uptex:TF \use_i:nn \cs_gset_eq:NN \sys_if_engine_uptex_p: \c_true_bool + \str_const:Nn \c_sys_engine_str { uptex } } { \cs_gset_eq:NN \sys_if_engine_ptex:T \use:n \cs_gset_eq:NN \sys_if_engine_ptex:F \use_none:n \cs_gset_eq:NN \sys_if_engine_ptex:TF \use_i:nn \cs_gset_eq:NN \sys_if_engine_ptex_p: \c_true_bool + \str_const:Nn \c_sys_engine_str { ptex } } } \cs_if_exist:NT \xetex_XeTeXversion:D @@ -162,8 +265,51 @@ \cs_gset_eq:NN \sys_if_engine_xetex:F \use_none:n \cs_gset_eq:NN \sys_if_engine_xetex:TF \use_i:nn \cs_gset_eq:NN \sys_if_engine_xetex_p: \c_true_bool + \str_const:Nn \c_sys_engine_str { xetex } } % \end{macrocode} +% \end{variable} +% \end{macro} +% +% \subsection{Detecting the output} +% +% \begin{macro}[pTF, EXP] +% { +% \sys_if_output_dvi:, +% \sys_if_output_pdf: +% } +% \begin{variable}{\c_sys_output_str} +% This is a simple enough concept: the two views here are complementary. +% \begin{macrocode} +\bool_if:nTF + { + \cs_if_exist_p:N \pdftex_pdfoutput:D + && \int_compare_p:nNn \pdftex_pdfoutput:D > \c_zero + } + { + \cs_new_eq:NN \sys_if_output_dvi:T \use_none:n + \cs_new_eq:NN \sys_if_output_dvi:F \use:n + \cs_new_eq:NN \sys_if_output_dvi:TF \use_ii:nn + \cs_new_eq:NN \sys_if_output_dvi_p: \c_false_bool + \cs_new_eq:NN \sys_if_output_pdf:T \use:n + \cs_new_eq:NN \sys_if_output_pdf:F \use_none:n + \cs_new_eq:NN \sys_if_output_pdf:TF \use_i:nn + \cs_new_eq:NN \sys_if_output_pdf_p: \c_true_bool + \str_const:Nn \c_sys_output_str { pdf } + } + { + \cs_new_eq:NN \sys_if_output_dvi:T \use:n + \cs_new_eq:NN \sys_if_output_dvi:F \use_none:n + \cs_new_eq:NN \sys_if_output_dvi:TF \use_i:nn + \cs_new_eq:NN \sys_if_output_dvi_p: \c_true_bool + \cs_new_eq:NN \sys_if_output_pdf:T \use_none:n + \cs_new_eq:NN \sys_if_output_pdf:F \use:n + \cs_new_eq:NN \sys_if_output_pdf:TF \use_ii:nn + \cs_new_eq:NN \sys_if_output_pdf_p: \c_false_bool + \str_const:Nn \c_sys_output_str { dvi } + } +% \end{macrocode} +% \end{variable} % \end{macro} % % \subsection{Deprecated functions} @@ -194,6 +340,11 @@ } % \end{macrocode} % +% Deprecated 2015-09-19 for removal after 2016-12-31. +% \begin{macrocode} +\cs_set_eq:NN \c_job_name_tl \c_sys_jobname_str +% \end{macrocode} +% % \begin{macrocode} %</initex|package> % \end{macrocode} |