summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-08-23 20:53:47 +0000
committerKarl Berry <karl@freefriends.org>2020-08-23 20:53:47 +0000
commitb1cf361795a720dbfa84ca6546355be360964437 (patch)
tree0f4e7ab3eb499669e27d35feb127efc305f2c69c /Master/texmf-dist/tex/latex/ctex/ctexhook.sty
parent20b89567543c9ede8bcd65a562ce3abff8eaa617 (diff)
ctex (23aug20)
git-svn-id: svn://tug.org/texlive/trunk@56161 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctexhook.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexhook.sty55
1 files changed, 33 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
index 00821e29bb7..c6ae5130a98 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
@@ -26,31 +26,15 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 76d4e94 2020-06-06 23:22:18 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx e805781 2020-08-23 21:30:35 +0800 Qing Lee <sobenlee@gmail.com> $
{Document and package hooks (CTEX)}
\ProvidesExplPackage{ctexhook}
- {\ExplFileDate}{2.5.3}{\ExplFileDescription}
-\cs_new_protected:Npn \ctex_at_end_preamble:n
- { \tl_gput_right:Nn \g__ctex_end_preamble_hook_tl }
-\cs_new_protected:Npn \ctex_after_end_preamble:n
- { \tl_gput_right:Nn \g__ctex_after_end_preamble_hook_tl }
-\cs_new_protected:Npn \CTEX@document@left@hook
- { \group_end: \g__ctex_end_preamble_hook_tl \group_begin: }
-\cs_new_protected:Npn \CTEX@document@right@hook
- { \scan_stop: \g__ctex_after_end_preamble_hook_tl \tex_ignorespaces:D }
-\cs_set_nopar:Npx \document
- {
- \CTEX@document@left@hook
- \exp_not:o { \document }
- \CTEX@document@right@hook
- }
-\tl_new:N \g__ctex_end_preamble_hook_tl
-\tl_new:N \g__ctex_after_end_preamble_hook_tl
+ {\ExplFileDate}{2.5.4}{\ExplFileDescription}
\cs_new_protected:Npn \ctex_at_begin_package:nn #1
{
\@ifpackageloaded {#1}
{ \__ctex_package_loaded_warning:nn {#1} }
- { \ctex_gadd_package_hook:nnn { begin } {#1} }
+ { \ctex_gadd_package_hook:nnn { before } {#1} }
}
\cs_new_protected:Npn \__ctex_package_loaded_warning:nn #1#2
{ \msg_warning:nnx { ctex } { invalid-hook } {#1} }
@@ -63,8 +47,35 @@
{
\@ifpackageloaded {#1}
{ \use:n }
- { \ctex_gadd_package_hook:nnn { end } {#1} }
+ { \ctex_gadd_package_hook:nnn { after } {#1} }
+ }
+\@ifl@t@r \fmtversion { 2020/10/01 }
+ {
+ \cs_new_protected:Npx \ctex_at_end_preamble:n
+ { \hook_gput_code:nnn { env/document/before } { \c_novalue_tl } }
+ \cs_new_protected:Npx \ctex_after_end_preamble:n
+ { \hook_gput_code:nnn { begindocument/end } { \c_novalue_tl } }
+ \cs_new_protected:Npx \ctex_gadd_package_hook:nnn #1#2
+ { \hook_gput_code:nnn { package/#1/#2 } { \c_novalue_tl } }
+ \file_input_stop:
}
+ { }
+\cs_new_protected:Npn \ctex_at_end_preamble:n
+ { \tl_gput_right:Nn \g__ctex_end_preamble_hook_tl }
+\cs_new_protected:Npn \ctex_after_end_preamble:n
+ { \tl_gput_right:Nn \g__ctex_after_end_preamble_hook_tl }
+\cs_new_protected:Npn \CTEX@document@left@hook
+ { \group_end: \g__ctex_end_preamble_hook_tl \group_begin: }
+\cs_new_protected:Npn \CTEX@document@right@hook
+ { \scan_stop: \g__ctex_after_end_preamble_hook_tl \tex_ignorespaces:D }
+\cs_set_nopar:Npx \document
+ {
+ \CTEX@document@left@hook
+ \exp_not:o { \document }
+ \CTEX@document@right@hook
+ }
+\tl_new:N \g__ctex_end_preamble_hook_tl
+\tl_new:N \g__ctex_after_end_preamble_hook_tl
\cs_new_protected:Npn \ctex_gadd_package_hook:nnn #1#2
{ \ctex_gadd_hook:cn { g__ctex_at_ #1 _ #2 _hook_tl } }
\cs_new_protected:Npn \ctex_gadd_hook:Nn #1
@@ -84,13 +95,13 @@
\cs_new_protected:Npn \CTEX@reset@ptions@hook
{
\cs_if_eq:NNT \@currext \@pkgextension
- { \ctex_use_package_hook:nn { begin } { \@currname } }
+ { \ctex_use_package_hook:nn { before } { \@currname } }
}
\tl_put_left:Nn \@popfilename { \CTEX@popfilename@hook }
\cs_new_protected:Npn \CTEX@popfilename@hook
{
\cs_if_eq:NNT \@currext \@pkgextension
- { \ctex_use_package_hook:nn { end } { \@currname } }
+ { \ctex_use_package_hook:nn { after } { \@currname } }
}
%%
%%