diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/jlreq')
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty | 87 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty | 177 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq.cls | 284 |
3 files changed, 332 insertions, 216 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty index ee11f2e4ff0..ea475e87dd9 100644 --- a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty @@ -403,46 +403,65 @@ } % 紙サイズ一覧 -\@namedef{jlreq@helper@papersizelist@a0}{{841mm}{1189mm}} -\@namedef{jlreq@helper@papersizelist@a1}{{594mm}{841mm}} -\@namedef{jlreq@helper@papersizelist@a2}{{420mm}{594mm}} -\@namedef{jlreq@helper@papersizelist@a3}{{297mm}{420mm}} -\@namedef{jlreq@helper@papersizelist@a4}{{210mm}{297mm}} -\@namedef{jlreq@helper@papersizelist@a5}{{148mm}{210mm}} -\@namedef{jlreq@helper@papersizelist@a6}{{105mm}{148mm}} -\@namedef{jlreq@helper@papersizelist@a7}{{74mm}{105mm}} -\@namedef{jlreq@helper@papersizelist@a8}{{52mm}{74mm}} -\@namedef{jlreq@helper@papersizelist@a9}{{37mm}{52mm}} -\@namedef{jlreq@helper@papersizelist@a10}{{26mm}{37mm}} - -\@namedef{jlreq@helper@papersizelist@b0}{{1030mm}{1456mm}} -\@namedef{jlreq@helper@papersizelist@b1}{{728mm}{1030mm}} -\@namedef{jlreq@helper@papersizelist@b2}{{515mm}{728mm}} -\@namedef{jlreq@helper@papersizelist@b3}{{364mm}{515mm}} -\@namedef{jlreq@helper@papersizelist@b4}{{257mm}{364mm}} -\@namedef{jlreq@helper@papersizelist@b5}{{182mm}{257mm}} -\@namedef{jlreq@helper@papersizelist@b6}{{128mm}{182mm}} -\@namedef{jlreq@helper@papersizelist@b7}{{91mm}{128mm}} -\@namedef{jlreq@helper@papersizelist@b8}{{64mm}{91mm}} -\@namedef{jlreq@helper@papersizelist@b9}{{45mm}{64mm}} -\@namedef{jlreq@helper@papersizelist@b10}{{32mm}{45mm}} - -\@namedef{jlreq@helper@papersizelist@c2}{{458mm}{648mm}} -\@namedef{jlreq@helper@papersizelist@c3}{{324mm}{458mm}} -\@namedef{jlreq@helper@papersizelist@c4}{{229mm}{354mm}} -\@namedef{jlreq@helper@papersizelist@c5}{{162mm}{229mm}} -\@namedef{jlreq@helper@papersizelist@c6}{{114mm}{162mm}} -\@namedef{jlreq@helper@papersizelist@c7}{{81mm}{114mm}} -\@namedef{jlreq@helper@papersizelist@c8}{{57mm}{81mm}} +\@namedef{jlreq@helper@papersizelist@a0paper}{{841mm}{1189mm}} +\@namedef{jlreq@helper@papersizelist@a1paper}{{594mm}{841mm}} +\@namedef{jlreq@helper@papersizelist@a2paper}{{420mm}{594mm}} +\@namedef{jlreq@helper@papersizelist@a3paper}{{297mm}{420mm}} +\@namedef{jlreq@helper@papersizelist@a4paper}{{210mm}{297mm}} +\@namedef{jlreq@helper@papersizelist@a5paper}{{148mm}{210mm}} +\@namedef{jlreq@helper@papersizelist@a6paper}{{105mm}{148mm}} +\@namedef{jlreq@helper@papersizelist@a7paper}{{74mm}{105mm}} +\@namedef{jlreq@helper@papersizelist@a8paper}{{52mm}{74mm}} +\@namedef{jlreq@helper@papersizelist@a9paper}{{37mm}{52mm}} +\@namedef{jlreq@helper@papersizelist@a10paper}{{26mm}{37mm}} + +\@namedef{jlreq@helper@papersizelist@b0paper}{{1000mm}{1414mm}} +\@namedef{jlreq@helper@papersizelist@b1paper}{{707mm}{1000mm}} +\@namedef{jlreq@helper@papersizelist@b2paper}{{500mm}{707mm}} +\@namedef{jlreq@helper@papersizelist@b3paper}{{353mm}{500mm}} +\@namedef{jlreq@helper@papersizelist@b4paper}{{250mm}{353mm}} +\@namedef{jlreq@helper@papersizelist@b5paper}{{176mm}{250mm}} +\@namedef{jlreq@helper@papersizelist@b6paper}{{125mm}{176mm}} +\@namedef{jlreq@helper@papersizelist@b7paper}{{88mm}{125mm}} +\@namedef{jlreq@helper@papersizelist@b8paper}{{63mm}{88mm}} +\@namedef{jlreq@helper@papersizelist@b9paper}{{44mm}{63mm}} +\@namedef{jlreq@helper@papersizelist@b10paper}{{31mm}{44mm}} + +\@namedef{jlreq@helper@papersizelist@b0j}{{1030mm}{1456mm}} +\@namedef{jlreq@helper@papersizelist@b1j}{{728mm}{1030mm}} +\@namedef{jlreq@helper@papersizelist@b2j}{{515mm}{728mm}} +\@namedef{jlreq@helper@papersizelist@b3j}{{364mm}{515mm}} +\@namedef{jlreq@helper@papersizelist@b4j}{{257mm}{364mm}} +\@namedef{jlreq@helper@papersizelist@b5j}{{182mm}{257mm}} +\@namedef{jlreq@helper@papersizelist@b6j}{{128mm}{182mm}} +\@namedef{jlreq@helper@papersizelist@b7j}{{91mm}{128mm}} +\@namedef{jlreq@helper@papersizelist@b8j}{{64mm}{91mm}} +\@namedef{jlreq@helper@papersizelist@b9j}{{45mm}{64mm}} +\@namedef{jlreq@helper@papersizelist@b10j}{{32mm}{45mm}} + +\@namedef{jlreq@helper@papersizelist@c2paper}{{458mm}{648mm}} +\@namedef{jlreq@helper@papersizelist@c3paper}{{324mm}{458mm}} +\@namedef{jlreq@helper@papersizelist@c4paper}{{229mm}{354mm}} +\@namedef{jlreq@helper@papersizelist@c5paper}{{162mm}{229mm}} +\@namedef{jlreq@helper@papersizelist@c6paper}{{114mm}{162mm}} +\@namedef{jlreq@helper@papersizelist@c7paper}{{81mm}{114mm}} +\@namedef{jlreq@helper@papersizelist@c8paper}{{57mm}{81mm}} \@namedef{jlreq@helper@papersizelist@a4var}{{210mm}{283mm}} \@namedef{jlreq@helper@papersizelist@b5var}{{182mm}{230mm}} -\@namedef{jlreq@helper@papersizelist@letter}{{8.5in}{11in}} -\@namedef{jlreq@helper@papersizelist@legal}{{8.5in}{14in}} -\@namedef{jlreq@helper@papersizelist@executive}{{7.25in}{10.5in}} +\@namedef{jlreq@helper@papersizelist@letterpaper}{{8.5in}{11in}} +\@namedef{jlreq@helper@papersizelist@legalpaper}{{8.5in}{14in}} +\@namedef{jlreq@helper@papersizelist@executivepaper}{{7.25in}{10.5in}} \@namedef{jlreq@helper@papersizelist@hagaki}{{100mm}{148mm}} +\@namedef{jlreq@helper@papersizelist@ansiapaper}{{8.5in}{11in}} +\@namedef{jlreq@helper@papersizelist@ansibpaper}{{11in}{17in}} +\@namedef{jlreq@helper@papersizelist@ansicpaper}{{17in}{22in}} +\@namedef{jlreq@helper@papersizelist@ansidpaper}{{22in}{34in}} +\@namedef{jlreq@helper@papersizelist@ansiepaper}{{34in}{44in}} + + % #1÷#2を\jlreq@resultdimenに入れる.(#1,#2は寸法を与える.) \newcommand*{\jlreq@helper@divide}[2]{% \begingroup diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty index cc1f43adc92..3cd358e68cc 100644 --- a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{jlreq-trimmarks}[2021/08/12 jlreq-trimmarks] +\ProvidesPackage{jlreq-trimmarks}[2021/11/05 jlreq-trimmarks] \RequirePackage{l3keys2e} \RequirePackage{jlreq-helpers} @@ -42,84 +42,117 @@ } % dvipdfmx=f,dvips=s,dviout = o, lualatex = l -\keys_define:nn { jlreq-trimmarks } { dvipdfmx .code:n = {\let\jlreq@trimmarks@driver=f}, .value_forbidden:n = true } -\keys_define:nn { jlreq-trimmarks } { dvips .code:n = {\let\jlreq@trimmarks@driver=s}, .value_forbidden:n = true } -\keys_define:nn { jlreq-trimmarks } { dviout .code:n = {\let\jlreq@trimmarks@driver=o}, .value_forbidden:n = true } +\keys_define:nn { jlreq-trimmarks } { + dvipdfmx .code:n = {\let\jlreq@trimmarks@driver=f}, .value_forbidden:n = true, + dvips .code:n = {\let\jlreq@trimmarks@driver=s}, .value_forbidden:n = true, + dviout .code:n = {\let\jlreq@trimmarks@driver=o}, .value_forbidden:n = true +} \let\jlreq@trimmarks@engine=\jlreq@engine -\keys_define:nn { jlreq-trimmarks } { lualatex .code:n = {\let\jlreq@trimmarks@engine=l}, .value_forbidden:n = true } -\keys_define:nn { jlreq-trimmarks } { uplatex .code:n = {\let\jlreq@trimmarks@engine=u}, .value_forbidden:n = true } -\keys_define:nn { jlreq-trimmarks } { platex .code:n = {\let\jlreq@trimmarks@engine=p}, .value_forbidden:n = true } +\keys_define:nn { jlreq-trimmarks } { + lualatex .code:n = {\let\jlreq@trimmarks@engine=l}, .value_forbidden:n = true, + uplatex .code:n = {\let\jlreq@trimmarks@engine=u}, .value_forbidden:n = true, + platex .code:n = {\let\jlreq@trimmarks@engine=p}, .value_forbidden:n = true +} -\def\jlreq@trimmarks@switchpapersize{} -\def\jlreq@trimmarks@addpapersize#1{% - \@ifnextchar[{\jlreq@trimmarks@addpapersize@{#1}}{\jlreq@trimmarks@addpapersize@@{#1}} +\tl_new:N \g__jlreq_trimmarks_papersizelist_tl +\cs_set:Nn \__jlreq_trimmarks_addpapersize:nn { + \exp_args:Nnv \__jlreq_trimmarks_addpapersize_aux:nn {#1}{jlreq@helper@papersizelist@#2} } -\def\jlreq@trimmarks@addpapersize@#1[#2]{% - \edef\@tempa{\unexpanded{\jlreq@trimmarks@addpapersize@@{#1}}\exp_not:v {jlreq@helper@papersizelist@#2}}% - \@tempa +\cs_set:Nn \__jlreq_trimmarks_addpapersize_aux:nn { + \__jlreq_trimmarks_addpapersize_auxi:nnn {#1}#2 } -\newcommand*{\jlreq@trimmarks@addpapersize@@}[3]{% - \clist_map_variable:nNn {#1} \@tempa { - \tl_put_right:Nx \jlreq@trimmarks@switchpapersize {{\exp_not:o {\@tempa}}{\unexpanded{\def\jlreq@resulta{#2}\def\jlreq@resultb{#3}}}}% - }% +\cs_set:Nn \__jlreq_trimmarks_addpapersize_auxi:nnn { + \clist_map_inline:nn {#1} { + \tl_gput_right:Nn \g__jlreq_trimmarks_papersizelist_tl { { ##1 } { \def\jlreq@resulta{#2} \def\jlreq@resultb{#3} } } + } +} +\tl_set:Nn \g__jlreq_trimmarks_papersizechangeddate_tl {2021-11-05} +\cs_set:Nn \__jlreq_trimmarks_addpapersize_withjisBwarning:nnn { + \__jlreq_trimmarks_addpapersize_withwarning:nnn {#1}{#2}{ + The~option~`##1'~means~the~papersize~in~the~ISO~B-series,~not~in~the~JIS~B-series.~This~behavior~was~changed~from~jlreq-trimmarks~version~\g__jlreq_trimmarks_papersizechangeddate_tl.~Use~`trimmarks_paper=#3'~for~the~JIS-B-series.~If~you~want~to~specify~the~ISO~B-series~and~if~you~think~this~warning~is~annoying,~use~`trimmarks_paper=#2' + } } -\__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@switchpapersize -\__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@addpapersize -\__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@addpapersize@ -\__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@addpapersize@@ - -\jlreq@trimmarks@addpapersize{a0,A0}[a0] -\jlreq@trimmarks@addpapersize{a1,A1}[a1] -\jlreq@trimmarks@addpapersize{a2,A2}[a2] -\jlreq@trimmarks@addpapersize{a3,A3}[a3] -\jlreq@trimmarks@addpapersize{a4,A4}[a4] -\jlreq@trimmarks@addpapersize{a5,A5}[a5] -\jlreq@trimmarks@addpapersize{a6,A6}[a6] -\jlreq@trimmarks@addpapersize{a7,A7}[a7] -\jlreq@trimmarks@addpapersize{a8,A8}[a8] -\jlreq@trimmarks@addpapersize{a9,A9}[a9] -\jlreq@trimmarks@addpapersize{a10,A10}[a10] - -\jlreq@trimmarks@addpapersize{b0,B0}[b0] -\jlreq@trimmarks@addpapersize{b1,B1}[b1] -\jlreq@trimmarks@addpapersize{b2,B2}[b2] -\jlreq@trimmarks@addpapersize{b3,B3}[b3] -\jlreq@trimmarks@addpapersize{b4,B4}[b4] -\jlreq@trimmarks@addpapersize{b5,B5}[b5] -\jlreq@trimmarks@addpapersize{b6,B6}[b6] -\jlreq@trimmarks@addpapersize{b7,B7}[b7] -\jlreq@trimmarks@addpapersize{b8,B8}[b8] -\jlreq@trimmarks@addpapersize{b9,B9}[b9] -\jlreq@trimmarks@addpapersize{b10,B10}[b10] - -\jlreq@trimmarks@addpapersize{c2,C2}[c2] -\jlreq@trimmarks@addpapersize{c3,C3}[c3] -\jlreq@trimmarks@addpapersize{c4,C4}[c4] -\jlreq@trimmarks@addpapersize{c5,C5}[c5] -\jlreq@trimmarks@addpapersize{c6,C6}[c6] -\jlreq@trimmarks@addpapersize{c7,C7}[c7] -\jlreq@trimmarks@addpapersize{c8,C8}[c8] - -\jlreq@trimmarks@addpapersize{a4var}[a4var] -\jlreq@trimmarks@addpapersize{b5var}[b5var] - -\jlreq@trimmarks@addpapersize{letter}[letter] -\jlreq@trimmarks@addpapersize{legal}[legal] -\jlreq@trimmarks@addpapersize{executive}[executive] -\jlreq@trimmarks@addpapersize{hagaki}[hagaki] +\cs_set:Nn \__jlreq_trimmarks_addpapersize_withwarning:nnn { + \exp_args:Nnv \__jlreq_trimmarks_addpapersize_withwarning_aux:nnn {#1}{jlreq@helper@papersizelist@#2}{#3} +} +\cs_set:Nn \__jlreq_trimmarks_addpapersize_withwarning_aux:nnn { + \__jlreq_trimmarks_addpapersize_withwarning_auxi:nnnn {#1}#2{#3} +} +\cs_set:Nn \__jlreq_trimmarks_addpapersize_withwarning_auxi:nnnn { + \cs_set:Nn \l__jlreq_tmpa:n { + \PackageWarningNoLine{jlreq-trimmarks}{#4} + } + \clist_map_inline:nn {#1} { + \tl_gput_right:Nx \g__jlreq_trimmarks_papersizelist_tl { { ##1 } { + \exp_not:o { \l__jlreq_tmpa:n {##1} } + \exp_not:n { \def\jlreq@resulta{#2} \def\jlreq@resultb{#3} } + } } + } +} +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \g__jlreq_trimmarks_papersizelist_tl +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize:nn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_aux:nn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_auxi:nnn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_withjisBwarning:nnn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_withwarning:nnn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_withwarning_aux:nnn +\__jlreq_trimmarks_afterpkg_addtodeletecs:N \__jlreq_trimmarks_addpapersize_withwarning_auxi:nnnn + +\__jlreq_trimmarks_addpapersize:nn{a0,A0,a0paper}{a0paper} +\__jlreq_trimmarks_addpapersize:nn{a1,A1,a1paper}{a1paper} +\__jlreq_trimmarks_addpapersize:nn{a2,A2,a2paper}{a2paper} +\__jlreq_trimmarks_addpapersize:nn{a3,A3,a3paper}{a3paper} +\__jlreq_trimmarks_addpapersize:nn{a4,A4,a4paper}{a4paper} +\__jlreq_trimmarks_addpapersize:nn{a5,A5,a5paper}{a5paper} +\__jlreq_trimmarks_addpapersize:nn{a6,A6,a6paper}{a6paper} +\__jlreq_trimmarks_addpapersize:nn{a7,A7,a7paper}{a7paper} +\__jlreq_trimmarks_addpapersize:nn{a8,A8,a8paper}{a8paper} +\__jlreq_trimmarks_addpapersize:nn{a9,A9,a9paper}{a9paper} +\__jlreq_trimmarks_addpapersize:nn{a10,A10,a10paper}{a10paper} + +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b0,B0}{b0paper}{b0j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b1,B1}{b1paper}{b1j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b2,B2}{b2paper}{b2j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b3,B3}{b3paper}{b3j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b4,B4}{b4paper}{b4j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b5,B5}{b5paper}{b5j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b6,B6}{b6paper}{b6j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b7,B7}{b7paper}{b7j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b8,B8}{b8paper}{b8j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b9,B9}{b9paper}{b9j} +\__jlreq_trimmarks_addpapersize_withjisBwarning:nnn{b10,B10}{b10paper}{b10j} + +\__jlreq_trimmarks_addpapersize:nn{c2,C2,c2paper}{c2paper} +\__jlreq_trimmarks_addpapersize:nn{c3,C3,c3paper}{c3paper} +\__jlreq_trimmarks_addpapersize:nn{c4,C4,c4paper}{c4paper} +\__jlreq_trimmarks_addpapersize:nn{c5,C5,c5paper}{c5paper} +\__jlreq_trimmarks_addpapersize:nn{c6,C6,c6paper}{c6paper} +\__jlreq_trimmarks_addpapersize:nn{c7,C7,c7paper}{c7paper} +\__jlreq_trimmarks_addpapersize:nn{c8,C8,c8paper}{c8paper} + +\__jlreq_trimmarks_addpapersize:nn{a4var}{a4var} +\__jlreq_trimmarks_addpapersize:nn{b5var}{b5var} + +\__jlreq_trimmarks_addpapersize:nn{letter,letterpaper}{letterpaper} +\__jlreq_trimmarks_addpapersize:nn{legal,legalpaper}{legalpaper} +\__jlreq_trimmarks_addpapersize:nn{executive,executivepaper}{executivepaper} +\__jlreq_trimmarks_addpapersize:nn{ansiapaper}{ansiapaper} +\__jlreq_trimmarks_addpapersize:nn{ansibpaper}{ansibpaper} +\__jlreq_trimmarks_addpapersize:nn{ansicpaper}{ansicpaper} +\__jlreq_trimmarks_addpapersize:nn{ansidpaper}{ansidpaper} +\__jlreq_trimmarks_addpapersize:nn{ansiepaper}{ansiepaper} +\__jlreq_trimmarks_addpapersize:nn{hagaki}{hagaki} % width -> \jlreq@resulta, height -> \jlreq@resultb -\edef\jlreq@trimmarks@analyzepapersize#1{ - \noexpand\jlreq@switch{#1}{ - \exp_not:o {\jlreq@trimmarks@switchpapersize}% - {% - \noexpand\jlreq@helper@dividebycomma{#1}% - \unexpanded{\ifjlreq@result\else}% - \unexpanded{\def\jlreq@resulta}{#1}% - \unexpanded{\def\jlreq@resultb}{#1}% - \noexpand\fi - }% - }\noexpand\relax +\def\jlreq@trimmarks@analyzepapersize#1{ + \str_case:nVF {#1} \g__jlreq_trimmarks_papersizelist_tl + { + \jlreq@helper@dividebycomma{#1}% + \ifjlreq@result\else + \def\jlreq@resulta{#1}% + \def\jlreq@resultb{#1}% + \fi + } } \__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@analyzepapersize diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls index bd208994b00..a06ad633fc2 100644 --- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls @@ -5,9 +5,9 @@ %% % (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/) \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{jlreq}[2021/10/09 jlreq] +\ProvidesClass{jlreq}[2021/11/05 jlreq] \RequirePackage{l3keys2e} -\RequirePackage{ifthen} +\RequirePackage{etoolbox} \RequirePackage{jlreq-helpers} \ExplSyntaxOn @@ -105,7 +105,10 @@ \tl_gput_right:Nn \g__jlreq_papersizelist_tl { { ##1 } { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } } } \clist_map_inline:nn {#2} { - \keys_define:nn { jlreq } { ##1 .code:n = { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } } + \keys_define:nn { jlreq } { + ##1 .code:n = { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} }, + ##1 .value_forbidden:n = true + } } } \keys_define:nn { jlreq } { @@ -123,50 +126,142 @@ } } +\cs_set:Nn \__jlreq_addpapersize_withwarning:nnnn { + \exp_args:Nnnv \__jlreq_addpapersize_withwarning_aux:nnnn {#1}{#2}{jlreq@helper@papersizelist@#3}{#4} +} +\cs_set:Nn \__jlreq_addpapersize_withwarning_aux:nnnn { + \__jlreq_addpapersize_withwarning_auxi:nnnnn {#1}{#2}#3{#4} +} +\cs_set:Nn \__jlreq_addpapersize_withwarning_auxi:nnnnn { + \cs_set:Nn \l__jlreq_tmpa:n { + \ClassWarningNoLine{jlreq}{#5} + } + \clist_map_inline:nn {#1} { + \tl_gput_right:Nx \g__jlreq_papersizelist_tl { { ##1 } { + \exp_not:o { \l__jlreq_tmpa:n {##1} } + \exp_not:n { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } + } } + } + \clist_map_inline:nn {#2} { + \cs_set:Nx \l__jlreq_do: { + \exp_not:N \keys_define:nn { jlreq } { + ##1 .code:n = { + \exp_not:o { \l__jlreq_tmpa:n {##1} } + \exp_not:n { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } + }, + ##1 .value_forbidden:n = true + } + } + \l__jlreq_do: + } +} + +\tl_set:Nn \g__jlreq_papersizechangeddate_tl{2021-11-05} +\cs_set:Nn \__jlreq_addpapersize_withjisBwarning:nnnn { + \__jlreq_addpapersize_withwarning:nnnn {#1} {#2} {#3} {The~option~`##1'~means~the~papersize~in~the~ISO~B-series,~not~in~the~JIS~B-series.~This~behavior~was~changed~from~jlreq~version~\g__jlreq_papersizechangeddate_tl.~Use~`paper=#4'~for~the~JIS-B-series.} +} + \__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize:nnn \__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_aux:nnn \__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_auxi:nnnn +\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_withwarning:nnnn +\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_withwarning_aux:nnnn +\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_withwarning_auxi:nnnnn +\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_withjisBwarning:nnnn \__jlreq_aftercls_addtodeletecs:N \g__jlreq_papersizelist_tl % 紙サイズ一覧.b*はJIS B. -\__jlreq_addpapersize:nnn{a0,A0}{}{a0} -\__jlreq_addpapersize:nnn{a1,A1}{}{a1} -\__jlreq_addpapersize:nnn{a2,A2}{}{a2} -\__jlreq_addpapersize:nnn{a3,A3}{a3paper}{a3} -\__jlreq_addpapersize:nnn{a4,A4}{a4paper}{a4} -\__jlreq_addpapersize:nnn{a5,A5}{a5paper}{a5} -\__jlreq_addpapersize:nnn{a6,A6}{a6paper}{a6} -\__jlreq_addpapersize:nnn{a7,A7}{}{a7} -\__jlreq_addpapersize:nnn{a8,A8}{}{a8} -\__jlreq_addpapersize:nnn{a9,A9}{}{a9} -\__jlreq_addpapersize:nnn{a10,A10}{}{a10} - -\__jlreq_addpapersize:nnn{b0,B0}{}{b0} -\__jlreq_addpapersize:nnn{b1,B1}{}{b1} -\__jlreq_addpapersize:nnn{b2,B2}{}{b2} -\__jlreq_addpapersize:nnn{b3,B3}{}{b3} -\__jlreq_addpapersize:nnn{b4,B4}{b4paper}{b4} -\__jlreq_addpapersize:nnn{b5,B5}{b5paper}{b5} -\__jlreq_addpapersize:nnn{b6,B6}{b6paper}{b6} -\__jlreq_addpapersize:nnn{b7,B7}{}{b7} -\__jlreq_addpapersize:nnn{b8,B8}{}{b8} -\__jlreq_addpapersize:nnn{b9,B9}{}{b9} -\__jlreq_addpapersize:nnn{b10,B10}{}{b10} - -\__jlreq_addpapersize:nnn{c2,C2}{}{c2} -\__jlreq_addpapersize:nnn{c3,C3}{}{c3} -\__jlreq_addpapersize:nnn{c4,C4}{}{c4} -\__jlreq_addpapersize:nnn{c5,C5}{}{c5} -\__jlreq_addpapersize:nnn{c6,C6}{}{c6} -\__jlreq_addpapersize:nnn{c7,C7}{}{c7} -\__jlreq_addpapersize:nnn{c8,C8}{}{c8} +\__jlreq_addpapersize:nnn{a0paper}{}{a0paper} +\__jlreq_addpapersize:nnn{a1paper}{}{a1paper} +\__jlreq_addpapersize:nnn{a2paper}{}{a2paper} +\__jlreq_addpapersize:nnn{a3paper}{a3paper}{a3paper} +\__jlreq_addpapersize:nnn{a4paper}{a4paper}{a4paper} +\__jlreq_addpapersize:nnn{a5paper}{a5paper}{a5paper} +\__jlreq_addpapersize:nnn{a6paper}{a6paper}{a6paper} +\__jlreq_addpapersize:nnn{a7paper}{}{a7paper} +\__jlreq_addpapersize:nnn{a8paper}{}{a8paper} +\__jlreq_addpapersize:nnn{a9paper}{}{a9paper} +\__jlreq_addpapersize:nnn{a10paper}{}{a10paper} + +\__jlreq_addpapersize:nnn{a0,A0}{}{a0paper} +\__jlreq_addpapersize:nnn{a1,A1}{}{a1paper} +\__jlreq_addpapersize:nnn{a2,A2}{}{a2paper} +\__jlreq_addpapersize:nnn{a3,A3}{}{a3paper} +\__jlreq_addpapersize:nnn{a4,A4}{}{a4paper} +\__jlreq_addpapersize:nnn{a5,A5}{}{a5paper} +\__jlreq_addpapersize:nnn{a6,A6}{}{a6paper} +\__jlreq_addpapersize:nnn{a7,A7}{}{a7paper} +\__jlreq_addpapersize:nnn{a8,A8}{}{a8paper} +\__jlreq_addpapersize:nnn{a9,A9}{}{a9paper} +\__jlreq_addpapersize:nnn{a10,A10}{}{a10paper} + +\__jlreq_addpapersize:nnn{b0paper}{}{b0paper} +\__jlreq_addpapersize:nnn{b1paper}{}{b1paper} +\__jlreq_addpapersize:nnn{b2paper}{}{b2paper} +\__jlreq_addpapersize:nnn{b3paper}{}{b3paper} +\__jlreq_addpapersize:nnn{b4paper}{}{b4paper} +\__jlreq_addpapersize:nnn{b5paper}{}{b5paper} +\__jlreq_addpapersize:nnn{b6paper}{}{b6paper} +\__jlreq_addpapersize:nnn{b7paper}{}{b7paper} +\__jlreq_addpapersize:nnn{b8paper}{}{b8paper} +\__jlreq_addpapersize:nnn{b9paper}{}{b9paper} +\__jlreq_addpapersize:nnn{b10paper}{}{b10paper} + +\__jlreq_addpapersize:nnn{c2paper}{}{c2paper} +\__jlreq_addpapersize:nnn{c3paper}{}{c3paper} +\__jlreq_addpapersize:nnn{c4paper}{}{c4paper} +\__jlreq_addpapersize:nnn{c5paper}{}{c5paper} +\__jlreq_addpapersize:nnn{c6paper}{}{c6paper} +\__jlreq_addpapersize:nnn{c7paper}{}{c7paper} +\__jlreq_addpapersize:nnn{c8paper}{}{c8paper} + +\__jlreq_addpapersize:nnn{c2,C2}{}{c2paper} +\__jlreq_addpapersize:nnn{c3,C3}{}{c3paper} +\__jlreq_addpapersize:nnn{c4,C4}{}{c4paper} +\__jlreq_addpapersize:nnn{c5,C5}{}{c5paper} +\__jlreq_addpapersize:nnn{c6,C6}{}{c6paper} +\__jlreq_addpapersize:nnn{c7,C7}{}{c7paper} +\__jlreq_addpapersize:nnn{c8,C8}{}{c8paper} + +\__jlreq_addpapersize_withjisBwarning:nnnn{b0,B0}{}{b0paper}{b0j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b1,B1}{}{b1paper}{b1j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b2,B2}{}{b2paper}{b2j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b3,B3}{}{b3paper}{b3j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b4,B4}{}{b4paper}{b4j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b5,B5}{}{b5paper}{b5j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b6,B6}{}{b6paper}{b6j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b7,B7}{}{b7paper}{b7j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b8,B8}{}{b8paper}{b8j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b9,B9}{}{b9paper}{b9j} +\__jlreq_addpapersize_withjisBwarning:nnnn{b10,B10}{}{b10paper}{b10j} + +\__jlreq_addpapersize_withjisBwarning:nnnn{}{b4paper}{b4paper}{b4j} +\__jlreq_addpapersize_withjisBwarning:nnnn{}{b5paper}{b5paper}{b5j} +\__jlreq_addpapersize_withjisBwarning:nnnn{}{b6paper}{b6paper}{b6j} + +\__jlreq_addpapersize:nnn{b0j}{}{b0j} +\__jlreq_addpapersize:nnn{b1j}{}{b1j} +\__jlreq_addpapersize:nnn{b2j}{}{b2j} +\__jlreq_addpapersize:nnn{b3j}{}{b3j} +\__jlreq_addpapersize:nnn{b4j}{}{b4j} +\__jlreq_addpapersize:nnn{b5j}{}{b5j} +\__jlreq_addpapersize:nnn{b6j}{}{b6j} +\__jlreq_addpapersize:nnn{b7j}{}{b7j} +\__jlreq_addpapersize:nnn{b8j}{}{b8j} +\__jlreq_addpapersize:nnn{b9j}{}{b9j} +\__jlreq_addpapersize:nnn{b10j}{}{b10j} \__jlreq_addpapersize:nnn{a4var}{}{a4var} \__jlreq_addpapersize:nnn{b5var}{}{b5var} -\__jlreq_addpapersize:nnn{letter}{letterpaper}{letter} -\__jlreq_addpapersize:nnn{legal}{legalpaper}{legal} -\__jlreq_addpapersize:nnn{executive}{executivepaper}{executive} +\__jlreq_addpapersize:nnn{letter,letterpaper}{letterpaper}{letterpaper} +\__jlreq_addpapersize:nnn{legal,legalpaper}{legalpaper}{legalpaper} +\__jlreq_addpapersize:nnn{executive,executivepaper}{executivepaper}{executivepaper} +\__jlreq_addpapersize:nnn{ansiapaper}{}{ansiapaper} +\__jlreq_addpapersize:nnn{ansibpaper}{}{ansibpaper} +\__jlreq_addpapersize:nnn{ansicpaper}{}{ansicpaper} +\__jlreq_addpapersize:nnn{ansidpaper}{}{ansidpaper} +\__jlreq_addpapersize:nnn{ansiepaper}{}{ansiepaper} \__jlreq_addpapersize:nnn{hagaki}{}{hagaki} @@ -978,35 +1073,6 @@ \__jlreq_setprebreakpenalty:Vn \jlreq@charlist@inseparablecharacters {10000} % ¥100とか70%とか…… -%.. 文字範囲 -\ifx u\jlreq@engine - % \kcatcodeの設定 - \cs_set:Nn \__jlreq_setkcatcode:nn { - \clist_map_inline:nn {#1} { \kcatcode"##1=#2\relax } - } - \__jlreq_aftercls_addtodeletecs:N \__jlreq_setkcatcode:nn - % LuaTeX-jaのデフォルトのままに近い設定をする - % 範囲1&8 - \__jlreq_setkcatcode:nn {80} {15} % Latin-1 Supplement,どうしよう…… - \__jlreq_setkcatcode:nn {100,180,250,2B0,300,1E00} {15} - % 範囲2 - \__jlreq_setkcatcode:nn {370,400,1F00} {18} - % 範囲3 - \__jlreq_setkcatcode:nn {2000,2070,20A0,20D0,2100,2150,2190,2200,2300,2400,2500,2580,25A0,2600,2700,2900,2980,2B00} {18} - % 範囲4 - \__jlreq_setkcatcode:nn {500,530,590,600,700,750,780,7C0,800,840,8A0,900,980,A00,A80,B00,B80,C00,C80,D00,D80,E00,E80,F00,1000,10A0,1200,1380,13A0,1400,1680,16A0,1700,1720,1740,1760,1780,1800,18B0,1900,1950,1980,19E0,1A00,1A20,1AB0,1B00,1B80,1BC0,1C00,1C50,1C80,1CC0,1CD0,1D00,1D80,1DC0,2400,2440,27C0,27F0,2800,2A00,2C00,4DC0,A4D0,A500,A640,A6A0,A700,A720,A800,A840,A880,A8E0,A900,A930,A960,A980,A9E0,AA00,AA60,AA80,AAE0,AB00,AB30,AB70,ABC0,FB00,FB50,FE00,FE20,FE70,10000,10080,10100,10140,10190,101D0,10280,102A0,102E0,10300,10330,10350,10380,103A0,10400,10450,10480,104B0,10500,10530,10600,10800,10840,10860,10880,108E0,10900,10920,10980,109A0,10A00,10A60,10A80,10AC0,10B00,10B40,10B60,10B80,10C00,10C80,10E60,11000,11080,110D0,11100,11150,11180,111E0,11200,11280,112B0,11300,11400,11480,11580,11600,11660,11680,11700,118A0,11AC0,11C00,11C70,12000,12400,12480,13000,14400,16800,16A40,16AD0,16B00,16F00,16FE0,17000,18800,1B000,1BC00,1BCA0,1D000,1D100,1D200,1D300,1D360,1D400,1D800,1E000,1E800,1E900,1EE00,1F000,1F030,1F0A0,1F100,1F200,1F300,1F600,1F650,1F680,1F700,1F780,1F800,1F900,E000} {15} - % 範囲5(Variation Selectors SupplementはLuaTeX-jaではE01F0--E01EFまで範囲5,他は範囲6) - \__jlreq_setkcatcode:nn {D800,DB80,DC00,E0000,F0000,100000} {15} - % 範囲6 - \__jlreq_setkcatcode:nn {3040,30A0,31F0} {17} % Hiragana,Katakana,Katakana Phonetic Extensions - \__jlreq_setkcatcode:nn {2460,3000,3200,3300,FE10,FE30,FE50,E0100} {18} % Enclosed Alphanumerics,CJK Symbols and Punctuation,Enclosed CJK Letters and Months,CJK Compatibility,Vertical Forms,CJK Compatibility Forms,Small Form Variants,Variation Selectors Supplement - \__jlreq_setkcatcode:nn {2E80,3190,3400,4E00,F900,20000} {16} - % 範囲7 - \__jlreq_setkcatcode:nn {A000,A490} {18} % Yi Syllables,Yi Radicals - \__jlreq_setkcatcode:nn {1100,3130,AC00,D7B0} {19} % Hangul Jamo,Hangul Compatibility Jamo,Hangul Syllables,Hangul Jamo Extended-B - \__jlreq_setkcatcode:nn {2F00,2FF0,3100,31A0,31C0,A830} {16} -\fi - %.. フォント \RequirePackage{lmodern} @@ -1151,11 +1217,18 @@ \emergencystretch 3\jlreq@gol \setlength{\parindent}{1\zw} -\hook_gput_code:nnn { cmd/set@fontsize/after } {.} { +\newcommand{\jlreqparindent}{1\zw} +\apptocmd\set@fontsize { \expandafter\def\expandafter\size@update\expandafter{\size@update\g__jlreq_setfontsizehook_tl} +}{}{ + \ClassWarningNoLine { jlreq } { `\string\apptocmd`~to~`\string\size@update`~failed,~maybe~a~bug} } \tl_new:N \g__jlreq_setfontsizehook_tl -\tl_set:Nn \g__jlreq_setfontsizehook_tl { \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{1\jlreq@zw} } } +\tl_set:Nn \g__jlreq_setfontsizehook_tl { + \tl_if_empty:VF \jlreqparindent { + \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{\jlreqparindent} } + } +} \ifx l\jlreq@engine \@tempskipa=\ltjgetparameter{kanjiskip} \ifdim\@tempskipa=\maxdimen\else @@ -1613,7 +1686,7 @@ % デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる. % 見出しの直前に実行される -\NewHook{./heading/before} +\cs_new:Nn \g__jlreq_hook_beforeheading:n {} % 見出し名一覧を格納する \seq_new:N \l__jlreq_heading_allheadings_seq % 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット} @@ -1668,7 +1741,6 @@ %.. 中/半扉見出し % addcontentslineに渡すやつ:番号出すのと出さないの \NewDocumentCommand{\DeclareTobiraHeading}{ m m +m } { - \ProvideHook{jlreq/heading/before/#1} \seq_put_right:Nn \l__jlreq_heading_allheadings_seq {#1} \seq_remove_duplicates:N \l__jlreq_heading_allheadings_seq \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}% @@ -1747,8 +1819,7 @@ \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\exp_not:o {\jlreq@pagestyle}}\fi \noexpand\secdef{\exp_not:c {jlreq@TobiraHeading@start@#1}}{\exp_not:c {jlreq@TobiraHeading@start@s@#1}}}% \noexpand\def\exp_not:c {#1}{% - \noexpand\UseHook{jlreq/heading/before}% - \noexpand\UseHook{jlreq/heading/before/#1}% + \exp_not:N \g__jlreq_hook_beforeheading:n {#1} \exp_not:c {jlreq@headingcs@#1}% }% }% @@ -2125,12 +2196,18 @@ \jlreq@ifgluezero\jlreq@tempskipb{}{\vskip\jlreq@tempskipb}% \edef\jlreq@do{% \dim_compare:nF { \parskip=0pt } { - \noexpand\AddToHookNext{para/before}{\noexpand\parskip=\the\parskip\noexpand\relax}% + \exp_not:N \cs_set:Nn \exp_not:N \g__jlreq_gyodori_hook_par: { + \noexpand\parskip=\the\parskip\noexpand\relax + \exp_not:n { \cs_set:Nn \g__jlreq_gyodori_hook_par: {} } + } \noexpand\parskip=0pt } }% \expandafter}\jlreq@do } +\cs_set:Nn \g__jlreq_gyodori_hook_par: {} +\PushPostHook{par}{\g__jlreq_gyodori_hook_par:} + % 行取り情報をゲットだぜ % \jlreq@resultに{1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}を入れる @@ -2184,7 +2261,6 @@ % \DeclareBlockHeading{命令名}{レベル}{設定} \seq_new:N \l__jlreq_BlockHeading_allheadings_seq \NewDocumentCommand {\DeclareBlockHeading} { m m +m } { - \ProvideHook{jlreq/heading/before/#1} \def\jlreq@do{\@removeelement{#1}}% \seq_put_right:Nn \l__jlreq_heading_allheadings_seq {#1} \seq_remove_duplicates:N \l__jlreq_heading_allheadings_seq @@ -2416,8 +2492,7 @@ \edef\jlreq@do{% \exp_not:o {\jlreq@do}% \noexpand\edef\exp_not:c {jlreq@headingcs@#1}{\noexpand\unexpanded{% - \noexpand\UseHook{jlreq/heading/before}% - \noexpand\UseHook{jlreq/heading/before/#1}% + \exp_not:N \g__jlreq_hook_beforeheading:n {#1} \exp_not:o {\jlreq@pagebreak}% \tl_if_empty:NF \l__jlreq_pagestyle_tl { \exp_not:N \thispagestyle {\exp_not:o { \l__jlreq_pagestyle_tl } } } \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}% @@ -2802,7 +2877,6 @@ \__jlreq_declare_runin_heading:nnn {#1} {#2} {#3} } \cs_set:Nn \__jlreq_declare_runin_heading:nnn { - \hook_provide:n { jlreq/heading/before/#1 } \def\jlreq@do{\@removeelement{#1}}% \seq_put_right:Nn \l__jlreq_heading_allheadings_seq {#1} \seq_remove_duplicates:N \l__jlreq_heading_allheadings_seq @@ -2861,8 +2935,7 @@ % パラメータトークンを含むので,\edefして\unexpandedで包む \noexpand\edef\exp_not:c {#1}{% \noexpand\unexpanded{% - \exp_not:N \UseHook{jlreq/heading/before}% - \exp_not:N \UseHook{jlreq/heading/before/#1} + \exp_not:N \g__jlreq_hook_beforeheading:n {#1} \exp_not:n {\jlreq@RuninHeading@start{#1}{#2}} {\bool_if:NF \l__jlreq_number_bool {-}} {\exp_not:o {\l__jlreq_label_format_tl}} @@ -2960,7 +3033,6 @@ } \NewDocumentCommand{\DeclareCutinHeading}{ m m +m }{ - \hook_provide:n { jlreq/heading/before/#1 } \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2} \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3} \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading} @@ -2985,8 +3057,7 @@ }{}% \cs_set:Nx \l__jlreq_do: { \exp_not:N \DeclareDocumentCommand \exp_not:c {#1} {m} { - \exp_not:N \UseHook{jlreq/heading/before}% - \exp_not:N \UseHook{jlreq/heading/before/#1}% + \exp_not:N \g__jlreq_hook_beforeheading:n {#1} \exp_not:N \__jlreq_CutinHeading_start:nnnnnnn{#1}{\exp_not:o \l__jlreq_fontcommand_tl}{\exp_not:o \l__jlreq_indent_tl}{\exp_not:o \l__jlreq_after_space_tl}{\exp_not:o \l__jlreq_onelinemax_tl}{\exp_not:o \l__jlreq_twolinemax_tl}{####1} } } @@ -3411,23 +3482,15 @@ \def\jlreq@endnote@texts{} \long\def\jlreq@endnote@addtext#1#2{\tl_gput_right:Nx \jlreq@endnote@texts { \exp_not:n {{{#1}{#2}}} } } % \endnote自身は後で定義する -\NewHook{cmd/endnote/before} -\NewHook{cmd/endnote/after} -\NewHook{cmd/endnotemark/before} -\NewHook{cmd/endnotemark/after} \NewDocumentCommand { \endnotemark }{ O{} } { \jlreq@hook@prenote - \UseHook{cmd/endnote/before} \jlreq@endnotemark{#1} - \UseHook{cmd/endnote/after} \jlreq@hook@postnote } \NewDocumentCommand { \endnotetext } { O{} +m } { \jlreq@endnotetext{#1}{#2} } \long\def\jlreq@endnote#1#2{ \jlreq@hook@prenote - \UseHook{ cmd/endnote/before } \jlreq@endnotemark{#1}\@endnotetext{#2} - \UseHook{ cmd/endnote/after } \jlreq@hook@postnote } \def\jlreq@endnotemark#1{% @@ -3517,11 +3580,13 @@ } \let\@makeendmark=\@makefnmark +\cs_new:Nn \g__jlreq_endnote_hook_beforeheading:n {} +\apptocmd \g__jlreq_hook_beforeheading:n { \g__jlreq_endnote_hook_beforeheading:n {#1} }{}{ + \ClassWarningNoLine { jlreq } { `\string\apptocmd`~to~`\string\g__jlreq_hook_beforeheading:n`~failed,~maybe~a~bug} +} % \theendnoteの出力を仕込む \keys_define:nn { jlreqsetup } { endnote_position .code:n = { - \AddToHook{jlreq/heading/before}[jlreq/endnote]{} - \RemoveFromHook{jlreq/heading/before}[jlreq/endnote] \jlreq@tempafalse % headingsが指定された \jlreq@tempbfalse % paragraphが指定された % \jlreq@tempcにセクション名たちを入れていく @@ -3545,7 +3610,7 @@ \ifjlreq@tempb \DeclareDocumentCommand { \endnote } { O{} +m } { - \AddToHookNext { para/after } { \theendnotes } + \def\par{\@restorepar\theendnotes\par} \jlreq@endnote{##1}{##2} } \else @@ -3555,15 +3620,17 @@ \fi \ifjlreq@tempa - \AddToHook{jlreq/heading/before}[jlreq/endnote]{\theendnotes} + \cs_set:Nn \g__jlreq_endnote_hook_beforeheading:n {\theendnotes} \else - \seq_map_variable:NNn \l_jlreq_tmpa_seq \@tempa { - \tl_if_empty:VF \@tempa { - \AddToHook{jlreq/heading/before/\@tempa}[jlreq/endnote]{} - \RemoveFromHook{jlreq/heading/before/\@tempa}[jlreq/endnote] - \AddToHook{jlreq/heading/before/\@tempa}[jlreq/endnote]{\theendnotes} + \tl_set:Nn \l__jlreq_tmpa_tl {} + \seq_map_inline:Nn \l_jlreq_tmpa_seq { + \tl_if_empty:nF {##1} { + \tl_put_right:Nn \l__jlreq_tmpa_tl { {##1} {\theendnotes} } } } + \cs_set:Nx \g__jlreq_endnote_hook_beforeheading:n { + \exp_not:N \str_case:nn { ##1 } { \exp_not:o { \l__jlreq_tmpa_tl } } + } \fi } } @@ -3579,10 +3646,6 @@ % (2) では\sidenote{見出し}{注中身}を定義 % sidenote_length>0ptの時のみ定義する \dim_compare:nT { \jlreq@sidenote@length > 0pt } { - \ProvideHook{ cmd/sidenote/before } - \ProvideHook{ cmd/sidenote/after } - \ProvideHook{ cmd/sidenotemark/before } - \ProvideHook{ cmd/sidenotemark/after } \def\jlreq@sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名 \long\def\@sidenotetext#1{% \marginpar{\reset@font\footnotesize @@ -3600,14 +3663,14 @@ \__jlreq_jlreqsetup_addtofinally:n { \str_if_eq:VnT \jlreq@sidenote@type { number } { \DeclareDocumentCommand { \sidenote } { O{} +m } { - \jlreq@hook@prenote\UseHook{cmd/sidenote/before} + \jlreq@hook@prenote \jlreq@sidenote{#1}{#2} - \UseHook{cmd/sidenote/after}\jlreq@hook@postnote + \jlreq@hook@postnote } \DeclareDocumentCommand { \sidenotemark } { O{} } { - \jlreq@hook@prenote\UseHook{cmd/sidenotemark/before} + \jlreq@hook@prenote \jlreq@sidenotemark{#1} - \UseHook{cmd/sidenotemark/after}\jlreq@hook@postnote + \jlreq@hook@postnote } \DeclareDocumentCommand { \sidenotetext } { O{} +m } { \jlreq@sidenotetext{#1}{#2} } \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\@sidenotetext{#2}} @@ -3644,8 +3707,8 @@ \let\@makesidemark=\@makefnmark } \str_if_eq:VnT \jlreq@sidenote@type { symbol } {% sidenote_type = symbol - \DeclareDocumentCommand { \sidenote } { m +m } { \UseHook{cmd/sidenote/before}\jlreq@sidenote{#1}{#2}\UseHook{cmd/sidenote/after} } - \DeclareDocumentCommand { \sidenotemark } { m } { \UseHook{cmd/sidenotemark/before}\jlreq@sidenotemark{#1}\UseHook{cmd/sidenote/after} } + \DeclareDocumentCommand { \sidenote } { m +m } { \jlreq@sidenote{#1}{#2} } + \DeclareDocumentCommand { \sidenotemark } { m } { \jlreq@sidenotemark{#1} } \DeclareDocumentCommand { \sidenotetext } { m +m } { \jlreq@sidenotetext{#1}{#2} } \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\jlreq@sidenotetext{#1}{#2}} \edef\jlreq@sidenotemark#1{% @@ -5976,7 +6039,8 @@ \itemindent=\dimexpr\jlreq@theorem@indent\relax \jlreq@theorem@font \item[\hskip \labelsep{\reset@font\jlreq@theorem@label@font #1\ #2(#3)}]} -\AddToHook{package/after/amsthm}{ +\RequirePackage{filehook} +\AtEndOfPackageFile{amsthm}{ \jlreq@saveoriginalcs{proof}% \jlreq@saveoriginalcs{endproof}% \edef\jlreq@do{ |