summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/stex/source/stex/stex-mathhub.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/stex/source/stex/stex-mathhub.dtx')
-rw-r--r--macros/latex/contrib/stex/source/stex/stex-mathhub.dtx19
1 files changed, 14 insertions, 5 deletions
diff --git a/macros/latex/contrib/stex/source/stex/stex-mathhub.dtx b/macros/latex/contrib/stex/source/stex/stex-mathhub.dtx
index 89da6af2fb..e7749dad93 100644
--- a/macros/latex/contrib/stex/source/stex/stex-mathhub.dtx
+++ b/macros/latex/contrib/stex/source/stex/stex-mathhub.dtx
@@ -10,7 +10,7 @@
% TODO update copyright
%
%<*driver>
-\def\bibfolder#1{../../lib/bib/#1}
+\def\libfolder#1{../../lib/#1}
\input{../../doc/stex-docheader}
\begin{document}
@@ -245,6 +245,7 @@
% \begin{macro}{\stex_path_from_string:Nn}
% \begin{macrocode}
\cs_new_protected:Nn \stex_path_from_string:Nn {
+ \stex_debug:nn{files}{#2}
\str_set:Nx \l_tmpa_str { #2 }
\str_if_empty:NTF \l_tmpa_str {
\seq_clear:N #1
@@ -260,6 +261,7 @@
}
\stex_path_canonicalize:N #1
}
+ \stex_debug:nn{files}{Yields: \stex_path_to_string:N#1}
}
% \end{macrocode}
@@ -438,6 +440,7 @@
}
\seq_gset_eq:NN\g_stex_currentfile_seq\g_stex_currentfile_seq
\exp_args:NNo\seq_gpush:Nn\g_@@_stack\g_stex_currentfile_seq
+ \stex_get_document_uri:
}
% \end{macrocode}
% \end{macro}
@@ -454,6 +457,7 @@
\seq_get:NN\g_@@_stack\l_tmpa_seq
\seq_gset_eq:NN\g_stex_currentfile_seq\l_tmpa_seq
}
+ \stex_get_document_uri:
}
% \end{macrocode}
% \end{macro}
@@ -462,7 +466,11 @@
%
% \begin{macrocode}
\AddToHook{file/before}{
- \stex_filestack_push:n{\CurrentFilePath/\CurrentFile}
+ \tl_if_empty:NTF\CurrentFilePath{
+ \stex_filestack_push:n{\CurrentFile}
+ }{
+ \stex_filestack_push:n{\CurrentFilePath/\CurrentFile}
+ }
}
\AddToHook{file/after}{
\stex_filestack_pop:
@@ -483,6 +491,7 @@
\begingroup\escapechar=-1\catcode`\\=12
\exp_args:Nx\stex_kpsewhich:n{-expand-var~\c_percent_str MATHHUB\c_percent_str}
\exp_args:NNx\str_replace_all:Nnn\l_stex_kpsewhich_return_str{\c_backslash_str}/
+ \exp_args:NNx\str_if_eq:onT\l_stex_kpsewhich_return_str{\c_percent_str MATHHUB\c_percent_str}{\str_clear:N\l_stex_kpsewhich_return_str}
\exp_args:Nnx\use:nn{\endgroup}{\str_set:Nn\exp_not:N\l_stex_kpsewhich_return_str{\l_stex_kpsewhich_return_str}}
}{
\stex_kpsewhich:n{-var-value~MATHHUB}
@@ -498,15 +507,15 @@
}{
\stex_kpsewhich:n{-var-value~HOME}
}
- \ior_open:NnT \l_tmpa_ior{\l_stex_kpsewhich_return_str / .stex / mathhub.path}{
+ \ior_open:NnT \g_tmpa_ior{\l_stex_kpsewhich_return_str / .stex / mathhub.path}{
\begingroup\escapechar=-1\catcode`\\=12
- \ior_str_get:NN \l_tmpa_ior \l_tmpa_str
+ \ior_str_get:NN \g_tmpa_ior \l_tmpa_str
\sys_if_platform_windows:T{
\exp_args:NNx\str_replace_all:Nnn\l_tmpa_str{\c_backslash_str}/
}
\str_gset_eq:NN \c_stex_mathhub_str\l_tmpa_str
\endgroup
- \ior_close:N \l_tmpa_ior
+ \ior_close:N \g_tmpa_ior
}
}
\str_if_empty:NTF\c_stex_mathhub_str{