summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-02 21:13:40 +0000
committerKarl Berry <karl@freefriends.org>2019-11-02 21:13:40 +0000
commit80cf66b257169421dfed4e16730749e8e84d27d0 (patch)
treecf2df5fc45cf46fccdbbabbf88de830ac8375a96 /Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
parent2ba06c139c46208f03d24e06963bbdc3db72f4b1 (diff)
xsim (2nov19)
git-svn-id: svn://tug.org/texlive/trunk@52620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex52
1 files changed, 44 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
index 39a4306f593..80186946168 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
@@ -25,31 +25,67 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% ----------------------------------------------------------------------------
-\XSIMmodule{auxfile}{writing stuff to the aux file}
+\XSIMmodule{auxfile}{writing stuff to an auxiliary file}
+
+\prg_new_conditional:Npnn \xsim_if_use_aux: {p,T,F,TF}
+ {
+ \bool_if:NTF \g_xsim_use_aux_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
\cs_new_protected:Npn \xsim_write_to_aux:n #1
- { \iow_now:Nn \@auxout {#1} }
+ {
+ \legacy_if:nT {@filesw}
+ {
+ \xsim_if_use_aux:TF
+ { \iow_now:Nn \@auxout {#1} }
+ { \iow_now:Nn \l__xsim_aux_file_iow {#1} }
+ }
+ }
\cs_generate_variant:Nn \xsim_write_to_aux:n {x}
% --------------------------------------------------------------------------
\cs_new_protected:Npn \XSIM #1 { \use:c {XSIMaux#1} }
+\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
+ { \cs_new_protected:cpn {XSIMaux#1} }
+
+\cs_new_protected:Npn \xsim_add_cs_to_aux:nn #1#2
+ {
+ \xsim_verbose:n { Writing~ command~ \XSIM {#1}~ to~ aux~ file }
+ \xsim_write_to_aux:x { \token_to_str:N \XSIM {#1} #2 }
+ }
+
\AtBeginDocument
{
- \xsim_write_to_aux:x
+ \iow_now:Nx \@auxout
{ \token_to_str:N \providecommand \token_to_str:N \XSIM [1] {} }
}
-\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
- { \cs_new_protected:cpn {XSIMaux#1} }
+% ----------------------------------------------------------------------------
-\cs_new_protected:Npn \xsim_add_cs_to_aux:nn #1#2
+\xsim_if_use_aux:F
{
- \xsim_verbose:n { Writing~ command~ \XSIM {#1}~ to~ aux~ file }
- \xsim_write_to_aux:x { \XSIM {#1} #2 }
+ \iow_new:N \l__xsim_aux_file_iow
+ \AtBeginDocument
+ { \iow_open:Nn \l__xsim_aux_file_iow { \c_sys_jobname_str .xsim } }
}
+\cs_new_protected:Npn \xsim_close_aux:
+ {
+ \xsim_if_use_aux:F
+ {
+ \iow_close:N \l__xsim_aux_file_iow
+ \legacy_if:nT {@filesw}
+ { \iow_now:Nx \@auxout { \token_to_str:N \XSIM {readaux} } }
+ }
+ }
+
+\xsim_new_aux_cs:cpn {readaux}
+ { \file_input:n { \c_sys_jobname_str .xsim } }
+
% ----------------------------------------------------------------------------
% list for recording values that need to be written to the aux file and
% updated at begin document