From 789b6713c1344b831e5e000bf7fb98700caa5e14 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 9 Nov 2020 03:01:20 +0000 Subject: CTAN sync 202011090301 --- macros/latex/contrib/acro/README | 2 +- macros/latex/contrib/acro/acro-manual.pdf | Bin 879954 -> 865976 bytes macros/latex/contrib/acro/acro-manual.tex | 40 +- macros/latex/contrib/acro/acro.sty | 134 ++- macros/latex/contrib/acro/acro2.sty | 2 + macros/latex/contrib/bookmark/README.md | 11 +- macros/latex/contrib/bookmark/bookmark-frozen.dtx | 1073 ++++++++++++++++++++ macros/latex/contrib/bookmark/bookmark.dtx | 250 ++--- macros/latex/contrib/bookmark/bookmark.pdf | Bin 475757 -> 479157 bytes macros/latex/contrib/modiagram/README | 10 +- macros/latex/contrib/modiagram/modiagram.sty | 15 +- macros/latex/contrib/modiagram/modiagram_en.pdf | Bin 528067 -> 542578 bytes macros/latex/contrib/modiagram/modiagram_en.tex | 10 +- .../latex/contrib/nicematrix/nicematrix-french.pdf | Bin 423871 -> 424627 bytes .../latex/contrib/nicematrix/nicematrix-french.tex | 142 ++- macros/latex/contrib/nicematrix/nicematrix.dtx | 649 ++++++++---- macros/latex/contrib/nicematrix/nicematrix.pdf | Bin 1046980 -> 1061552 bytes .../contrib/reledmac/doc-include/migrate-par.dtx | 9 +- .../reledmac/doc-more/page-typesetting-columns.pdf | Bin 40838 -> 40841 bytes .../reledmac/examples/1-criticalendnotes.pdf | Bin 175600 -> 197373 bytes .../contrib/reledmac/examples/1-criticalnotes.pdf | Bin 119720 -> 195586 bytes .../contrib/reledmac/examples/1-sidenotes.pdf | Bin 145283 -> 291128 bytes .../latex/contrib/reledmac/examples/1-tabular.pdf | Bin 187373 -> 280887 bytes .../reledmac/examples/1-verses-doublenumbering.pdf | Bin 121150 -> 197414 bytes .../latex/contrib/reledmac/examples/1-verses.pdf | Bin 121318 -> 197363 bytes .../latex/contrib/reledmac/examples/2-antilabe.pdf | Bin 128416 -> 205371 bytes .../reledmac/examples/2-cross_referencing.pdf | Bin 120386 -> 196250 bytes .../reledmac/examples/2-footnote_spacing.pdf | Bin 123574 -> 199696 bytes .../contrib/reledmac/examples/2-glossaries.pdf | Bin 132844 -> 280642 bytes .../latex/contrib/reledmac/examples/2-indexing.pdf | Bin 185822 -> 279716 bytes .../reledmac/examples/2-lemma_disambigution.pdf | Bin 122378 -> 273882 bytes .../reledmac/examples/2-line_numbers_in_header.pdf | Bin 142433 -> 289371 bytes .../contrib/reledmac/examples/2-linespacing.pdf | Bin 136296 -> 284597 bytes .../reledmac/examples/2-manuscript-apparatus.pdf | Bin 156021 -> 285213 bytes .../contrib/reledmac/examples/2-notes-width.pdf | Bin 126635 -> 202991 bytes .../reledmac/examples/2-one_series_per_pstart.pdf | Bin 131284 -> 208585 bytes .../contrib/reledmac/examples/2-performances.pdf | Bin 133738 -> 281520 bytes .../reledmac/examples/2-reledmac-right-to-left.pdf | Bin 31053 -> 31045 bytes .../examples/2-subdivision-number-in-header.pdf | Bin 212782 -> 304585 bytes .../2-titles_in_line_numbering_with_notes.pdf | Bin 188331 -> 283465 bytes .../examples/2-titles_not_in_line_numbering.pdf | Bin 173338 -> 196014 bytes .../3-reledpar_columns_different_languages.pdf | Bin 23275 -> 23268 bytes .../contrib/reledmac/examples/3-reledpar_mwe.pdf | Bin 93085 -> 172561 bytes ...reledpar_pages_different_languages_lualatex.pdf | Bin 37801 -> 32053 bytes .../3-reledpar_same_page_number_in_both_side.pdf | Bin 135907 -> 284700 bytes ...reledpar_sync_setting_advancedshifted-nomax.pdf | Bin 190058 -> 190058 bytes .../3-reledpar_sync_setting_advancedshifted.pdf | Bin 189289 -> 189290 bytes .../examples/3-reledpar_sync_setting_default.pdf | Bin 168067 -> 168066 bytes .../3-reledpar_sync_setting_nomax-shifted.pdf | Bin 189695 -> 189692 bytes .../examples/3-reledpar_sync_setting_nomax.pdf | Bin 188621 -> 188622 bytes .../examples/3-reledpar_sync_setting_nosync.pdf | Bin 188677 -> 188675 bytes .../examples/3-reledpar_sync_setting_shifted.pdf | Bin 188808 -> 188809 bytes ...mn_mix_with_not_column-continuous-numbering.pdf | Bin 187768 -> 209918 bytes .../4-reledpar_column_mix_with_not_column.pdf | Bin 132837 -> 208856 bytes .../examples/4-reledpar_columns_alignment.pdf | Bin 173906 -> 201188 bytes ...columns_titles_in_line_numbering_with_notes.pdf | Bin 199864 -> 292929 bytes .../examples/4-reledpar_inside-outside-columns.pdf | Bin 123230 -> 200260 bytes .../examples/4-reledpar_one_series_per_pstart.pdf | Bin 144326 -> 221533 bytes .../examples/4-reledpar_pages_long_notes.pdf | Bin 226079 -> 246187 bytes .../examples/4-reledpar_pages_notes_leftpage.pdf | Bin 124679 -> 200801 bytes ...-reledpar_pages_paragraph_separator_between.pdf | Bin 120874 -> 196882 bytes ...r_pages_titles_in_line_numbering_with_notes.pdf | Bin 260966 -> 297242 bytes .../4-reledpar_titles_not_in_line_numbering.pdf | Bin 180904 -> 203241 bytes .../examples/4-reledpar_verse_text_between.pdf | Bin 116963 -> 192355 bytes macros/latex/contrib/reledmac/migration.pdf | Bin 356983 -> 357854 bytes macros/latex/contrib/reledmac/reledmac.dtx | 2 +- macros/latex/contrib/reledmac/reledmac.pdf | Bin 2009886 -> 2009706 bytes macros/latex/contrib/reledmac/reledpar.dtx | 7 +- macros/latex/contrib/reledmac/reledpar.pdf | Bin 988567 -> 989272 bytes macros/latex/contrib/subfiles/subfiles.dtx | 357 ++++--- macros/latex/contrib/subfiles/subfiles.pdf | Bin 246620 -> 237451 bytes macros/latex/contrib/translations/README | 9 +- .../translations-basic-dictionary-brazil.trsl | 136 +++ macros/latex/contrib/translations/translations.sty | 48 +- .../latex/contrib/translations/translations_en.pdf | Bin 500132 -> 497802 bytes .../latex/contrib/translations/translations_en.tex | 24 +- 76 files changed, 2356 insertions(+), 574 deletions(-) create mode 100644 macros/latex/contrib/bookmark/bookmark-frozen.dtx create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-brazil.trsl (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/acro/README b/macros/latex/contrib/acro/README index 1cfc035d62..abe9d6dbce 100644 --- a/macros/latex/contrib/acro/README +++ b/macros/latex/contrib/acro/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the ACRO package v3.2 2020/05/10 +the ACRO package v3.2a 2020/11/08 Typeset Acronyms diff --git a/macros/latex/contrib/acro/acro-manual.pdf b/macros/latex/contrib/acro/acro-manual.pdf index 90a739e61c..63d5b8d77e 100644 Binary files a/macros/latex/contrib/acro/acro-manual.pdf and b/macros/latex/contrib/acro/acro-manual.pdf differ diff --git a/macros/latex/contrib/acro/acro-manual.tex b/macros/latex/contrib/acro/acro-manual.tex index 1d21678c63..49ea2727da 100644 --- a/macros/latex/contrib/acro/acro-manual.tex +++ b/macros/latex/contrib/acro/acro-manual.tex @@ -641,7 +641,7 @@ The usage should be clear. Let's assume you have defined an acronym long-indefinite = an } \end{sourcecode} -Then typical outputs look like this: +The typical outputs look like this: \begin{example} \ac{ufo} \\ \iac{ufo} \\ @@ -1724,6 +1724,44 @@ shown in table~\vref{tab:translations}. \label{tab:translations} \end{table} +\section{Patches}\label{sec:patches} +In several situations it can lead to wrong results if \acro\ marks an acronym +as used too early or at all. This is why it is possible to disable the +mechanism which is responsible: +\begin{commands} + \command{acswitchoff} + This disables the mechanism which marks acronyms as used. After this + command every acronym command like \cs{ac} acts like its starred version. + \command{acswitchon} + This command enables the mechanism again. +\end{commands} + +In certain circumstances \acro\ uses these commands itself. For example it is +often preferable that acronyms are not counted as used in floats, the table of +contents or the lists of figures and tables. This is why \acro\ turns the +mechanism off in these places. + +Certain table environments typeset their contents twice for measurement +purposes. \acro\ tries to disable the usage mechanism during these phases. +The same is true for single line captions from the \pkg{caption} package. + +All these patches can be turned off: +\begin{options} + \keybool{floats}\Module{patch}\Default{true} + En-/disable the \option{floats} patch. + \keybool{lists}\Module{patch}\Default{true} + En-/disable the \option{lists} patch for the table of contents, the list + of figures and the list of tables. + \keybool{tabularx}\Module{patch}\Default{true} + En-/disable the \option{tabularx} patch. + \keybool{ltxtable}\Module{patch}\Default{true} + En-/disable the \option{ltxtable} patch. + \keybool{tabu}\Module{patch}\Default{true} + En-/disable the \option{tabu} patch. + \keybool{caption}\Module{patch}\Default{true} + En-/disable the \option{caption} patch. +\end{options} + \part{Extending \acro}\label{part:extending-acro} \section{Background}\label{sec:background} \subsection{Templates} diff --git a/macros/latex/contrib/acro/acro.sty b/macros/latex/contrib/acro/acro.sty index d272acdc82..1e1bfb4baa 100644 --- a/macros/latex/contrib/acro/acro.sty +++ b/macros/latex/contrib/acro/acro.sty @@ -27,10 +27,10 @@ % setup package: \tl_const:Nn \c_acro_package_name_tl {acro} -\tl_const:Nn \c_acro_date_tl {2020/05/10} +\tl_const:Nn \c_acro_date_tl {2020/11/08} \tl_const:Nn \c_acro_version_major_number_tl {3} \tl_const:Nn \c_acro_version_minor_number_tl {2} -\tl_const:Nn \c_acro_version_subrelease_tl {} +\tl_const:Nn \c_acro_version_subrelease_tl {a} \tl_const:Nx \c_acro_version_number_tl { \c_acro_version_major_number_tl . @@ -295,7 +295,7 @@ \cs_new_protected:Npn \__acro_module_load:n #1 { - \acro_if_module_loaded:nF {#1} + \acro_module_if_loaded:nF {#1} { \acro_module_if_exist:nTF {#1} { @@ -311,7 +311,7 @@ } \cs_generate_variant:Nn \__acro_module_load:n {V} -\prg_new_conditional:Npnn \acro_if_module_loaded:n #1 {p,T,F,TF} +\prg_new_conditional:Npnn \acro_module_if_loaded:n #1 {p,T,F,TF} { \tl_if_in:NnTF \g__acro_modules_loaded_tl {#1} { \prg_return_true: } @@ -332,7 +332,7 @@ % #2: code \cs_new_protected:Npn \acro_module_after:nn #1#2 { - \acro_if_module_loaded:nTF {#1} + \acro_module_if_loaded:nTF {#1} {#2} { \__acro_add_to_module_hook:nnn {#1} {after} {#2} } } @@ -342,7 +342,7 @@ \cs_new_protected:Npn \acro_module_before:nn #1#2 { % TODO: error in T case? - \acro_if_module_loaded:nF {#1} + \acro_module_if_loaded:nF {#1} { \__acro_add_to_module_hook:nnn {#1} {before} {#2} } } @@ -351,7 +351,7 @@ % #3: code \cs_new_protected:Npn \__acro_add_to_module_hook:nnn #1#2#3 { - \acro_if_module_loaded:nF {#1} + \acro_module_if_loaded:nF {#1} { \tl_if_exist:cF {g__acro_module_hook_#1_#2_tl} { \tl_new:c {g__acro_module_hook_#1_#2_tl} } @@ -1857,7 +1857,7 @@ } \cs_new_protected:Npn \acro_use:n #1 - { \clist_map_inline:nn {#1} { \__acro_use:n {#1} } } + { \clist_map_inline:nn {#1} { \__acro_use:n {##1} } } \cs_generate_variant:Nn \acro_use:n {e} \cs_new_protected:Npn \acro_use_all: @@ -1866,10 +1866,10 @@ \cs_new_protected:Npn \__acro_reset:n #1 { \acro_property_set:nnn {#1} {used} {false} - \int_gzero:c {g__acro_ \acro_case_insensitive:n {#1} _int} - \int_compare:nNnF - { \acro_property_get:nn {#1} {usage} } > 0 - { \acro_property_set:nnn {#1} {usage} {0} } + % \int_gzero:c {g__acro_ \acro_case_insensitive:n {#1} _int} + % \int_compare:nNnF + % { \acro_property_get:nn {#1} {usage} } > 0 + % { \acro_property_set:nnn {#1} {usage} {0} } } \cs_new_protected:Npn \acro_reset:n #1 @@ -2748,6 +2748,7 @@ { \g_acro_barrier_int } } } +\cs_generate_variant:Nn \acro_barrier_usage:n {V} % #1: id \cs_new_protected:Npn \acro_set_barriers:n #1 @@ -2940,8 +2941,11 @@ % #1: id % #2: property -\cs_new:Npn \__acro_write_acronym:nn #1#2 +\cs_new_protected:Npn \__acro_write_acronym:nn #1#2 { + \__acro_upper:n { \__acro_article:nn {#1} {#2} } + \bool_if:NT \l__acro_article_bool + { \bool_set_false:N \l__acro_upper_bool } \bool_lazy_and:nnTF { \acro_property_if_eq_p:nn {#2} {long} } { \acro_if_first_p:n {#1} } @@ -2950,7 +2954,6 @@ { \__acro_upper:n { - \__acro_article:nn {#1} {#2} \acro_if_ending_form:nnTF {#1} {#2} { \acro_ending_form:nn {#1} {#2} } { \acro_property_get:nn {#1} {#2} } @@ -3020,7 +3023,7 @@ \bool_if:NF \g__acro_cited_bool { \acro_cite_if:nnT {#1} {#2} { \acro_cite:n {#2} } } \bool_gset_false:N \g__acro_cited_bool - \acro_property_if_set:nnT {#1} {post} + \acro_property_if_set:nnT {#2} {post} { \acro_property_get:nn {#2} {post} } \bool_lazy_all:nT { @@ -3406,8 +3409,8 @@ { \__acro_template_add:nnn {list} {#1} { - \__acro_template_start:nn {list} {#1} \tl_clear_new:N \AcronymTable + \__acro_template_start:nn {list} {#1} #2 \__acro_template_stop:nn {list} {#1} } @@ -4728,42 +4731,89 @@ \msg_new:nnn {acro} {patch} { Patching~ `#1'~ failed.~ Please~ contact~ the~ acro~ author. } +\cs_new_protected:Npn \acro_new_patch:n #1 + { + \bool_new:c {l__acro_patch_#1_bool} + \keys_define:nn + {acro} + { + patch / #1 .bool_set:c = {l__acro_patch_#1_bool} , + patch / #1 .initial:n = true + } + } + +\prg_new_conditional:Npnn \acro_if_patch:n #1 {T,F,TF} + { + \cs_if_exist:cTF {l__acro_patch_#1_bool} + { + \bool_if:cTF {l__acro_patch_#1_bool} + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_false: } + } + +\acro_new_patch:n {floats} +\acro_new_patch:n {lists} +\acro_new_patch:n {tabularx} +\acro_new_patch:n {tabu} +\acro_new_patch:n {ltxtable} +\acro_new_patch:n {caption} + \AtEndPreamble { % floats: - \apptocmd \@floatboxreset - { \acswitchoff } - {} - { \msg_error:nnn {acro} {patch} {floats} } + \acro_if_patch:nT {floats} + { + \apptocmd \@floatboxreset + { \acswitchoff } + {} + { \msg_error:nnn {acro} {patch} {floats} } + } % tables: % * tabularx - \cs_if_exist:NT \TX@trial + \acro_if_patch:nT {tabularx} { - \patchcmd \TX@trial - { \let\hbadness\@tempcnta } - { \acswitchoff\let\hbadness\@tempcnta } - {} - { \msg_error:nnn {acro} {patch} {tabularx} } + \cs_if_exist:NT \TX@trial + { + \patchcmd \TX@trial + { \let\hbadness\@tempcnta } + { \acswitchoff\let\hbadness\@tempcnta } + {} + { \msg_error:nnn {acro} {patch} {tabularx} } + } } % * ltxtable - \cs_if_exist:NT \LTXtable + \acro_if_patch:nT {ltxtable} { - \patchcmd \LTXtable - { \input } - { \acswitchoff\input } - {} - { \msg_error:nnn {acro} {patch} {ltxtable} } + \cs_if_exist:NT \LTXtable + { + \patchcmd \LTXtable + { \input } + { \acswitchoff\input } + {} + { \msg_error:nnn {acro} {patch} {ltxtable} } + } } % * tabu - \cs_if_exist:NT \tabuDisableCommands - { \tabuDisableCommands { \acswitchoff } } + \acro_if_patch:nT {tabu} + { + \cs_if_exist:NT \tabuDisableCommands + { \tabuDisableCommands { \acswitchoff } } + } % contents lists: - \addtocontents {toc} { \acswitchoff } - \addtocontents {lof} { \acswitchoff } - \addtocontents {lot} { \acswitchoff } + \acro_if_patch:nT {lists} + { + \addtocontents {toc} { \acswitchoff } + \addtocontents {lof} { \acswitchoff } + \addtocontents {lot} { \acswitchoff } + } % caption package: - \cs_if_exist:NT \caption@prepareslc - { \tl_gput_right:Nn \caption@prepareslc { \acswitchoff } } + \acro_if_patch:nT {caption} + { + \cs_if_exist:NT \caption@prepareslc + { \tl_gput_right:Nn \caption@prepareslc { \acswitchoff } } + } } \AcroModuleEnd @@ -4895,7 +4945,11 @@ } \NewAcroTemplate {long} - { \acrowrite {long} } + { + \acroifTF {single} + { \acrowrite {single} } + { \acrowrite {long} } + } \NewAcroTemplate {short} { \acrowrite {short} } diff --git a/macros/latex/contrib/acro/acro2.sty b/macros/latex/contrib/acro/acro2.sty index c8eb1d6b99..bed0779122 100644 --- a/macros/latex/contrib/acro/acro2.sty +++ b/macros/latex/contrib/acro/acro2.sty @@ -2482,6 +2482,8 @@ \cs_new_protected:Npn \acro@pages #1#2 { \tl_gset:cn {g__acro_#1_recorded_pages_tl} {#2} } +\bool_new:N \g__acro_rerun_bool + \cs_new_protected:Npn \acro@rerun@check { \bool_if:NT \g__acro_rerun_bool diff --git a/macros/latex/contrib/bookmark/README.md b/macros/latex/contrib/bookmark/README.md index d4437f18fc..5e373e0e7c 100644 --- a/macros/latex/contrib/bookmark/README.md +++ b/macros/latex/contrib/bookmark/README.md @@ -1,6 +1,6 @@ -# bookmarks +# bookmark package for LaTeX -bookmarks package for LaTeX +Version: 2020-11-06 v1.29 This package implements a new bookmark (outline) organization for @@ -10,3 +10,10 @@ are available (URI, GoToR, Named). The bookmarks are generated in the first compile run. Package hyperref uses two runs. + +## Copyright (C) +* 2007, 2009-2011 Heiko Oberdiek +* 2016-2020 Oberdiek Package Support Group + +## License +LATEX Project Public License, version 1.3c or later. diff --git a/macros/latex/contrib/bookmark/bookmark-frozen.dtx b/macros/latex/contrib/bookmark/bookmark-frozen.dtx new file mode 100644 index 0000000000..bf4456829f --- /dev/null +++ b/macros/latex/contrib/bookmark/bookmark-frozen.dtx @@ -0,0 +1,1073 @@ +% \iffalse meta-comment +% +% File: bookmark-frozen.dtx +% Version: 2020-11-06 v1.29 +% Info: PDF bookmarks +% +% Copyright (C) +% 2007-2011 Heiko Oberdiek +% 2016-2020 Oberdiek Package Support Group +% https://github.com/ho-tex/bookmark/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/bookmark/issues +% +% This work consists of the main source file bookmark.dtx +% and the derived files +% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, +% bkm-dvipdfm.def, bkm-dvips.def, +% bkm-pdftex.def, bkm-vtex.def, +% bkm-dvipdfm-2019-12-03.def, bkm-dvips-2019-12-03.def, +% bkm-pdftex-2019-12-03.def, bkm-vtex-2019-12-03.def, +% bookmark-example.tex. +% +% Distribution: +% CTAN:macros/latex/contrib/bookmark/bookmark.dtx +% CTAN:macros/latex/contrib/bookmark/bookmark-frozen.dtx +% CTAN:macros/latex/contrib/bookmark/bookmark.pdf +% +% Unpacking: +% (a) If bookmark.ins is present: +% tex bookmark.ins +% (b) Without bookmark.ins: +% tex bookmark.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{bookmark.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If bookmark.drv is present: +% latex bookmark.drv +% (b) Without bookmark.drv: +% latex bookmark.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex bookmark.dtx +% makeindex -s gind.ist bookmark.idx +% pdflatex bookmark.dtx +% makeindex -s gind.ist bookmark.idx +% pdflatex bookmark.dtx +% +% Installation: +% TDS:tex/latex/bookmark/bookmark.sty +% TDS:tex/latex/bookmark/bkm-dvipdfm.def +% TDS:tex/latex/bookmark/bkm-dvips.def +% TDS:tex/latex/bookmark/bkm-pdftex.def +% TDS:tex/latex/bookmark/bkm-vtex.def +% TDS:tex/latex/bookmark/bkm-dvipdfm-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-dvips-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-pdftex-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-vtex-2019-12-03.def% +% TDS:doc/latex/bookmark/bookmark.pdf +% TDS:doc/latex/bookmark/bookmark-example.tex +% TDS:source/latex/bookmark/bookmark.dtx +% TDS:source/latex/bookmark/bookmark-frozen.dtx +% +% \fi +%<*pdftexfrozen> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bkm-pdftex.def}% + [2019/12/03 v1.28 bookmark driver for pdfTeX (HO)]% +\def\BKM@DO@entry#1#2{% + \begingroup + \kvsetkeys{BKM@DO}{#1}% + \def\BKM@DO@title{#2}% + \ifx\BKM@DO@srcfile\@empty + \else + \BKM@UnescapeHex\BKM@DO@srcfile + \fi + \BKM@UnescapeHex\BKM@DO@title + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@DO@id\endcsname\@empty\@empty + \let\BKM@attr\@empty + \ifx\BKM@DO@flags\@empty + \else + \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% + \fi + \ifx\BKM@DO@color\@empty + \else + \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% + \fi + \ifx\BKM@attr\@empty + \else + \edef\BKM@attr{attr{\BKM@attr}}% + \fi + \let\BKM@action\@empty + \ifx\BKM@DO@gotor\@empty + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@named\@empty + \ifx\BKM@DO@rawaction\@empty + \ifx\BKM@DO@uri\@empty + \ifx\BKM@DO@page\@empty + \PackageError{bookmark}{% + Missing action\BKM@SourceLocation + }\@ehc + \edef\BKM@action{goto page1{/Fit}}% + \else + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{goto page\BKM@DO@page{/\BKM@DO@view}}% + \fi + \else + \BKM@UnescapeHex\BKM@DO@uri + \BKM@EscapeString\BKM@DO@uri + \edef\BKM@action{user{<>}}% + \fi + \else + \BKM@UnescapeHex\BKM@DO@rawaction + \edef\BKM@action{% + user{% + <<% + \BKM@DO@rawaction + >>% + }% + }% + \fi + \else + \BKM@EscapeName\BKM@DO@named + \edef\BKM@action{% + user{<>}% + }% + \fi + \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@DefGotoNameAction\BKM@action\BKM@DO@dest + \fi + \else + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@page\@empty + \def\BKM@DO@page{0}% + \else + \BKM@CalcExpr\BKM@DO@page\BKM@DO@page-1% + \fi + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}% + \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest + \edef\BKM@action{/D(\BKM@DO@dest)}% + \fi + \BKM@UnescapeHex\BKM@DO@gotor + \BKM@EscapeString\BKM@DO@gotor + \edef\BKM@action{% + user{% + <<% + /S/GoToR% + /F(\BKM@DO@gotor)% + \BKM@action + >>% + }% + }% + \fi + \pdfoutline\BKM@attr\BKM@action + count\ifBKM@DO@open\else-\fi\BKM@x@childs + {\BKM@DO@title}% + \endgroup +} +\def\BKM@DefGotoNameAction#1#2{% + \BKM@EscapeString\BKM@DO@dest + \edef#1{goto name{#2}}% +} +\def\BKM@SourceLocation{% + \ifx\BKM@DO@srcfile\@empty + \ifx\BKM@DO@srcline\@empty + \else + .\MessageBreak + Source: line \BKM@DO@srcline + \fi + \else + \ifx\BKM@DO@srcline\@empty + .\MessageBreak + Source: file `\BKM@DO@srcfile'% + \else + .\MessageBreak + Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline + \fi + \fi +} +\RequirePackage{auxhook} +\AddLineBeginMainAux{% + \string\providecommand\string\BKM@entry[2]{}% +} +\newcount\BKM@id +\BKM@id=\z@ +\@namedef{BKM@0}{000} +\newif\ifBKM@sw +\newcommand*{\bookmark}[2][]{% + \if@filesw + \begingroup + \BKM@InitSourceLocation + \def\bookmark@text{#2}% + \BKM@setup{#1}% + \ifx\BKM@srcfile\@empty + \else + \BKM@EscapeHex\BKM@srcfile + \fi + \edef\BKM@prev{\the\BKM@id}% + \global\advance\BKM@id\@ne + \BKM@swtrue + \@whilesw\ifBKM@sw\fi{% + \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ + \BKM@startatrootfalse + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + 0{\BKM@level}0% + }% + \BKM@swfalse + \else + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@prev\endcsname + \ifnum\BKM@level>\BKM@x@level\relax + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + {\BKM@prev}{\BKM@level}0% + }% + \ifnum\BKM@prev>\z@ + \BKM@CalcExpr\BKM@CalcResult\BKM@x@childs+1% + \expandafter\xdef\csname BKM@\BKM@prev\endcsname{% + {\BKM@x@parent}{\BKM@x@level}{\BKM@CalcResult}% + }% + \fi + \BKM@swfalse + \else + \let\BKM@prev\BKM@x@parent + \fi + \fi + }% + \pdfstringdef\BKM@title{\bookmark@text}% + \edef\BKM@FLAGS{\BKM@PrintStyle}% + \csname BKM@HypDestOptHook\endcsname + \BKM@EscapeHex\BKM@dest + \BKM@EscapeHex\BKM@uri + \BKM@EscapeHex\BKM@gotor + \BKM@EscapeHex\BKM@rawaction + \BKM@EscapeHex\BKM@title + \immediate\write\@mainaux{% + \string\BKM@entry{% + id=\number\BKM@id + \ifBKM@open + \ifnum\BKM@level<\BKM@openlevel + ,open% + \fi + \fi + \BKM@auxentry{dest}% + \BKM@auxentry{named}% + \BKM@auxentry{uri}% + \BKM@auxentry{gotor}% + \BKM@auxentry{page}% + \BKM@auxentry{view}% + \BKM@auxentry{rawaction}% + \BKM@auxentry{color}% + \ifnum\BKM@FLAGS>\z@ + ,flags=\BKM@FLAGS + \fi + \BKM@auxentry{srcline}% + \BKM@auxentry{srcfile}% + }{\BKM@title}% + }% + \endgroup + \fi +} +\def\BKM@getx#1#2#3{% + \def\BKM@x@parent{#1}% + \def\BKM@x@level{#2}% + \def\BKM@x@childs{#3}% +} +\def\BKM@auxentry#1{% + \expandafter\ifx\csname BKM@#1\endcsname\@empty + \else + ,#1={\csname BKM@#1\endcsname}% + \fi +} +\def\BKM@InitSourceLocation{% + \edef\BKM@srcline{\the\inputlineno}% + \BKM@LuaTeX@InitFile + \ifx\BKM@srcfile\@empty + \ltx@IfUndefined{currfilepath}{}{% + \edef\BKM@srcfile{\currfilepath}% + }% + \fi +} +\ifluatex + \ifnum\luatexversion>36 % + \def\BKM@LuaTeX@InitFile{% + \begingroup + \ltx@LocToksA={}% + \edef\x{\endgroup + \def\noexpand\BKM@srcfile{% + \the\expandafter\ltx@LocToksA + \directlua{% + if status and status.filename then % + tex.settoks('ltx@LocToksA', status.filename)% + end% + }% + }% + }\x + }% + \else + \let\BKM@LuaTeX@InitFile\relax + \fi +\else + \let\BKM@LuaTeX@InitFile\relax +\fi +\SetupKeyvalOptions{family=BKM@DO,prefix=BKM@DO@} +\DeclareStringOption[0]{id} +\DeclareBoolOption{open} +\DeclareStringOption{flags} +\DeclareStringOption{color} +\DeclareStringOption{dest} +\DeclareStringOption{named} +\DeclareStringOption{uri} +\DeclareStringOption{gotor} +\DeclareStringOption{page} +\DeclareStringOption{view} +\DeclareStringOption{rawaction} +\DeclareStringOption{srcline} +\DeclareStringOption{srcfile} +\AtBeginDocument{% + \let\BKM@entry\BKM@DO@entry +} +\ifBKM@atend + \AfterLastShipout{% + \BKM@EndHook + }% +\fi +% +%<*dvipsfrozen> +\def\BKM@SourceLocation{% + \ifx\BKM@DO@srcfile\@empty + \ifx\BKM@DO@srcline\@empty + \else + .\MessageBreak + Source: line \BKM@DO@srcline + \fi + \else + \ifx\BKM@DO@srcline\@empty + .\MessageBreak + Source: file `\BKM@DO@srcfile'% + \else + .\MessageBreak + Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline + \fi + \fi +} +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bkm-dvips.def}% + [2019/12/03 v1.28 bookmark driver for dvips (HO)]% +\def\BKM@PSHeaderFile#1{% + \special{header=#1}% +} +\def\BKM@filename{\jobname.out.ps} +\BKM@PSHeaderFile\BKM@filename +\RequirePackage{atveryend}[2009/12/07] +\AfterLastShipout{\BKM@pdfmark@out} +\def\BKM@pdfmark@out{% + \if@filesw + \newwrite\BKM@file + \immediate\openout\BKM@file=\BKM@filename\relax + \BKM@write{\@percentchar!}% + \BKM@write{/pdfmark where{pop}}% + \BKM@write{% + {% + /globaldict where{pop globaldict}{userdict}ifelse% + /pdfmark/cleartomark load put% + }% + }% + \BKM@write{ifelse}% + \else + \let\BKM@write\@gobble + \let\BKM@DO@entry\@gobbletwo + \fi +} +\def\BKM@write#{% + \immediate\write\BKM@file +} +\def\BKM@DO@entry#1#2{% + \begingroup + \kvsetkeys{BKM@DO}{#1}% + \ifx\BKM@DO@srcfile\@empty + \else + \BKM@UnescapeHex\BKM@DO@srcfile + \fi + \def\BKM@DO@title{#2}% + \BKM@UnescapeHex\BKM@DO@title + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@DO@id\endcsname\@empty\@empty + \let\BKM@attr\@empty + \ifx\BKM@DO@flags\@empty + \else + \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}% + \fi + \ifx\BKM@DO@color\@empty + \else + \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}% + \fi + \let\BKM@action\@empty + \ifx\BKM@DO@gotor\@empty + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@named\@empty + \ifx\BKM@DO@rawaction\@empty + \ifx\BKM@DO@uri\@empty + \ifx\BKM@DO@page\@empty + \PackageError{bookmark}{% + Missing action\BKM@SourceLocation + }\@ehc + \edef\BKM@action{% + /Action/GoTo% + /Page 1% + /View[/Fit]% + }% + \else + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{% + /Action/GoTo% + /Page \BKM@DO@page + /View[/\BKM@DO@view]% + }% + \fi + \else + \BKM@UnescapeHex\BKM@DO@uri + \BKM@EscapeString\BKM@DO@uri + \edef\BKM@action{% + /Action<<% + /Subtype/URI% + /URI(\BKM@DO@uri)% + >>% + }% + \fi + \else + \BKM@UnescapeHex\BKM@DO@rawaction + \edef\BKM@action{% + /Action<<% + \BKM@DO@rawaction + >>% + }% + \fi + \else + \BKM@EscapeName\BKM@DO@named + \edef\BKM@action{% + /Action<<% + /Subtype/Named% + /N/\BKM@DO@named + >>% + }% + \fi + \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest + \edef\BKM@action{% + /Action/GoTo% + /Dest(\BKM@DO@dest)cvn% + }% + \fi + \else + \ifx\BKM@DO@dest\@empty + \ifx\BKM@DO@page\@empty + \def\BKM@DO@page{1}% + \fi + \ifx\BKM@DO@view\@empty + \def\BKM@DO@view{Fit}% + \fi + \edef\BKM@action{% + /Page \BKM@DO@page + /View[/\BKM@DO@view]% + }% + \else + \BKM@UnescapeHex\BKM@DO@dest + \BKM@EscapeString\BKM@DO@dest + \edef\BKM@action{% + /Dest(\BKM@DO@dest)cvn% + }% + \fi + \BKM@UnescapeHex\BKM@DO@gotor + \BKM@EscapeString\BKM@DO@gotor + \edef\BKM@action{% + /Action/GoToR% + /File(\BKM@DO@gotor)% + \BKM@action + }% + \fi + \BKM@write{[}% + \BKM@write{/Title(\BKM@DO@title)}% + \ifnum\BKM@x@childs>\z@ + \BKM@write{/Count \ifBKM@DO@open\else-\fi\BKM@x@childs}% + \fi + \ifx\BKM@attr\@empty + \else + \BKM@write{\BKM@attr}% + \fi + \BKM@write{\BKM@action}% + \BKM@write{/OUT pdfmark}% + \endgroup +} +\RequirePackage{auxhook} +\AddLineBeginMainAux{% + \string\providecommand\string\BKM@entry[2]{}% +} +\newcount\BKM@id +\BKM@id=\z@ +\@namedef{BKM@0}{000} +\newif\ifBKM@sw +\newcommand*{\bookmark}[2][]{% + \if@filesw + \begingroup + \BKM@InitSourceLocation + \def\bookmark@text{#2}% + \BKM@setup{#1}% + \ifx\BKM@srcfile\@empty + \else + \BKM@EscapeHex\BKM@srcfile + \fi + \edef\BKM@prev{\the\BKM@id}% + \global\advance\BKM@id\@ne + \BKM@swtrue + \@whilesw\ifBKM@sw\fi{% + \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ + \BKM@startatrootfalse + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + 0{\BKM@level}0% + }% + \BKM@swfalse + \else + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@prev\endcsname + \ifnum\BKM@level>\BKM@x@level\relax + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + {\BKM@prev}{\BKM@level}0% + }% + \ifnum\BKM@prev>\z@ + \BKM@CalcExpr\BKM@CalcResult\BKM@x@childs+1% + \expandafter\xdef\csname BKM@\BKM@prev\endcsname{% + {\BKM@x@parent}{\BKM@x@level}{\BKM@CalcResult}% + }% + \fi + \BKM@swfalse + \else + \let\BKM@prev\BKM@x@parent + \fi + \fi + }% + \pdfstringdef\BKM@title{\bookmark@text}% + \edef\BKM@FLAGS{\BKM@PrintStyle}% + \csname BKM@HypDestOptHook\endcsname + \BKM@EscapeHex\BKM@dest + \BKM@EscapeHex\BKM@uri + \BKM@EscapeHex\BKM@gotor + \BKM@EscapeHex\BKM@rawaction + \BKM@EscapeHex\BKM@title + \immediate\write\@mainaux{% + \string\BKM@entry{% + id=\number\BKM@id + \ifBKM@open + \ifnum\BKM@level<\BKM@openlevel + ,open% + \fi + \fi + \BKM@auxentry{dest}% + \BKM@auxentry{named}% + \BKM@auxentry{uri}% + \BKM@auxentry{gotor}% + \BKM@auxentry{page}% + \BKM@auxentry{view}% + \BKM@auxentry{rawaction}% + \BKM@auxentry{color}% + \ifnum\BKM@FLAGS>\z@ + ,flags=\BKM@FLAGS + \fi + \BKM@auxentry{srcline}% + \BKM@auxentry{srcfile}% + }{\BKM@title}% + }% + \endgroup + \fi +} +\def\BKM@getx#1#2#3{% + \def\BKM@x@parent{#1}% + \def\BKM@x@level{#2}% + \def\BKM@x@childs{#3}% +} +\def\BKM@auxentry#1{% + \expandafter\ifx\csname BKM@#1\endcsname\@empty + \else + ,#1={\csname BKM@#1\endcsname}% + \fi +} +\def\BKM@InitSourceLocation{% + \edef\BKM@srcline{\the\inputlineno}% + \BKM@LuaTeX@InitFile + \ifx\BKM@srcfile\@empty + \ltx@IfUndefined{currfilepath}{}{% + \edef\BKM@srcfile{\currfilepath}% + }% + \fi +} +\ifluatex + \ifnum\luatexversion>36 % + \def\BKM@LuaTeX@InitFile{% + \begingroup + \ltx@LocToksA={}% + \edef\x{\endgroup + \def\noexpand\BKM@srcfile{% + \the\expandafter\ltx@LocToksA + \directlua{% + if status and status.filename then % + tex.settoks('ltx@LocToksA', status.filename)% + end% + }% + }% + }\x + }% + \else + \let\BKM@LuaTeX@InitFile\relax + \fi +\else + \let\BKM@LuaTeX@InitFile\relax +\fi +\SetupKeyvalOptions{family=BKM@DO,prefix=BKM@DO@} +\DeclareStringOption[0]{id} +\DeclareBoolOption{open} +\DeclareStringOption{flags} +\DeclareStringOption{color} +\DeclareStringOption{dest} +\DeclareStringOption{named} +\DeclareStringOption{uri} +\DeclareStringOption{gotor} +\DeclareStringOption{page} +\DeclareStringOption{view} +\DeclareStringOption{rawaction} +\DeclareStringOption{srcline} +\DeclareStringOption{srcfile} +\AtBeginDocument{% + \let\BKM@entry\BKM@DO@entry +} +\ifBKM@atend + \AfterLastShipout{% + \BKM@EndHook + }% +\fi +% +%<*dvipdfmfrozen> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bkm-dvipdfm.def}% + [2019/12/03 v1.28 bookmark driver for dvipdfm (HO)]% +\newcount\BKM@id +\BKM@id=\z@ +\@namedef{BKM@0}{000} +\newif\ifBKM@sw +\newcommand*{\bookmark}[2][]{% + \if@filesw + \begingroup + \def\bookmark@text{#2}% + \BKM@setup{#1}% + \edef\BKM@prev{\the\BKM@id}% + \global\advance\BKM@id\@ne + \BKM@swtrue + \@whilesw\ifBKM@sw\fi{% + \def\BKM@abslevel{1}% + \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ + \BKM@startatrootfalse + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + 0{\BKM@level}\BKM@abslevel + }% + \BKM@swfalse + \else + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@prev\endcsname + \ifnum\BKM@level>\BKM@x@level\relax + \BKM@CalcExpr\BKM@abslevel\BKM@x@abslevel+1% + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + {\BKM@prev}{\BKM@level}\BKM@abslevel + }% + \BKM@swfalse + \else + \let\BKM@prev\BKM@x@parent + \fi + \fi + }% + \csname HyPsd@XeTeXBigCharstrue\endcsname + \pdfstringdef\BKM@title{\bookmark@text}% + \edef\BKM@FLAGS{\BKM@PrintStyle}% + \let\BKM@action\@empty + \ifx\BKM@gotor\@empty + \ifx\BKM@dest\@empty + \ifx\BKM@named\@empty + \ifx\BKM@rawaction\@empty + \ifx\BKM@uri\@empty + \ifx\BKM@page\@empty + \PackageError{bookmark}{Missing action}\@ehc + \edef\BKM@action{/Dest[@page1/Fit]}% + \else + \ifx\BKM@view\@empty + \def\BKM@view{Fit}% + \fi + \edef\BKM@action{/Dest[@page\BKM@page/\BKM@view]}% + \fi + \else + \BKM@EscapeString\BKM@uri + \edef\BKM@action{% + /A<<% + /S/URI% + /URI(\BKM@uri)% + >>% + }% + \fi + \else + \edef\BKM@action{/A<<\BKM@rawaction>>}% + \fi + \else + \BKM@EscapeName\BKM@named + \edef\BKM@action{% + /A<>% + }% + \fi + \else + \BKM@EscapeString\BKM@dest + \edef\BKM@action{% + /A<<% + /S/GoTo% + /D(\BKM@dest)% + >>% + }% + \fi + \else + \ifx\BKM@dest\@empty + \ifx\BKM@page\@empty + \def\BKM@page{0}% + \else + \BKM@CalcExpr\BKM@page\BKM@page-1% + \fi + \ifx\BKM@view\@empty + \def\BKM@view{Fit}% + \fi + \edef\BKM@action{/D[\BKM@page/\BKM@view]}% + \else + \BKM@EscapeString\BKM@dest + \edef\BKM@action{/D(\BKM@dest)}% + \fi + \BKM@EscapeString\BKM@gotor + \edef\BKM@action{% + /A<<% + /S/GoToR% + /F(\BKM@gotor)% + \BKM@action + >>% + }% + \fi + \special{pdf:% + out \ifBKM@DvipdfmxOutlineOpen + [% + \ifBKM@open + \ifnum\BKM@level<% + \expandafter\ltx@firstofone\expandafter + {\number\BKM@openlevel} % + \else + -% + \fi + \else + -% + \fi + ] % + \fi + \BKM@abslevel + <<% + /Title(\BKM@title)% + \ifx\BKM@color\@empty + \else + /C[\BKM@color]% + \fi + \ifnum\BKM@FLAGS>\z@ + /F \BKM@FLAGS + \fi + \BKM@action + >>% + }% + \endgroup + \fi +} +\def\BKM@getx#1#2#3{% + \def\BKM@x@parent{#1}% + \def\BKM@x@level{#2}% + \def\BKM@x@abslevel{#3}% +} +\ifBKM@atend + \RequirePackage{atenddvi}% + \AtEndDvi{\BKM@EndHook}% +\fi +% +%<*vtexfrozen> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bkm-vtex.def}% + [2019/12/03 v1.28 bookmark driver for VTeX (HO)]% +\ifvtexpdf +\else + \PackageWarningNoLine{bookmark}{% + The VTeX driver only supports PDF mode% + }% +\fi +\newcount\BKM@id +\BKM@id=\z@ +\@namedef{BKM@0}{00} +\newif\ifBKM@sw +\newcommand*{\bookmark}[2][]{% + \if@filesw + \begingroup + \def\bookmark@text{#2}% + \BKM@setup{#1}% + \edef\BKM@prev{\the\BKM@id}% + \global\advance\BKM@id\@ne + \BKM@swtrue + \@whilesw\ifBKM@sw\fi{% + \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@ + \BKM@startatrootfalse + \def\BKM@parent{0}% + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + 0{\BKM@level}% + }% + \BKM@swfalse + \else + \expandafter\expandafter\expandafter\BKM@getx + \csname BKM@\BKM@prev\endcsname + \ifnum\BKM@level>\BKM@x@level\relax + \let\BKM@parent\BKM@prev + \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{% + {\BKM@prev}{\BKM@level}% + }% + \BKM@swfalse + \else + \let\BKM@prev\BKM@x@parent + \fi + \fi + }% + \pdfstringdef\BKM@title{\bookmark@text}% + \BKM@vtex@title + \edef\BKM@FLAGS{\BKM@PrintStyle}% + \let\BKM@action\@empty + \ifx\BKM@gotor\@empty + \ifx\BKM@dest\@empty + \ifx\BKM@named\@empty + \ifx\BKM@rawaction\@empty + \ifx\BKM@uri\@empty + \ifx\BKM@page\@empty + \PackageError{bookmark}{Missing action}\@ehc + \def\BKM@action{!1}% + \else + \edef\BKM@action{!\BKM@page}% + \fi + \else + \BKM@EscapeString\BKM@uri + \edef\BKM@action{% + % + }% + \fi + \else + \edef\BKM@action{}% + \fi + \else + \BKM@EscapeName\BKM@named + \edef\BKM@action{% + % + }% + \fi + \else + \BKM@EscapeString\BKM@dest + \edef\BKM@action{\BKM@dest}% + \fi + \else + \ifx\BKM@dest\@empty + \ifx\BKM@page\@empty + \def\BKM@page{1}% + \fi + \ifx\BKM@view\@empty + \def\BKM@view{Fit}% + \fi + \edef\BKM@action{/D[\BKM@page/\BKM@view]}% + \else + \BKM@EscapeString\BKM@dest + \edef\BKM@action{/D(\BKM@dest)}% + \fi + \BKM@EscapeString\BKM@gotor + \edef\BKM@action{% + >% + }% + \fi + \ifx\BKM@color\@empty + \let\BKM@RGBcolor\@empty + \else + \expandafter\BKM@toRGB\BKM@color\@nil + \fi + \special{% + !outline \BKM@action;% + p=\BKM@parent,% + i=\number\BKM@id,% + s=% + \ifBKM@open + \ifnum\BKM@level<\BKM@openlevel + o% + \else + c% + \fi + \else + c% + \fi,% + \ifx\BKM@RGBcolor\@empty + \else + c=\BKM@RGBcolor,% + \fi + \ifnum\BKM@FLAGS>\z@ + f=\BKM@FLAGS,% + \fi + t=\BKM@title + }% + \endgroup + \fi +} +\def\BKM@getx#1#2{% + \def\BKM@x@parent{#1}% + \def\BKM@x@level{#2}% +} +\def\BKM@toRGB#1 #2 #3\@nil{% + \let\BKM@RGBcolor\@empty + \BKM@toRGBComponent{#1}% + \BKM@toRGBComponent{#2}% + \BKM@toRGBComponent{#3}% +} +\def\BKM@toRGBComponent#1{% + \dimen@=#1pt\relax + \ifdim\dimen@>\z@ + \ifdim\dimen@<\p@ + \dimen@=255\dimen@ + \advance\dimen@ by 32768sp\relax + \divide\dimen@ by 65536\relax + \dimen@ii=\dimen@ + \divide\dimen@ii by 16\relax + \edef\BKM@RGBcolor{% + \BKM@RGBcolor + \BKM@toHexDigit\dimen@ii + }% + \dimen@ii=16\dimen@ii + \advance\dimen@-\dimen@ii + \edef\BKM@RGBcolor{% + \BKM@RGBcolor + \BKM@toHexDigit\dimen@ + }% + \else + \edef\BKM@RGBcolor{\BKM@RGBcolor FF}% + \fi + \else + \edef\BKM@RGBcolor{\BKM@RGBcolor00}% + \fi +} +\def\BKM@toHexDigit#1{% + \ifcase\expandafter\@firstofone\expandafter{\number#1} % + 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or + 8\or 9\or A\or B\or C\or D\or E\or F% + \fi +} +\begingroup + \catcode`\|=0 % + \catcode`\\=12 % + |gdef|BKM@vtex@title{% + |@onelevel@sanitize|BKM@title + |edef|BKM@title{|expandafter|BKM@vtex@leftparen|BKM@title\(|@nil}% + |edef|BKM@title{|expandafter|BKM@vtex@rightparen|BKM@title\)|@nil}% + |edef|BKM@title{|expandafter|BKM@vtex@zero|BKM@title\0|@nil}% + |edef|BKM@title{|expandafter|BKM@vtex@one|BKM@title\1|@nil}% + |edef|BKM@title{|expandafter|BKM@vtex@two|BKM@title\2|@nil}% + |edef|BKM@title{|expandafter|BKM@vtex@three|BKM@title\3|@nil}% + }% + |gdef|BKM@vtex@leftparen#1\(#2|@nil{% + #1% + |ifx||#2||% + |else + (% + |ltx@ReturnAfterFi{% + |BKM@vtex@leftparen#2|@nil + }% + |fi + }% + |gdef|BKM@vtex@rightparen#1\)#2|@nil{% + #1% + |ifx||#2||% + |else + )% + |ltx@ReturnAfterFi{% + |BKM@vtex@rightparen#2|@nil + }% + |fi + }% + |gdef|BKM@vtex@zero#1\0#2|@nil{% + #1% + |ifx||#2||% + |else + |noexpand|hv@pdf@char0% + |ltx@ReturnAfterFi{% + |BKM@vtex@zero#2|@nil + }% + |fi + }% + |gdef|BKM@vtex@one#1\1#2|@nil{% + #1% + |ifx||#2||% + |else + |noexpand|hv@pdf@char1% + |ltx@ReturnAfterFi{% + |BKM@vtex@one#2|@nil + }% + |fi + }% + |gdef|BKM@vtex@two#1\2#2|@nil{% + #1% + |ifx||#2||% + |else + |noexpand|hv@pdf@char2% + |ltx@ReturnAfterFi{% + |BKM@vtex@two#2|@nil + }% + |fi + }% + |gdef|BKM@vtex@three#1\3#2|@nil{% + #1% + |ifx||#2||% + |else + |noexpand|hv@pdf@char3% + |ltx@ReturnAfterFi{% + |BKM@vtex@three#2|@nil + }% + |fi + }% +|endgroup +\ifBKM@atend + \RequirePackage{atenddvi}% + \AtEndDvi{\BKM@EndHook}% +\fi +% diff --git a/macros/latex/contrib/bookmark/bookmark.dtx b/macros/latex/contrib/bookmark/bookmark.dtx index 49ed2e897d..c4431428b9 100644 --- a/macros/latex/contrib/bookmark/bookmark.dtx +++ b/macros/latex/contrib/bookmark/bookmark.dtx @@ -1,12 +1,12 @@ % \iffalse meta-comment % % File: bookmark.dtx -% Version: 2019/12/03 v1.28 +% Version: 2020-11-06 v1.29 % Info: PDF bookmarks % % Copyright (C) % 2007-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group +% 2016-2020 Oberdiek Package Support Group % https://github.com/ho-tex/bookmark/issues % % This work may be distributed and/or modified under the @@ -28,12 +28,15 @@ % This work consists of the main source file bookmark.dtx % and the derived files % bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, -% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, -% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, +% bkm-dvipdfm.def, bkm-dvips.def, +% bkm-pdftex.def, bkm-vtex.def, +% bkm-dvipdfm-2019-12-03.def, bkm-dvips-2019-12-03.def, +% bkm-pdftex-2019-12-03.def, bkm-vtex-2019-12-03.def, % bookmark-example.tex. % % Distribution: % CTAN:macros/latex/contrib/bookmark/bookmark.dtx +% CTAN:macros/latex/contrib/bookmark/bookmark-frozen.dtx % CTAN:macros/latex/contrib/bookmark/bookmark.pdf % % Unpacking: @@ -66,13 +69,16 @@ % TDS:tex/latex/bookmark/bookmark.sty % TDS:tex/latex/bookmark/bkm-dvipdfm.def % TDS:tex/latex/bookmark/bkm-dvips.def -% TDS:tex/latex/bookmark/bkm-dvipsone.def -% TDS:tex/latex/bookmark/bkm-textures.def % TDS:tex/latex/bookmark/bkm-pdftex.def % TDS:tex/latex/bookmark/bkm-vtex.def +% TDS:tex/latex/bookmark/bkm-dvipdfm-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-dvips-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-pdftex-2019-12-03.def +% TDS:tex/latex/bookmark/bkm-vtex-2019-12-03.def% % TDS:doc/latex/bookmark/bookmark.pdf % TDS:doc/latex/bookmark/bookmark-example.tex % TDS:source/latex/bookmark/bookmark.dtx +% TDS:source/latex/bookmark/bookmark-frozen.dtx % %<*ignore> \begingroup @@ -89,7 +95,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: bookmark 2019/12/03 v1.28 PDF bookmarks (HO)} +\Msg{* Package: bookmark 2020-11-06 v1.29 PDF bookmarks (HO)} \Msg{************************************************************************} \keepsilent @@ -101,11 +107,11 @@ This is a generated file. Project: bookmark -Version: 2019/12/03 v1.28 +Version: 2020-11-06 v1.29 Copyright (C) 2007-2011 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group + 2016-2020 Oberdiek Package Support Group This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -124,11 +130,12 @@ Heiko Oberdiek and the Oberdiek Package Support Group https://github.com/ho-tex/bookmark/issues -This work consists of the main source file bookmark.dtx +This work consists of the main source file bookmark.dtx and bookmark-frozen.dtx and the derived files bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv, - bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def, - bkm-textures.def, bkm-pdftex.def, bkm-vtex.def, + bkm-dvipdfm.def, bkm-dvips.def, bkm-pdftex.def, bkm-vtex.def, + bkm-dvipdfm-2019-12-03.def, bkm-dvips-2019-12-03.def, + bkm-pdftex-2019-12-03.def, bkm-vtex-2019-12-03.def, bookmark-example.tex. \endpreamble @@ -141,12 +148,14 @@ and the derived files \file{bookmark.sty}{\from{bookmark.dtx}{package}}% \file{bkm-dvipdfm.def}{\from{bookmark.dtx}{dvipdfm}}% \file{bkm-dvips.def}{\from{bookmark.dtx}{dvips,pdfmark}}% - \file{bkm-dvipsone.def}{\from{bookmark.dtx}{dvipsone,pdfmark}}% - \file{bkm-textures.def}{\from{bookmark.dtx}{textures,pdfmark}}% \file{bkm-pdftex.def}{\from{bookmark.dtx}{pdftex}}% \file{bkm-vtex.def}{\from{bookmark.dtx}{vtex}}% \usedir{doc/latex/bookmark}% \file{bookmark-example.tex}{\from{bookmark.dtx}{example}}% + \file{bkm-pdftex-2019-12-03.def}{\from{bookmark-frozen.dtx}{pdftexfrozen}}% + \file{bkm-dvips-2019-12-03.def}{\from{bookmark-frozen.dtx}{dvipsfrozen}}% + \file{bkm-vtex-2019-12-03.def}{\from{bookmark-frozen.dtx}{vtexfrozen}}% + \file{bkm-dvipdfm-2019-12-03.def}{\from{bookmark-frozen.dtx}{dvipdfmfrozen}}% } \catcode32=13\relax% active space @@ -157,8 +166,9 @@ and the derived files \Msg{* files into a directory searched by TeX:} \Msg{*} \Msg{* bookmark.sty, bkm-dvipdfm.def, bkm-dvips.def,} -\Msg{* bkm-dvipsone.def, bkm-textures.def, bkm-pdftex.def,} -\Msg{* bkm-vtex.def} +\Msg{* bkm-pdftex.def, bkm-vtex.def, bkm-dvipdfm-2019-12-03.def,} +\Msg{* bkm-dvips-2019-12-03.def, bkm-pdftex-2019-12-03.def,} +\Msg{* and bkm-vtex-2019-12-03.def} \Msg{*} \Msg{* To produce the documentation run the file `bookmark.drv'} \Msg{* through LaTeX.} @@ -175,7 +185,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bookmark.drv}% - [2019/12/03 v1.28 PDF bookmarks (HO)]% + [2020-11-06 v1.29 PDF bookmarks (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \begin{document} @@ -189,7 +199,7 @@ and the derived files % \GetFileInfo{bookmark.drv} % % \title{The \xpackage{bookmark} package} -% \date{2019/12/03 v1.28} +% \date{2020-11-06 v1.29} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/bookmark/issues}}} % @@ -287,7 +297,6 @@ and the derived files % \subsubsection{Driver options} % % Supported drivers are \xoption{pdftex}, \xoption{dvips}, -% \xoption{dvipsone}, \xoption{textures}, % \xoption{dvipdfm} (\xoption{xetex}), and \xoption{vtex}. % The \hologo{TeX} engines \hologo{pdfTeX}, \hologo{XeTeX}, % and \hologo{VTeX} are automatically detected. @@ -297,18 +306,18 @@ and the derived files % \begin{quote} % |\def\BookmarkDriverDefault{dvipdfm}| % \end{quote} +% The current versions of the drivers uses new \LaTeX-hooks. If an +% older format than 2020-10-01 is detected frozen versions of +% the previous drivers are used as fallback. +% +% \paragraph{Open bookmarks with dvipdfmx.} Older version of +% the package had an option \xoption{dvipdfmx-outline-open} +% to activate code which allows to specify the open +% status of an outline entry. +% The package now assumes that all used dvipdfmx version are current enough to +% understand this code and so activates the code always. +% The option itself will be ignored. % -% \paragraph{Open bookmarks with dvipdfmx.} Since 2007-04-25 the -% cvs version of dvipmdfmx contains a patch that extends the -% \cs{special} for bookmarks in order to specify the open status of -% an outline entry. Option \xoption{dvipdfmx-outline-open} notifies -% the package that the dvi driver program understands this kind -% of \cs{special}. Alternatively \cs{SpecialDvipdfmxOutlineOpen} -% can be defined as number one in the configuration file or before -% the package is loaded, e.g.: -% \begin{quote} -% |\chardef\SpecialDvipdfmxOutlineOpen=1\relax| -% \end{quote} % % \subsubsection{Layout options} % @@ -396,7 +405,7 @@ and the derived files % unhappily the file name is a secret. The package supports % some ways to get the file name: % \begin{itemize} -% \item If \hologo{LuaTeX} (indenpendently from DVI or PDF modus) +% \item If \hologo{LuaTeX} (independently from DVI or PDF modus) % is running, then its |status.filename| is used automatically. % \item Package \cs{currfile} \cite{currfile} redefines \hologo{LaTeX} % internals to keep track of the file name. If the package @@ -607,12 +616,11 @@ and the derived files % adding bookmarks at the end of the document depends % on the driver. % -% Some drivers -% (\xoption{pdftex}, \xoption{dvips}, \xoption{dvipsone}, -% \xoption{textures}) use package \xpackage{atveryend}'s +% The driver \xoption{pdftex} +% use package \xpackage{atveryend}'s % for this purpose. \cs{AtEndDocument} is too early, % the last page might not been shipped out. Because the \xext{aux} -% file is needed, these drivers use \cs{AfterLastShipout}. +% file is needed, this driver use \cs{AfterLastShipout}. % % The implementation of the other drivers % (\xoption{dvipdfm}, \xoption{xetex}, \xoption{vtex}) @@ -622,6 +630,8 @@ and the derived files % helps. It puts its argument on last page of the document. % Two \hologo{LaTeX} runs are necessary at least, because % the last page is detected by a reference. +% +% \xoption{dvips} uses now the new LaTeX hook \texttt{shipout/lastpage}. % \item % The time of expansion of the argument of \cs{BookmarkAtEnd} % is not specified. This can happen immediately or at the end @@ -752,7 +762,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bookmark}% - [2019/12/03 v1.28 PDF bookmarks (HO)]% + [2020-11-06 v1.29 PDF bookmarks (HO)]% % \end{macrocode} % % \subsubsection{Requirements} @@ -1622,23 +1632,13 @@ and the derived files % \begin{macrocode} \BKM@DefineDriverKey{pdftex} \BKM@DefineDriverKey{dvips} -\BKM@DefineDriverKey{dvipsone} -\BKM@DefineDriverKey{textures} \BKM@DefineDriverKey{dvipdfm} \BKM@DefineDriverKey{dvipdfmx} \BKM@DefineDriverKey{xetex} \BKM@DefineDriverKey{vtex} \define@key{BKM}{dvipdfmx-outline-open}[true]{% - \expandafter\ifx\csname if#1\expandafter\endcsname - \csname iftrue\endcsname - \chardef\SpecialDvipdfmxOutlineOpen\@ne - \else - \chardef\SpecialDvipdfmxOutlineOpen\z@ - \fi -} -\g@addto@macro\BKM@DisableOptions{% - \DisableKeyvalOption{BKM}{dvipdfmx-outline-open}% -} + \PackageWarning{bookmark}{Option 'dvipdfmx-outline-open' is obsolete + and ignored}{}} % \end{macrocode} % \begin{macro}{\bookmark@driver} % \begin{macrocode} @@ -1709,22 +1709,6 @@ and the derived files % \paragraph{Driver validation and loading.} % % \begin{macrocode} -\newif\ifBKM@DvipdfmxOutlineOpen -\ltx@IfUndefined{SpecialDvipdfmxOutlineOpen}{% - \ifxetex - \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in % - \else - \chardef\SpecialDvipdfmxOutlineOpen\ltx@one - \BKM@DvipdfmxOutlineOpentrue - \fi - \fi -}{% - \ifnum\SpecialDvipdfmxOutlineOpen>\z@ - \BKM@DvipdfmxOutlineOpentrue - \fi -} -% \end{macrocode} -% \begin{macrocode} \def\BKM@temp{dvipdfmx}% \ifx\BKM@temp\BKM@driver \def\BKM@driver{dvipdfm}% @@ -1778,6 +1762,8 @@ and the derived files \fi \fi \fi +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2020/10/01}{}{\edef\BKM@driver{\BKM@driver-2019-12-03}} \InputIfFileExists{bkm-\BKM@driver.def}{}{% \PackageError{bookmark}{% Unsupported driver `\BKM@driver'.\MessageBreak @@ -1843,7 +1829,7 @@ and the derived files \let\partnumberline\@gobble \let\chapternumberline\@gobble \fi - \bookmark[level=#4,dest={#3}]{#2}% + \bookmark[level=#4,dest={\HyperDestNameFilter{#3}}]{#2}% \endgroup \fi \fi @@ -1867,7 +1853,7 @@ and the derived files %<*dvipdfm> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvipdfm.def}% - [2019/12/03 v1.28 bookmark driver for dvipdfm (HO)]% + [2020-11-06 v1.29 bookmark driver for dvipdfm (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@id} @@ -1990,7 +1976,7 @@ and the derived files }% \fi \special{pdf:% - out \ifBKM@DvipdfmxOutlineOpen + out [% \ifBKM@open \ifnum\BKM@level<% @@ -2003,7 +1989,6 @@ and the derived files -% \fi ] % - \fi \BKM@abslevel <<% /Title(\BKM@title)% @@ -2042,7 +2027,7 @@ and the derived files %<*vtex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-vtex.def}% - [2019/12/03 v1.28 bookmark driver for VTeX (HO)]% + [2020-11-06 v1.29 bookmark driver for VTeX (HO)]% % \end{macrocode} % % \begin{macrocode} @@ -2373,7 +2358,7 @@ and the derived files %<*pdftex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-pdftex.def}% - [2019/12/03 v1.28 bookmark driver for pdfTeX (HO)]% + [2020-11-06 v1.29 bookmark driver for pdfTeX (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@DO@entry} @@ -2529,55 +2514,28 @@ and the derived files %<*dvips> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvips.def}% - [2019/12/03 v1.28 bookmark driver for dvips (HO)]% + [2020-11-06 v1.29 bookmark driver for dvips (HO)]% % \end{macrocode} % \begin{macro}{\BKM@PSHeaderFile} % \begin{macrocode} \def\BKM@PSHeaderFile#1{% - \special{header=#1}% + \special{PSfile=#1}% } % \end{macrocode} -% \end{macro} -% \begin{macrocode} -% -% \end{macrocode} -% -% \subsubsection{Driver dvipsone} -% -% \begin{macrocode} -%<*dvipsone> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-dvipsone.def}% - [2019/12/03 v1.28 bookmark driver for dvipsone (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} +% \begin{macro}{\BKM@filename} % \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{header=#1}% -} +\def\BKM@filename{\jobname.out.ps} % \end{macrocode} % \end{macro} % \begin{macrocode} -% -% \end{macrocode} -% -% \subsubsection{Driver textures} -% -% \begin{macrocode} -%<*textures> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{bkm-textures.def}% - [2019/12/03 v1.28 bookmark driver for textures (HO)]% -% \end{macrocode} -% \begin{macro}{\BKM@PSHeaderFile} -% \begin{macrocode} -\def\BKM@PSHeaderFile#1{% - \special{prePostScriptfile #1}% -} +\AddToHook{shipout/lastpage}{% + \BKM@pdfmark@out + \BKM@PSHeaderFile\BKM@filename + } % \end{macrocode} % \end{macro} % \begin{macrocode} -% +% % \end{macrocode} % % \subsubsection{Common part} @@ -2585,19 +2543,6 @@ and the derived files % \begin{macrocode} %<*pdfmark> % \end{macrocode} -% \begin{macro}{\BKM@filename} -% \begin{macrocode} -\def\BKM@filename{\jobname.out.ps} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\BKM@PSHeaderFile\BKM@filename -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{atveryend}[2009/12/07] -\AfterLastShipout{\BKM@pdfmark@out} -% \end{macrocode} % % \begin{macro}{\BKM@pdfmark@out} % Do not use package \xpackage{rerunfilecheck} here, because @@ -2771,12 +2716,8 @@ and the derived files % \subsubsection{Write auxiliary file} % % \begin{macrocode} -\RequirePackage{auxhook} -% \end{macrocode} -% \begin{macrocode} -\AddLineBeginMainAux{% - \string\providecommand\string\BKM@entry[2]{}% -} +\AddToHook{begindocument}{% + \immediate\write\@mainaux{\string\providecommand\string\BKM@entry[2]{}}} % \end{macrocode} % % \begin{macro}{\BKM@id} @@ -3005,46 +2946,44 @@ and the derived files % % \subsubsection{Drivers using hooks at end of document} % -% The following drivers use package \xpackage{atveryend}'s -% \cs{AfterLastShipout}, because they still need the -% \xext{aux} file. +% Driver \xoption{pdftex} use the LaTeX hook \xoption{enddocument/afterlastpage} +% (which is equivalent to the previously used +% \cs{AfterLastShipout} of \xpackage{atveryend}'s), +% because it still needs the \xext{aux} file. It uses +% uses \cs{pdfoutline} for the bookmakrs that can be used after the last page. % \begin{itemize} % \item % Driver \xoption{pdftex} uses \cs{pdfoutline} that can % be used after the last page. -% \item -% PostScript drivers such as -% \xoption{dvips} use an external PostScript header file -% for the bookmarks. File writing can be done after -% the last shipout page, but before the \xext{aux} file is closed. % \end{itemize} % \begin{macrocode} -%<*pdftex|pdfmark> +%<*pdftex> \ifBKM@atend - \AfterLastShipout{% + \AddToHook{enddocument/afterlastpage}{% \BKM@EndHook }% \fi -% +% % \end{macrocode} % -% \subsubsection{Drivers using \cs{AtEndDvi}} +% \subsubsection{Drivers using \xoption{shipout/lastpage}} % % The other drivers implement \cs{bookmark} using \cs{special} % commands. Thus the last bookmarks must be put on the last page, % not afterwards. % \cs{AtEndDocument} cannot be used, because it is too late, the -% last page can already be output. Therefore we use package -% \xpackage{atenddvi} that uses the help of packages \xpackage{atbegshi} -% and \xpackage{zref}. The argument of \cs{AtEndDvi} is put -% at the end of the last page. At least two \hologo{LaTeX} runs are necessary. -% \begin{macrocode} -%<*dvipdfm|vtex> +% last page can already be output. Therefore we use the +% LaTeX hook \xoption{shipout/lastpage}. +% At least two \hologo{LaTeX} runs are necessary. +% The postscript driver \xoption{dvips} use an external PostScript file +% for the bookmarks. The file writing has been moved to the +% the last shipout page too to avoid conflicts with pgf. +% \begin{macrocode} +%<*dvipdfm|vtex|pdfmark> \ifBKM@atend - \RequirePackage{atenddvi}% - \AtEndDvi{\BKM@EndHook}% + \AddToHook{shipout/lastpage}{\BKM@EndHook}% \fi -% +% % \end{macrocode} % % \section{Installation} @@ -3097,8 +3036,6 @@ and the derived files % bookmark.sty & tex/latex/bookmark/bookmark.sty\\ % bkm-dvipdfm.def & tex/latex/bookmark/bkm-dvipdfm.def\\ % bkm-dvips.def & tex/latex/bookmark/bkm-dvips.def\\ -% bkm-dvipsone.def & tex/latex/bookmark/bkm-dvipsone.def\\ -% bkm-textures.def & tex/latex/bookmark/bkm-textures.def\\ % bkm-pdftex.def & tex/latex/bookmark/bkm-pdftex.def\\ % bkm-vtex.def & tex/latex/bookmark/bkm-vtex.def\\ % bookmark.pdf & doc/latex/bookmark/bookmark.pdf\\ @@ -3424,7 +3361,7 @@ and the derived files % \end{Version} % \begin{Version}{2016/05/17 v1.26} % \item -% define \cs{pdfbookmark} to allow pdftex driver to be used with Lua\TeX. +% define \cs{pdfoutline} to allow pdftex driver to be used with Lua\TeX. % \end{Version} % \begin{Version}{2019/06/04 v1.27} % \item @@ -3434,9 +3371,22 @@ and the derived files % \begin{Version}{2019/12/03 v1.28} % \item % Documentation updates. -% \item adjust package loading (all required packages already loade +% \item adjust package loading (all required packages already loaded % by \xpackage{hyperref}). % \end{Version} +% \begin{Version}{2020-11-06 v1.29} +% \item Adapted the dvips to avoid a clash with pgf. +% https://github.com/pgf-tikz/pgf/issues/944 +% \item All drivers now use the new LaTeX hooks +% and so require a format 2020-10-01 or newer. The older +% drivers are provided as frozen versions and are used if an older +% format is detected. +% \item Added support for destlabel option of hyperref, https://github.com/ho-tex/bookmark/issues/1 +% \item Removed the \xoption{dvipsone} and \xoption{textures} driver. +% \item Removed the code for option \xoption{dvipdfmx-outline-open} +% and \cs{SpecialDvipdfmxOutlineOpen}. All dvipdfmx version should now support +% this out-of-the-box. +% \end{Version} % \end{History} % % \PrintIndex diff --git a/macros/latex/contrib/bookmark/bookmark.pdf b/macros/latex/contrib/bookmark/bookmark.pdf index e4fbe0984c..75c9c98b24 100644 Binary files a/macros/latex/contrib/bookmark/bookmark.pdf and b/macros/latex/contrib/bookmark/bookmark.pdf differ diff --git a/macros/latex/contrib/modiagram/README b/macros/latex/contrib/modiagram/README index 9dfa85bee4..bfbd7741e7 100644 --- a/macros/latex/contrib/modiagram/README +++ b/macros/latex/contrib/modiagram/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the MODIAGRAM package 2019/10/31 v0.3 +the MODIAGRAM package 2020/11/08 v0.3a easy creation of molecular orbital diagrams @@ -11,15 +11,15 @@ E-Mail: contact@mychemistry.eu If you have any ideas, questions, suggestions or bugs to report, please feel free to contact me. -------------------------------------------------------------------------- -Copyright 2011--2019 Clemens Niederberger +Copyright 2011--2020 Clemens Niederberger This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 +conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of LaTeX -version 2005/12/01 or later. +and version 1.3c or later is part of all distributions of LaTeX +version 2008/05/04 or later. This work has the LPPL maintenance status `maintained'. diff --git a/macros/latex/contrib/modiagram/modiagram.sty b/macros/latex/contrib/modiagram/modiagram.sty index 2064105ae6..ec1e46beba 100644 --- a/macros/latex/contrib/modiagram/modiagram.sty +++ b/macros/latex/contrib/modiagram/modiagram.sty @@ -11,15 +11,15 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011--2019 Clemens Niederberger +% Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008/05/04 or later. % % This work has the LPPL maintenance status `maintained'. % @@ -32,8 +32,8 @@ \usetikzlibrary{calc,arrows} \ProvidesExplPackage {modiagram} - {2019/10/31} - {0.3} + {2020/11/08} + {0.3a} {easy creation of molecular orbital diagrams} % --------------------------------------------------------------------------- % @@ -507,7 +507,6 @@ % display 2s orbital \cs_new_protected:Npn \__modiagram_two_s: { - \dim_show:N \l__modiagram_atom_two_s_dim \bool_if:NT \l__modiagram_atom_two_s_bool { \bool_if:NTF \l__modiagram_atom_left_bool @@ -2132,7 +2131,7 @@ Version history 2019/10/31 version 0.3 - correct wrong expl3 code - rename `MOdiagram' into `modiagram' - rename \MOsetup into \setmodiagram - +2020/11/08 version 0.3a - fix spurious \show TODO - reduce code duplication diff --git a/macros/latex/contrib/modiagram/modiagram_en.pdf b/macros/latex/contrib/modiagram/modiagram_en.pdf index 4aefd6b5fb..ceb3198091 100644 Binary files a/macros/latex/contrib/modiagram/modiagram_en.pdf and b/macros/latex/contrib/modiagram/modiagram_en.pdf differ diff --git a/macros/latex/contrib/modiagram/modiagram_en.tex b/macros/latex/contrib/modiagram/modiagram_en.tex index 049f7a0da0..57531b5012 100644 --- a/macros/latex/contrib/modiagram/modiagram_en.tex +++ b/macros/latex/contrib/modiagram/modiagram_en.tex @@ -13,15 +13,15 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011--2019 Clemens Niederberger +% Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008/05/04 or later. % % This work has the LPPL maintenance status `maintained'. % @@ -31,7 +31,7 @@ % README and the derived file modiagram_en.pdf. % -------------------------------------------------------------------------- \documentclass[load-preamble+]{cnltx-doc} -\usepackage[utf8]{inputenc} + \usepackage{modiagram} \setcnltx{ diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf index 134a5ab09f..d2425b4bb2 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix-french.pdf and b/macros/latex/contrib/nicematrix/nicematrix-french.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index be326a01d4..52949c1d76 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -413,12 +413,22 @@ Dans les environnements de \pkg{nicematrix}, on peut utiliser la commande |\Block| pour placer un élément au centre d'un rectangle de cases fusionnées. La commande |\Block| doit être utilisée dans la case supérieure gauche du bloc -avec deux arguments. Le premier argument est la taille de ce bloc avec la -syntaxe $i$-$j$ où $i$ est le nombre de rangées et $j$ le nombre de colonnes du -bloc. Le deuxième argument, est, sans surprise, le contenu du bloc. +avec deux arguments. + +\begin{itemize} +\item Le premier argument est la taille de ce bloc avec la syntaxe $i$-$j$ où +$i$ est le nombre de rangées et $j$ le nombre de colonnes du bloc. + +\colorbox{yellow!50}{\bfseries Nouveau 5.6}\enskip Si cet argument est laissé +blanc, la valeur par défaut est |1-1|. Si le nombre de rangées n'est pas +indiqué, le bloc s'étend jusqu'à la dernière rangée (idem pour les colonnes). + +\item Le deuxième argument, est le contenu du bloc. On peut utiliser |\\| dans +ce contenu pour avoir un contenu sur plusieurs lignes. Dans |{NiceTabular}|, le +contenu est composé en mode texte tandis que, dans les autres environnements, il +est composé en mode mathématique. +\end{itemize} -Dans |{NiceTabular}|, le contenu est composé en mode texte. Dans les autres -environnements, il est composé en mode mathématique. \interitem @@ -447,7 +457,10 @@ On peut souhaiter agrandir la taille du «$A$» placé dans le bloc de l'exemple précédent. Comme il est composé en mode mathématique, on ne peut pas directement utiliser une commande comme |\large|, |\Large| ou |\LARGE|. C'est pourquoi une option à mettre entre chevrons est proposée par |\Block| pour spécifier du code -LaTeX qui sera inséré \emph{avant} le début du mode mathématique. +LaTeX qui sera inséré \emph{avant} le début du mode mathématique.\footnote{Cet + argument entre chevrons peut aussi être utilisé pour insérer une commande de + fonte comme |\bfseries| dans le cas où la commande |\\| est utilisée dans le + contenu du bloc.} \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -469,8 +482,7 @@ $\begin{bNiceArray}{ccc|c}[margin] \bigskip -\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut régler le positionnement -horizontal du bloc avec l'une des clés |l|, |c| et |r|. +On peut régler le positionnement horizontal du bloc avec l'une des clés |l|, |c| et |r|. \medskip @@ -493,9 +505,10 @@ $\begin{bNiceArray}{ccc|c}[margin] \interitem -\textbf{On doit remarquer que, par défaut, les blocs ne créent pas d'espace} -(seuls les blocks mono-colonne font exception dans une certaine mesure : voir -plus bas). +\textbf{On doit remarquer que, par défaut, les blocs ne créent pas d'espace}. Il +n'y a exception que pour les blocs mono-rangée et les blocs mono-colonne comme +expliqué juste après. + \medskip Dans l'exemple suivant, on a dû élargir à la main les colonnes 2 et 3 (avec la @@ -524,6 +537,7 @@ arum & iris & jacinthe & muguet + \subsection{Les blocs mono-colonne} \colorbox{yellow!30}{Nouveau 5.4}\enskip Les blocs mono-colonne ont un @@ -534,7 +548,7 @@ largeur de la colonne courante. \item La spécification d'alignement horizontal donnée par le type de colonne (|c|, |r| ou |l|) est prise en compte pour le bloc (mais le bloc peut -avoir sa propre specification d'alignement horizontal). +avoir sa propre spécification d'alignement horizontal). \item Les spécifications de fontes imposées à une colonne via la construction |>{...}| dans le préambule du tableau sont prises en compte pour les @@ -574,6 +588,63 @@ Henri & 14 \\ \hline \end{scope} +\subsection{Les blocs mono-rangée} + +\colorbox{yellow!50}{\textbf{Nouveau 5.6}}\enskip Pour les blocs mono-rangée, la +hauteur (\emph{height}) et la profondeur (\emph{depth}) naturelles sont prises en +compte pour la hauteur et la largeur de la rangée en cours (comme le fait la +commande standard |\multicolumn| de LaTeX). + + + + +\subsection{Les blocs mono-cellule} + +Les blocs mono-cellule héritent des caractéristiques des blocs mono-colonne et +des blocs mono-rangée. + +\medskip +Il y a deux raisons à l'utilisation d'un bloc mono-cellule. + +\begin{itemize} +\item Un bloc mono-cellule permet d'utiliser la commande |\\| pour composer le +bloc sur plusieurs lignes. + +\item On peut utiliser l'option d'alignement horizontal du bloc pour déroger à +la consigne générale donnée dans le préambule pour cette colonne. +\end{itemize} + +\medskip +\begin{BVerbatim}[baseline=c,boxwidth=10cm] +\begin{NiceTabular}{cc} +\toprule +Écrivain +& ~emphase#\Block[l]{}{année de\\ naissance}@ \\ +\midrule +Hugo & 1802 \\ +Balzac & 1799 \\ +\bottomrule +\end{NiceTabular} +\end{BVerbatim} +% +\begin{NiceTabular}{cc} +\toprule +Écrivain +& \Block[l]{}{année de\\ naissance} \\ +\midrule +Hugo & 1802 \\ +Balzac & 1799 \\ +\bottomrule +\end{NiceTabular} + +\medskip +On rappelle que si le premier argument obligatoire de |\Block| est laisssé +blanc, alors le bloc est mono-cellule\footnote{On peut considérer que la valeur par +défaut de ce premier argument obligatoire est |1-1|.}. + + + + \subsection{Petite remarque} On remarquera que le centrage horizontal du contenu des blocs est @@ -836,7 +907,7 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt] \label{hvlines} La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux -(sauf dans les blocs et dans les blocks virtuels déterminés par des +(sauf dans les blocs et dans les blocs virtuels déterminés par des lignes en pointillés). \medskip @@ -862,7 +933,7 @@ arum & iris & jacinthe & muguet \subsection{La clé hvlines-except-corners} La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux -et verticaux sauf dans les blocs (y compris dans les blocks virtuels déterminés par des +et verticaux sauf dans les blocs (y compris dans les blocs virtuels déterminés par des lignes en pointillés) et sauf dans les coins vides. \medskip @@ -2266,7 +2337,7 @@ après le mot-clé |\CodeAfter|\footnote{Dans certaines circonstances, on doit de la cellule courante.} (pour un exemple, voir page \pageref{exemple-CodeAfter}). \colorbox{yellow!50}{\textbf{Nouveau 5.5}}\enskip Avant la version 5.5, il fallait parfois mettre le mot-clé |\omit| devant -|\CodeAfter| dans certains circonstances. Depuis la version 5.5, on ne doit +|\CodeAfter| dans certaines circonstances. Depuis la version 5.5, on ne doit \emph{jamais} mettre |\omit|. @@ -2910,11 +2981,21 @@ $\begin{NiceArrayWithDelims} \subsection{Les nœuds correspondant aux contenus des cases} -L'extension \pkg{nicematrix} crée un nœud PGF-Tikz pour chaque case (non vide) +L'extension \pkg{nicematrix} crée un nœud PGF-Tikz pour chaque case non vide du tableau considéré. Ces nœuds sont utilisés, entre autres, pour tracer les lignes en pointillés entre les cases du tableau. \smallskip +\textbf{Attention} : Par défaut, aucun nœud n'est créé dans une case vide. + +\smallskip +\colorbox{yellow!50}{\textbf{Nouveau 5.6}}\enskip +Néanmoins, on peut forcer la création d'un nœud avec la commande +|\NotEmpty|.\footnote{Il faut toutefois remarquer qu'avec cette commande, la + case est considérée comme non vide, ce qui a des conséquences sur le tracé des +lignes pointillées (cf.~p.~\pageref{Cdots}).} + +\bigskip Tous les nœuds du document doivent avoir des noms deux à deux distincts et le nom de ces nœuds doit donc faire intervenir le numéro de l'environnement courant. Les environnements créés par \pkg{nicematrix} sont en effet numérotés @@ -2937,6 +3018,8 @@ le nom donné au tableau et $i$ et $j$ les numéros de rangée et de colonne de case considérée. On peut les utiliser avec \textsc{pgf} mais l'utilisateur final préférera sans doute utiliser Tikz (qui est une sur-couche de \textsc{pgf}). Il faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas Tikz par défault. +Dans les exemples qui suivent, on suppose que Tikz a été chargé par +l'utilisateur. \bigskip \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2962,8 +3045,8 @@ Ne pas oublier les options |remember picture| et |overlay|. \bigskip Dans le |code-after|, et si Tikz est chargé, les choses sont plus simples. On -peut (et on doit) désigner les nœuds sous la forme $i$-$j$ : il n'y a pas besoin -de préciser l'environnement qui est évidemment l'environnement courant. +peut (et on doit) désigner les nœuds sous la forme $i$-$j$ : il n'y a pas à +préciser l'environnement qui est évidemment l'environnement courant. \medskip @@ -3328,7 +3411,7 @@ cellule courante (avec un argument optionnel entre crochets pour la couleur des hachures). Il est possible de programmer une telle commande |\hatchcell| comme suit, en utilisant explicitement la variable publique |\g_nicematrix_code_before_tl| (ce code nécessite le chargement préalable de la -bibliothèque Tikz \pkg{patterns}). +bibliothèque Tikz \pkg{patterns} : |\usetikzlibrary{patterns}|). \begin{scope} @@ -3527,22 +3610,18 @@ a+b & \Cdots & a+b & 1 \end{scope} \bigskip -\colorbox{yellow!30}{Nouveau 5.3}\enskip On peut choisir l'instruction - |\Ddots| qui sera tracée en premier (et qui servira pour tracer les suivantes - quand la parallélisation est activée) avec la clé |draw-first| : - |\Ddots[draw-first]|\rlap{.} +On peut choisir l'instruction |\Ddots| qui sera tracée en premier (et qui +servira pour tracer les suivantes quand la parallélisation est activée) avec la +clé |draw-first| : |\Ddots[draw-first]|\rlap{.} \subsection{Les cases «vides»} \label{empty-cells} Une instruction comme |\Ldots|, |\Cdots|, etc. essaye de déterminer la première -case vide de part et d'autre de la case considérée. Néanmoins, une case vide +case vide de part et d'autre de la case considérée. Néanmoins, une case «vide» n'est pas nécessairement sans contenu dans le codage TeX (c'est-à-dire sans -aucun token entre les deux esperluettes~|&|). En effet, une case dont le contenu -est |\hspace*{1cm}| peut être considérée comme vide. - -\interitem -Pour \pkg{nicematrix}, les règles précises sont les suivantes : +aucun token entre les deux esperluettes~|&|). Les règles précises sont les +suivantes : \begin{itemize} \item Une case implicite est vide. Par exemple, dans la matrice suivante @@ -3559,6 +3638,10 @@ la dernière case (deuxième rangée et deuxième colonne) est vide. \medskip \item Chaque case avec un rendu par TeX de largeur nulle est vide. +\medskip +\item Une case qui contient la commande |\NotEmpty| est non vide (et un nœud +PGF/Tikz est créé pour cette case). + \medskip \item Une case avec une commande |\Hspace| (ou |\Hspace*|) est vide. Cette commande |\Hspace| est une commande définie par l'extension \pkg{nicematrix} @@ -4374,7 +4457,6 @@ L_i & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\ \end{tikzpicture} -\newpage \section*{Autre documentation} diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 0383626f2f..a8427171e2 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{5.5} -\def\myfiledate{2020/10/20} +\def\myfileversion{5.6} +\def\myfiledate{2020/11/08} % % %<*batchfile> @@ -165,9 +165,9 @@ version 2005/12/01 or later. % % \bigskip % This package requires and \textbf{loads} the packages \pkg{l3keys2e}, -% \pkg{xparse}, \pkg{array}, \pkg{amsmath}, \pkg{pgfcore} and the module -% \pkg{shapes} of \textsc{pgf} (\pkg{tikz}, which is a layer over \textsc{pgf} -% is \emph{not} loaded). The final user only has to load the package with +% \pkg{array}, \pkg{amsmath}, \pkg{pgfcore} and the module \pkg{shapes} of +% \textsc{pgf} (\pkg{tikz}, which is a layer over \textsc{pgf} is \emph{not} +% loaded). The final user only has to load the package with % |\usepackage{nicematrix}|. % % @@ -452,13 +452,23 @@ version 2005/12/01 or later. % cells of the array. % % The command |\Block| must be used in the upper leftmost cell of the array with -% two arguments. The first argument is the size of the block with the syntax +% two arguments. +% +% \begin{itemize} +% \item The first argument is the size of the block with the syntax % $i$\verb|-|$j$ where $i$ is the number of rows of the block and $j$ its number -% of columns. The second argument is the content of the block. +% of columns. % -% In |{NiceTabular}| the content of the block is composed in text mode. In the -% other environments, it is composed in math mode. +% \colorbox{yellow!50}{\bfseries New 5.6}\enskip If this argument is empty, its +% default value is |1-1|. If the number of rows is not specified, the block +% extends until the last row (idem for the columns). % +% \item The second argument is the content of the block. It's possible to use +% |\\| in that content to have a content on several lines. In |{NiceTabular}| +% the content of the block is composed in text mode whereas, in the other +% environments, it is composed in math mode. +% \end{itemize} +% % % \interitem % Here is an example of utilisation of the command |\Block| in mathematical matrices. @@ -487,7 +497,9 @@ version 2005/12/01 or later. % possible to use directly a command like |\large|, |\Large| and |\LARGE|. % That's why the command |\Block| provides an option between angle brackets to % specify some TeX code which will be inserted before the beginning of the -% math mode. +% math mode.\footnote{This argument between angular brackets may also be used to +% insert a command of font such as |\bfseries| when the command |\\| is used in +% the content of the block.} % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -510,8 +522,8 @@ version 2005/12/01 or later. % \end{scope} % % \medskip -% \colorbox{yellow!30}{New 5.3}\enskip It's possible to set the -% horizontal position of the block with one of the keys |l|, |c| and |r|. +% It's possible to set the horizontal position of the block with one of the keys +% |l|, |c| and |r|. % % % \medskip @@ -534,8 +546,9 @@ version 2005/12/01 or later. % % % \interitem -% {\bfseries One must remark that, by default, the commands |\Blocks| don't create space} -% (excepted, to some extent, the mono-column blocks: see below). +% {\bfseries One must remark that, by default, the commands |\Blocks| don't create space}. +% There is exception only for the blocks mono-row and the blocks mono-column as +% explained just below. % % \medskip % In the following example, we have had to enlarge by hand the columns 2 and 3 @@ -613,6 +626,53 @@ version 2005/12/01 or later. % \end{scope} % % +% \subsection{The mono-row blocks} +% +% \colorbox{yellow!50}{\textbf{New 5.6}}\enskip For the mono-row blocks, the +% natural height and depth are taken into account for the height and depth of +% the current row (as does a standard |\multicolumn| of LaTeX). +% +% \subsection{The mono-cell blocks} +% +% A mono-cell block inherits all the properties of the mono-row blocks and +% mono-column blocks. +% +% \medskip +% There are two reasons to use a mono-column block: +% \begin{itemize} +% \item It's possible to use the command |\\| in a (mono-cell) block. +% +% \item It's possible to use the option of horizontal alignment of the block in +% derogation of the type of column given in the preamble of the array. +% \end{itemize} +% +% \bigskip +% \begin{BVerbatim}[baseline=c,boxwidth=10cm] +% \begin{NiceTabular}{cc} +% \toprule +% Write & ~emphase#\Block[l]{}{year\\ of birth}@ \\ +% \midrule +% Hugo & 1802 \\ +% Balzac & 1799 \\ +% \bottomrule +% \end{NiceTabular} +% \end{BVerbatim} +% \begin{NiceTabular}{cc} +% \toprule +% Write & \Block[l]{}{year\\ of birth} \\ +% \midrule +% Hugo & 1802 \\ +% Balzac & 1799 \\ +% \bottomrule +% \end{NiceTabular} +% +% \medskip +% We recall that if the first mandatory argument of |\Block| is left blank, the +% block is mono-cell.\footnote{One may consider that the default value of the +% first mandatory argument of |\Block| is |1-1|} +% +% +% % % \subsection{A small remark} % @@ -2898,7 +2958,18 @@ version 2005/12/01 or later. % of the considered array. These nodes are used to draw the dotted lines between % the cells of the matrix (inter alia). % +% % \smallskip +% \textbf{Caution} : By default, no node is created in a empty cell. +% +% \smallskip +% \colorbox{yellow!50}{\textbf{New 5.6}}\enskip +% However, it's possible to impose the creation of a node with the command |\NotEmpty|. +% \footnote{One should note that, with that command, the cell is considered as +% non-empty, which has consequencies for the continuous dotted lines (cf. +% p.~\pageref{Cdots}).} +% +% \medskip % The nodes of a document must have distinct names. That's why the names of the % nodes created by \pkg{nicematrix} contains the number of the current % environment. Indeed, the environments of \pkg{nicematrix} are numbered by a @@ -2921,6 +2992,7 @@ version 2005/12/01 or later. % possible to use these nodes with \textsc{pgf} but the final user will % probably prefer to use Tikz (which is a convenient layer upon \textsc{pgf}). % However, one should remind that \pkg{nicematrix} doesn't load Tikz by default. +% In the following examples, we assume that Tikz has been loaded. % % \bigskip % \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2944,9 +3016,9 @@ version 2005/12/01 or later. % Don't forget the options |remember picture| and |overlay|. % % \bigskip -% In the |code-after|, and if Tikz is loaded, the things are easier. One may -% design the nodes with the form $i$-$j$: there is no need to indicate the -% environment which is of course the current environment. +% In the |code-after|, the things are easier : one must refer to the nodes with +% the form $i$-$j$ (we don't have to indicate the environment which is of +% course the current environment). % % % \medskip @@ -3304,7 +3376,7 @@ version 2005/12/01 or later. % cell (with an optional argument between brackets for the color). It's possible % to program such command |\hatchcell| as follows, explicitely using the public % variable |\g_nicematrix_code_before_tl| (this code requires the Tikz library -% \pkg{patterns}). +% \pkg{patterns}: |\usetikzlibrary{patterns}|). % % % \begin{scope} @@ -3497,22 +3569,17 @@ version 2005/12/01 or later. % % \end{scope} % -% \colorbox{yellow!30}{New 5.3}\enskip It's possible to specify the -% instruction |\Ddots| which will be drawn first (and which will be used to draw -% the other diagonal dotted lines when the parallelization is in force) with the -% key |draw-first|: |\Ddots[draw-first]|. +% It's possible to specify the instruction |\Ddots| which will be drawn first +% (and which will be used to draw the other diagonal dotted lines when the +% parallelization is in force) with the key |draw-first|: |\Ddots[draw-first]|. % % \subsection{The ``empty'' cells} % % \label{empty-cells} % An instruction like |\Ldots|, |\Cdots|, etc. tries to determine the first -% non-empty cells on both sides. However, an empty cell is not necessarily a +% non-empty cell on both sides. However, an ``empty cell'' is not necessarily a % cell with no TeX content (that is to say a cell with no token between the two -% ampersands~|&|). Indeed, a cell which only contains |\hspace*{1cm}| may be -% considered as empty. -% -% \interitem -% For \pkg{nicematrix}, the precise rules are as follow. +% ampersands~|&|). The precise rules are as follow. % % \begin{itemize} % \item An implicit cell is empty. For example, in the following matrix: @@ -3529,6 +3596,9 @@ version 2005/12/01 or later. % \medskip % \item Each cell whose TeX ouput has a width equal to zero is empty. % +% \medskip +% \item A cell containing the command |\NotEmpty| is not empty (and a PGF/Tikz +% node) is created in that cell. % % \medskip % \item A cell with a command |\Hspace| (or |\Hspace*|) is empty. This command @@ -4487,9 +4557,9 @@ version 2005/12/01 or later. % % \bigskip % We define a command |\iddots| similar to |\ddots| ($\ddots$) but with dots -% going forward ($\iddots$). We use |\ProvideDocumentCommand| of \pkg{xparse}, -% and so, if the command |\iddots| has already been defined (for example by the -% package \pkg{mathdots}), we don't define it again. +% going forward ($\iddots$). We use |\ProvideDocumentCommand| and so, if the +% command |\iddots| has already been defined (for example by the package +% \pkg{mathdots}), we don't define it again. % % \begin{macrocode} \ProvideDocumentCommand \iddots { } @@ -4927,14 +4997,21 @@ version 2005/12/01 or later. % \bigskip % When there is a mono-column block (created by the command |\Block|), we want % to take into account the width of that block for the width of the column. -% That's why we compute the width of that block in the |\g_@@_blocks_width_dim| +% That's why we compute the width of that block in the |\g_@@_blocks_wd_dim| % and, after the construction of the box |\l_@@_cell_box|, we change the width -% of that box to take into account the length |\g_@@_blocks_width_dim|. +% of that box to take into account the length |\g_@@_blocks_wd_dim|. % \begin{macrocode} -\dim_new:N \g_@@_blocks_width_dim +\dim_new:N \g_@@_blocks_wd_dim % \end{macrocode} % % \bigskip +% Idem pour the blocks mono-row. +% \begin{macrocode} +\dim_new:N \g_@@_blocks_ht_dim +\dim_new:N \g_@@_blocks_dp_dim +% \end{macrocode} +% +% \bigskip % The sequence |\g_@@_names_seq| will be the list of all the names of % environments used (via the option |name|) in the document: two environments % must not have the same name. However, it's possible to use the option @@ -5033,7 +5110,7 @@ version 2005/12/01 or later. % % \bigskip % The following token list corresponds to the option |code-after| (it's also -% possible to set the value of that parameter with the command |\CodeAfter|). +% possible to set the value of that parameter with the keyword |\CodeAfter|). % \begin{macrocode} \tl_new:N \g_nicematrix_code_after_tl % \end{macrocode} @@ -5078,6 +5155,13 @@ version 2005/12/01 or later. \bool_new:N \g_@@_row_of_col_done_bool % \end{macrocode} % +% \bigskip +% It's possible to use the command |\NotEmpty| to specify explicitely that a +% cell must be considered as non empty by \pkg{nicematrix} (the Tikz nodes are +% constructed only the non empty cells). +% \begin{macrocode} +\bool_new:N \g_@@_not_empty_cell_bool +% \end{macrocode} % % \bigskip % |\l_@@_code_before_tl| may contain two types of informations: @@ -6371,13 +6455,25 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \@@_adjust_width_box: +\cs_new_protected:Npn \@@_adjust_size_box: { - \dim_compare:nNnT \g_@@_blocks_width_dim > \c_zero_dim + \dim_compare:nNnT \g_@@_blocks_wd_dim > \c_zero_dim { \box_set_wd:Nn \l_@@_cell_box - { \dim_max:nn { \box_wd:N \l_@@_cell_box } \g_@@_blocks_width_dim } - \dim_gzero:N \g_@@_blocks_width_dim + { \dim_max:nn { \box_wd:N \l_@@_cell_box } \g_@@_blocks_wd_dim } + \dim_gzero:N \g_@@_blocks_wd_dim + } + \dim_compare:nNnT \g_@@_blocks_dp_dim > \c_zero_dim + { + \box_set_dp:Nn \l_@@_cell_box + { \dim_max:nn { \box_dp:N \l_@@_cell_box } \g_@@_blocks_dp_dim } + \dim_gzero:N \g_@@_blocks_dp_dim + } + \dim_compare:nNnT \g_@@_blocks_ht_dim > \c_zero_dim + { + \box_set_ht:Nn \l_@@_cell_box + { \dim_max:nn { \box_ht:N \l_@@_cell_box } \g_@@_blocks_ht_dim } + \dim_gzero:N \g_@@_blocks_ht_dim } } % \end{macrocode} @@ -6388,7 +6484,7 @@ version 2005/12/01 or later. \@@_math_toggle_token: \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: - \@@_adjust_width_box: + \@@_adjust_size_box: % \end{macrocode} % % \begin{macrocode} @@ -6438,11 +6534,14 @@ version 2005/12/01 or later. \bool_if:NTF \g_@@_empty_cell_bool { \box_use_drop:N \l_@@_cell_box } { - \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim + \bool_lazy_or:nnTF + \g_@@_not_empty_cell_bool + { \dim_compare_p:nNn { \box_wd:N \l_@@_cell_box } > \c_zero_dim } \@@_node_for_the_cell: { \box_use_drop:N \l_@@_cell_box } } \bool_gset_false:N \g_@@_empty_cell_bool + \bool_gset_false:N \g_@@_not_empty_cell_bool } % \end{macrocode} % @@ -6832,6 +6931,7 @@ version 2005/12/01 or later. \cs_set_eq:NN \dotfill \@@_old_dotfill: \cs_set_eq:NN \CodeAfter \@@_CodeAfter: \cs_set_eq:NN \diagbox \@@_diagbox:nn + \cs_set_eq:NN \NotEmpty \@@_NotEmpty: \bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like: \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots: % \end{macrocode} @@ -7496,7 +7596,7 @@ version 2005/12/01 or later. } { \tl_gclear:N \g_@@_preamble_tl } % \end{macrocode} -% The counter |\l_tmpa_int| will be count the number of consecutive occurrences +% The counter |\l_tmpa_int| will count the number of consecutive occurrences % of the symbole \verb+|+. % \begin{macrocode} \int_zero:N \l_tmpa_int @@ -7706,7 +7806,7 @@ version 2005/12/01 or later. > { \hbox_set:Nw \l_@@_cell_box \@@_Cell: - \tl_set:Nn \l_@@_cell_type_tl { #1 } + \tl_set:Nn \l_@@_cell_type_tl { #3 } } c < { @@ -7714,7 +7814,7 @@ version 2005/12/01 or later. #1 \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: - \@@_adjust_width_box: + \@@_adjust_size_box: \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box } } } @@ -8445,7 +8545,7 @@ version 2005/12/01 or later. \@@_math_toggle_token: \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: - \@@_adjust_width_box: + \@@_adjust_size_box: \@@_update_for_first_and_last_row: % \end{macrocode} % We actualise the width of the ``first column'' because we will use this width @@ -8515,7 +8615,7 @@ version 2005/12/01 or later. \@@_math_toggle_token: \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: - \@@_adjust_width_box: + \@@_adjust_size_box: \@@_update_for_first_and_last_row: % \end{macrocode} % We actualise the width of the ``last column'' because we will use this width @@ -8628,6 +8728,14 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip +% The following command will be linked to |\NotEmpty| in the environments of +% \pkg{nicematrix}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_NotEmpty: + { \bool_gset_true:N \g_@@_not_empty_cell_bool } +% \end{macrocode} +% +% \bigskip % \subsection*{The environments \{NiceTabular\} and \{NiceTabular*\}} % % \begin{macrocode} @@ -8845,6 +8953,13 @@ version 2005/12/01 or later. % \begin{macrocode} \@@_compute_corners: % \end{macrocode} +% +% \bigskip +% The sequence |\g_@@_pos_of_blocks_seq| must be ``adjusted'' (for the case +% where the user have written something like |\Block{1-}|). +% \begin{macrocode} + \@@_adjust_pos_of_blocks_seq: +% \end{macrocode} % % \bigskip % The following code is only for efficiency. We determine whether the potential @@ -8950,6 +9065,40 @@ version 2005/12/01 or later. % \end{macrocode} % % +% \bigskip +% We remind that the first mandatory argument of the command |\Block| is the +% size of the block with the special format $i$|-|$j$. However, the user is +% allowed to omit $i$ or $j$ (or both). This will be interpreted as: the last +% row (resp. column) of the block will be the last row (resp. column) of the +% block (without the potential exterior row---resp. column---of the array). By +% convention, this is stored in |\g_@@_pos_of_blocks_seq| (and +% |\g_@@_blocks_seq|) as a number of rows (resp. columns) for the block equal to +% 100. It's possible, after the construction of the array, to replace these +% values by the correct ones (since we know the number of rows and columns of +% the array). +% \begin{macrocode} +\cs_new_protected:Npn \@@_adjust_pos_of_blocks_seq: + { + \seq_gclear:N \g_tmpa_seq + \seq_map_inline:Nn \g_@@_pos_of_blocks_seq + { \@@_adjust_pos_of_blocks_seq_i:nnnn ##1 } + \seq_gset_eq:NN \g_@@_pos_of_blocks_seq \g_tmpa_seq + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_adjust_pos_of_blocks_seq_i:nnnn #1 #2 #3 #4 + { + \int_compare:nNnTF { #3 } > { 99 } + { \int_set_eq:NN \l_tmpa_int \c@iRow } + { \int_set:Nn \l_tmpa_int { #3 } } + \int_compare:nNnTF { #4 } > { 99 } + { \int_set_eq:NN \l_tmpb_int \c@jCol } + { \int_set:Nn \l_tmpb_int { #4 } } + \seq_gput_right:Nx \g_tmpa_seq + { { #1 } { #2 } { \int_use:N \l_tmpa_int } { \int_use:N \l_tmpb_int } } + } +% \end{macrocode} % % \bigskip % We recall that, when externalization is used, |\tikzpicture| and @@ -10242,8 +10391,8 @@ version 2005/12/01 or later. % \end{macrocode} % % -% The command |\@@_Hdotsfor_i| is defined with the tools of \pkg{xparse} because -% it has an optional argument. Note that such a command defined by +% The command |\@@_Hdotsfor_i| is defined with |\NewDocumentCommand| because it +% has an optional argument. Note that such a command defined by % |\NewDocumentCommand| is protected and that's why we have put the % |\multicolumn| before (in the definition of |\@@_Hdotsfor:|). % \begin{macrocode} @@ -11179,7 +11328,7 @@ version 2005/12/01 or later. % \subsection*{The horizontal rules} % % \bigskip -% The following command will be executed in the |internal-code-after|. The row +% The following command will be executed in the |internal-code-after|. The rule % will be drawn \emph{before} the row |#1|. |#2| is the number of consecutive % occurrences of |\Hline|. % \begin{macrocode} @@ -11196,7 +11345,7 @@ version 2005/12/01 or later. { % \end{macrocode} % |\l_tmpa_tl| is the number of row and |\l_tmpb_tl| the number of column. Whe, -% we have found a column corresponding to a rule to draw, we note its numver in +% we have found a column corresponding to a rule to draw, we note its number in % |\l_tmpc_tl|. % \begin{macrocode} \tl_set:Nn \l_tmpa_tl { #1 } @@ -12251,7 +12400,8 @@ version 2005/12/01 or later. % % \bigskip % The options of the command |\Block| will be analyzed first in the cell of the -% array (and once again when the block will be put in the array in the |code-after|). +% array (and once again when the block will be put in the array in the +% |code-after|). Here is the set of keys for the first pass. % \begin{macrocode} \keys_define:nn { NiceMatrix / Block / FirstPass } { @@ -12265,21 +12415,28 @@ version 2005/12/01 or later. % \end{macrocode} % % -% The following command will be linked to |\Block| in the environments of -% \pkg{nicematrix}. We define it with |\NewDocumentCommand| of \pkg{xparse} -% because it has an optional argument between |<| and |>| (for TeX instructions -% put before the math mode of the label) +% The following command |\@@_Block:| will be linked to |\Block| in the +% environments of \pkg{nicematrix}. We define it with +% |\NewExpandableDocumentCommand| because it has an optional argument between +% |<| and |>| (for TeX instructions put before the math mode of the label). It's +% mandatory to use an expandable command. % -% It's mandatory to use an expandable command (why?). % \begin{macrocode} \NewExpandableDocumentCommand \@@_Block: { O { } m D < > { } m } - { \@@_Block_i #2 \q_stop { #1 } { #3 } { #4 } } + { +% \end{macrocode} +% If the first mandatory argument of the command (which is the size of the block +% with the syntax $i$|-|$j$) has not be provided by the user, you use |1-1| +% (that is to say a block of only one cell). +% \begin{macrocode} + \tl_if_blank:nTF { #2 } { \@@_Block_i 1-1 \q_stop } { \@@_Block_i #2 \q_stop } + { #1 } { #3 } { #4 } + } % \end{macrocode} % % \medskip -% The first mandatory argument of |\@@_Block:| has a special syntax. It must be -% of the form $i$|-|$j$ where $i$ and $j$ are the size (in rows and columns) of -% the block. +% With the following construction, we extract the values of $i$ and $j$ in the +% first mandatory argument of the command. % \begin{macrocode} \cs_new:Npn \@@_Block_i #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } } % \end{macrocode} @@ -12299,19 +12456,34 @@ version 2005/12/01 or later. { \tl_set:Nn \l_@@_pos_of_block_tl c } { \tl_set_eq:NN \l_@@_pos_of_block_tl \l_@@_cell_type_tl } % \end{macrocode} +% % \medskip % \begin{macrocode} \keys_set_known:nn { NiceMatrix / Block / FirstPass } { #3 } % \end{macrocode} % % \medskip +% We recall that |#1| and |#2| have been extracted from the first mandatory +% argument of |\Block| (which is of the syntax $i$|-|$j$). However, the user is +% allowed to omit $i$ or $j$ (or both). We detect that situation by replacing a +% missing value by 100 (it's a convention: when the block will actually be drawn +% these values will be detected and interpreted as \emph{maximal possible value}). +% \begin{macrocode} + \tl_if_empty:nTF { #1 } + { \int_set:Nn \l_tmpa_int { 100 } } + { \int_set:Nn \l_tmpa_int { #1 } } + \tl_if_empty:nTF { #2 } + { \int_set:Nn \l_tmpb_int { 100 } } + { \int_set:Nn \l_tmpb_int { #2 } } +% \end{macrocode} +% % \begin{macrocode} \tl_set:Nx \l_tmpa_tl { { \int_use:N \c@iRow } { \int_use:N \c@jCol } - { \int_eval:n { \c@iRow + #1 - 1 } } - { \int_eval:n { \c@jCol + #2 - 1 } } + { \int_eval:n { \c@iRow + \l_tmpa_int - 1 } } + { \int_eval:n { \c@jCol + \l_tmpb_int - 1 } } } % \end{macrocode} % Now, |\l_tmpa_tl| contains an ``object'' corresponding to the position of the @@ -12332,41 +12504,62 @@ version 2005/12/01 or later. % |{|\textsl{imin}|}{|\textsl{jmin}|}{|\textsl{imax}|}{|\textsl{jmax}|}{|\textsl{options}|}{|\textsl{contents}|}|. % % \medskip -% If the block is mono-column, we have a special treatment. +% If the block is mono-column or mono-row, we have a special treatment. That's +% why we have two macros: |\@@_Block_iii:nnnnn| and |\@@_Block_iv:nnnnn| (the five +% arguments of those macros are provided by curryfication). % \begin{macrocode} - \int_compare:nNnTF { #2 } = 1 + \bool_lazy_or:nnTF + { \int_compare_p:nNn { \l_tmpa_int } = 1 } + { \int_compare_p:nNn { \l_tmpb_int } = 1 } + { \exp_args:Nxx \@@_Block_iii:nnnnn } + { \exp_args:Nxx \@@_Block_iv:nnnnn } + { \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 } + } +% \end{macrocode} +% +% +% \bigskip +% The following macro is for the case of a |\Block| which is mono-row or +% mono-column (or both). In that case, the content of the block is composed +% right now in a box (because we have to take into account the dimensions of +% that box for the width of the current column or the height and the depth of the +% current row). However, that box will be put in the array \emph{after the +% construction of the array} (by using \textsc{pgf}). +% \begin{macrocode} +\cs_new_protected:Npn \@@_Block_iii:nnnnn #1 #2 #3 #4 #5 + { + \int_gincr:N \g_@@_block_box_int + \cs_set_protected_nopar:Npn \diagbox ##1 ##2 { - \int_gincr:N \g_@@_block_box_int - \cs_set_protected_nopar:Npn \diagbox ##1 ##2 - { - \tl_gput_right:Nx \g_@@_internal_code_after_tl - { - \@@_actually_diagbox:nnnnnn - { \int_use:N \c@iRow } - { \int_use:N \c@jCol } - { \int_eval:n { \c@iRow + #1 - 1 } } - { \int_eval:n { \c@jCol + #2 - 1 } } - { \exp_not:n { ##1 } } { \exp_not:n { ##2 } } - } - } - \box_gclear_new:c - { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } - \hbox_gset:cn - { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + \tl_gput_right:Nx \g_@@_internal_code_after_tl { + \@@_actually_diagbox:nnnnnn + { \int_use:N \c@iRow } + { \int_use:N \c@jCol } + { \int_eval:n { \c@iRow + #1 - 1 } } + { \int_eval:n { \c@jCol + #2 - 1 } } + { \exp_not:n { ##1 } } { \exp_not:n { ##2 } } + } + } + \box_gclear_new:c + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + \hbox_gset:cn + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + { % \end{macrocode} -% If the user has specified a color for the column in the preamble of the array, -% we want to fix that color in the box we construct. We do that with -% |\set@color| and not |\color_ensure_current:| because that command seems to be -% bugged: it doesn't work in XeLaTeX when \pkg{fontspec} is loaded. +% For a mono-column block, if the user has specified a color for the column in +% the preamble of the array, we want to fix that color in the box we construct. +% We do that with |\set@color| and not |\color_ensure_current:| because that +% command seems to be bugged: it doesn't work in XeLaTeX when \pkg{fontspec} is +% loaded. % \begin{macrocode} - \set@color - \bool_if:NTF \l_@@_NiceTabular_bool - { - \group_begin: - \cs_set:Npn \arraystretch { 1 } - \dim_set_eq:NN \extrarowheight \c_zero_dim - #4 + \int_compare:nNnT { #2 } = 1 \set@color + \bool_if:NTF \l_@@_NiceTabular_bool + { + \group_begin: + \cs_set:Npn \arraystretch { 1 } + \dim_set_eq:NN \extrarowheight \c_zero_dim + #4 % \end{macrocode} % If the box is rotated (the key |\rotate| may be in the previous |#4|), the % tabular used for the content of the cell will be constructed with a format @@ -12375,49 +12568,81 @@ version 2005/12/01 or later. % the tabular is the same as the external alignment of the tabular (that is to % say the position of the block in its zone of merged cells). % \begin{macrocode} - \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } - #5 - \end { tabular } - \group_end: - } - { - \group_begin: - \cs_set:Npn \arraystretch { 1 } - \dim_set_eq:NN \extrarowheight \c_zero_dim - #4 - \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } - #5 - \end { array } - \c_math_toggle_token - \group_end: - } - } - \bool_if:NT \g_@@_rotate_bool - { - \box_grotate:cn - { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } - { 90 } - \bool_gset_false:N \g_@@_rotate_bool + \bool_if:NT \g_@@_rotate_bool + { \tl_set:Nn \l_@@_pos_of_block_tl c } + \exp_args:Nnx \begin { tabular } + { @ { } \l_@@_pos_of_block_tl @ { } } + #5 + \end { tabular } + \group_end: + } + { + \group_begin: + \cs_set:Npn \arraystretch { 1 } + \dim_set_eq:NN \extrarowheight \c_zero_dim + #4 + \bool_if:NT \g_@@_rotate_bool + { \tl_set:Nn \l_@@_pos_of_block_tl c } + \c_math_toggle_token + \exp_args:Nnx \begin { array } + { @ { } \l_@@_pos_of_block_tl @ { } } + #5 + \end { array } + \c_math_toggle_token + \group_end: } - \dim_gset:Nn \g_@@_blocks_width_dim + } + \bool_if:NT \g_@@_rotate_bool + { + \box_grotate:cn + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + { 90 } + \bool_gset_false:N \g_@@_rotate_bool + } +% \end{macrocode} +% If we are in a mono-column block, we take into account the width of that block +% for the width of the column. +% \begin{macrocode} + \int_compare:nNnT { #2 } = 1 + { + \dim_gset:Nn \g_@@_blocks_wd_dim { \dim_max:nn - \g_@@_blocks_width_dim + \g_@@_blocks_wd_dim { \box_wd:c { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } } - } - \seq_gput_right:Nx \g_@@_blocks_seq - { - \l_tmpa_tl + } + } +% \end{macrocode} +% If we are in a mono-row block, we take into account the height and the +% depth of that block for the height and the depth of the row. +% \begin{macrocode} + \int_compare:nNnT { #1 } = 1 + { + \dim_gset:Nn \g_@@_blocks_ht_dim + { + \dim_max:nn + \g_@@_blocks_ht_dim + { + \box_ht:c + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + } + } + \dim_gset:Nn \g_@@_blocks_dp_dim + { + \dim_max:nn + \g_@@_blocks_dp_dim + { + \box_dp:c + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + } + } + } + \seq_gput_right:Nx \g_@@_blocks_seq + { + \l_tmpa_tl % \end{macrocode} % In the list of options |#3|, maybe there is a key for the horizontal alignment % (|l|, |r| or |c|). In that case, that key has been read and stored in @@ -12425,30 +12650,36 @@ version 2005/12/01 or later. % alignement and that's why we put a key corresponding to the value of % |\l_@@_pos_of_block_tl|, which is fixed by the type of current column. % \begin{macrocode} - { #3 , \l_@@_pos_of_block_tl } - { - \box_use_drop:c - { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } - } - } - } + { #3 , \l_@@_pos_of_block_tl } + { + \box_use_drop:c + { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } + } + } + } % \end{macrocode} -% In the standard case, that is to say a |\Block| which is \emph{not} mono-column. +% +% \bigskip +% The following macro is for the standard case, where the block is not mono-row +% and not mono-column. In that case, the content of the block is \emph{not} +% composed right now in a box. The composition in a box will be done further, +% just after the construction of the array. % \begin{macrocode} - { - \seq_gput_right:Nx \g_@@_blocks_seq - { - \l_tmpa_tl - { #3 } - \exp_not:n - { - { - \bool_if:NTF \l_@@_NiceTabular_bool - { - \group_begin: - \cs_set:Npn \arraystretch { 1 } - \dim_set_eq:NN \extrarowheight \c_zero_dim - #4 +\cs_new_protected:Npn \@@_Block_iv:nnnnn #1 #2 #3 #4 #5 + { + \seq_gput_right:Nx \g_@@_blocks_seq + { + \l_tmpa_tl + { #3 } + \exp_not:n + { + { + \bool_if:NTF \l_@@_NiceTabular_bool + { + \group_begin: + \cs_set:Npn \arraystretch { 1 } + \dim_set_eq:NN \extrarowheight \c_zero_dim + #4 % \end{macrocode} % If the box is rotated (the key |\rotate| may be in the previous |#4|), the % tabular used for the content of the cell will be constructed with a format @@ -12457,36 +12688,39 @@ version 2005/12/01 or later. % the tabular is the same as the external alignment of the tabular (that is to % say the position of the block in its zone of merged cells). % \begin{macrocode} - \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } - #5 - \end { tabular } - \group_end: - } - { - \group_begin: - \cs_set:Npn \arraystretch { 1 } - \dim_set_eq:NN \extrarowheight \c_zero_dim - #4 - \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } #5 \end { array } - \c_math_toggle_token - \group_end: - } + \bool_if:NT \g_@@_rotate_bool + { \tl_set:Nn \l_@@_pos_of_block_tl c } + \exp_args:Nnx \begin { tabular } + { @ { } \l_@@_pos_of_block_tl @ { } } + #5 + \end { tabular } + \group_end: } - } - } - } - } + { + \group_begin: + \cs_set:Npn \arraystretch { 1 } + \dim_set_eq:NN \extrarowheight \c_zero_dim + #4 + \bool_if:NT \g_@@_rotate_bool + { \tl_set:Nn \l_@@_pos_of_block_tl c } + \c_math_toggle_token + \exp_args:Nnx \begin { array } + { @ { } \l_@@_pos_of_block_tl @ { } } #5 \end { array } + \c_math_toggle_token + \group_end: + } + } + } + } + } % \end{macrocode} -% % % \bigskip +% We recall that the options of the command |\Block| are analyzed twice: first +% in the cell of the array and once again when the block will be put in the +% array \emph{after the construction of the array} (by using \textsc{pgf}). +% +% \medskip % The key |tikz| is for Tikz options used when the \textsc{pgf} node of the % block is created (the ``normal'' block node and not the ``short'' one nor the % ``medium'' one). \textbf{In fact, as of now, it is \emph{not} documented}. Is @@ -12531,6 +12765,29 @@ version 2005/12/01 or later. \keys_set:nn { NiceMatrix / Block / SecondPass} { #5 } % \end{macrocode} % +% The integer |\l_@@_last_row_int| will be the last row of the block and +% |\l_@@_last_col_int| it's last column. +% \begin{macrocode} + \int_zero_new:N \l_@@_last_row_int + \int_zero_new:N \l_@@_last_col_int +% \end{macrocode} +% +% We remind that the first mandatory argument of the command |\Block| is the +% size of the block with the special format $i$|-|$j$. However, the user is +% allowed to omit $i$ or $j$ (or both). This will be interpreted as: the last +% row (resp. column) of the block will be the last row (resp. column) of the +% block (without the potential exterior row---resp. column---of the array). By +% convention, this is stored in |\g_@@_blocks_seq| as a number of rows (resp. +% columns) for the block equal to 100. That's what we detect now. +% \begin{macrocode} + \int_compare:nNnTF { #3 } > { 99 } + { \int_set_eq:NN \l_@@_last_row_int \c@iRow } + { \int_set:Nn \l_@@_last_row_int { #3 } } + \int_compare:nNnTF { #4 } > { 99 } + { \int_set_eq:NN \l_@@_last_col_int \c@jCol } + { \int_set:Nn \l_@@_last_col_int { #4 } } +% \end{macrocode} +% % \begin{macrocode} \tl_if_empty:NF \l_@@_color_tl { @@ -12539,7 +12796,7 @@ version 2005/12/01 or later. \exp_not:N \rectanglecolor { \l_@@_color_tl } { #1 - #2 } - { #3 - #4 } + { \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int } } } % \end{macrocode} @@ -12551,7 +12808,10 @@ version 2005/12/01 or later. \tl_gput_right:Nx \g_@@_internal_code_after_tl { \@@_actually_diagbox:nnnnnn - { #1 } { #2 } { #3 } { #4 } + { #1 } + { #2 } + { \int_use:N \l_@@_last_row_int } + { \int_use:N \l_@@_last_col_int } { \exp_not:n { ##1 } } { \exp_not:n { ##2 } } } } @@ -12560,8 +12820,8 @@ version 2005/12/01 or later. % \medskip % \begin{macrocode} \bool_lazy_or:nnTF - { \int_compare_p:nNn { #3 } > \g_@@_row_total_int } - { \int_compare_p:nNn { #4 } > \g_@@_col_total_int } + { \int_compare_p:nNn \l_@@_last_row_int > \g_@@_row_total_int } + { \int_compare_p:nNn \l_@@_last_col_int > \g_@@_col_total_int } { \msg_error:nnnn { nicematrix } { Block~too~large } { #1 } { #2 } } { \hbox_set:Nn \l_@@_cell_box { #6 } @@ -12625,9 +12885,9 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_tmpa_dim \pgf@y \@@_qpoint:n { col - #2 } \dim_set_eq:NN \l_tmpb_dim \pgf@x - \@@_qpoint:n { row - \@@_succ:n { #3 } } + \@@_qpoint:n { row - \@@_succ:n { \l_@@_last_row_int } } \dim_set_eq:NN \l_tmpc_dim \pgf@y - \@@_qpoint:n { col - \@@_succ:n { #4 } } + \@@_qpoint:n { col - \@@_succ:n { \l_@@_last_col_int } } \dim_set_eq:NN \l_tmpd_dim \pgf@x % \end{macrocode} % @@ -12678,18 +12938,20 @@ version 2005/12/01 or later. \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int { \cs_if_exist:cT - { pgf @ sh @ ns @ \@@_env: - ##1 - #4 } + { pgf @ sh @ ns @ \@@_env: - ##1 - \int_use:N \l_@@_last_col_int } { \seq_if_in:NnF \g_@@_multicolumn_cells_seq { ##1 - #2 } { - \pgfpointanchor { \@@_env: - ##1 - #4 } { east } + \pgfpointanchor + { \@@_env: - ##1 - \int_use:N \l_@@_last_col_int } + { east } \dim_set:Nn \l_tmpd_dim { \dim_max:nn \l_tmpd_dim \pgf@x } } } } \dim_compare:nNnT \l_tmpd_dim = { - \c_max_dim } { - \@@_qpoint:n { col - \@@_succ:n { #4 } } + \@@_qpoint:n { col - \@@_succ:n { \l_@@_last_col_int } } \dim_set_eq:NN \l_tmpd_dim \pgf@x } \@@_pgf_rect_node:nnnnn @@ -12707,7 +12969,14 @@ version 2005/12/01 or later. \@@_pgf_rect_node:nnn { \@@_env: - #1 - #2 - block - medium } { \pgfpointanchor { \@@_env: - #1 - #2 - medium } { north~west } } - { \pgfpointanchor { \@@_env: - #3 - #4 - medium } { south~east } } + { + \pgfpointanchor + { \@@_env: + - \int_use:N \l_@@_last_row_int + - \int_use:N \l_@@_last_col_int - medium + } + { south~east } + } } % \end{macrocode} % \medskip @@ -14205,12 +14474,18 @@ version 2005/12/01 or later. % % Different behaviour for the mono-column blocks. % -% \subsection*{Changes between versions 5.3 and 5.4} +% \subsection*{Changes between versions 5.4 and 5.5} % % The user must never put |\omit| before |\CodeAfter|. % % Correction of a bug: the tabular notes |\tabularnotes| were not composed when % present in a block (except a mono-column block). +% +% \subsection*{Changes between versions 5.5 and 5.6} +% +% Different behaviour for the mono-row blocks. +% +% New command |\NotEmpty|. % % \PrintIndex % diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf index 64a08064d4..c8e2b90a5c 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix.pdf and b/macros/latex/contrib/nicematrix/nicematrix.pdf differ diff --git a/macros/latex/contrib/reledmac/doc-include/migrate-par.dtx b/macros/latex/contrib/reledmac/doc-include/migrate-par.dtx index 655354503c..53243c00f4 100644 --- a/macros/latex/contrib/reledmac/doc-include/migrate-par.dtx +++ b/macros/latex/contrib/reledmac/doc-include/migrate-par.dtx @@ -86,4 +86,11 @@ % When changing the \cs{Lcolwidth} and \cs{Rcolwidth} length within an \env{pages} environment, the contents were aligned to the right. % Now, they are aligned to the left. % Please contact us if you need to retain the older behaviour. - +% \subsection{Migration to \reledpar~v.~2.24.3} +% There where an inconstancy with hanging verses. +% If you defined indentation of hanging verse as +2+, with \verb+setstanzaindents{2,…}+, it was, in reality, typeset as equal +4+. This happened : +% \begin{itemize} +% \item only in parallel typesetting; +% \item only with \cs{stanza} macro, not with \env{astanza} environment. +% \end{itemize} +% This inconsistency has been corrected. If you want to keep old indentation after upgrading the package, just multiply by two the fist argument of \cs{setstanzaindents}. diff --git a/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf b/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf index c94edcf4a9..c88289349b 100644 Binary files a/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf and b/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf b/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf index 36a027f2c2..668bf42af4 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf and b/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf b/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf index ad18055085..ad8aed9842 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf and b/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf b/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf index 2709c594cb..97905f27a0 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf and b/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-tabular.pdf b/macros/latex/contrib/reledmac/examples/1-tabular.pdf index e4fe95fabb..910096821a 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-tabular.pdf and b/macros/latex/contrib/reledmac/examples/1-tabular.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf b/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf index b177cb0627..072cf0b014 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf and b/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/1-verses.pdf b/macros/latex/contrib/reledmac/examples/1-verses.pdf index 930cf8b303..17f794dfdc 100644 Binary files a/macros/latex/contrib/reledmac/examples/1-verses.pdf and b/macros/latex/contrib/reledmac/examples/1-verses.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-antilabe.pdf b/macros/latex/contrib/reledmac/examples/2-antilabe.pdf index 109b52fa47..b5a7fbe8f0 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-antilabe.pdf and b/macros/latex/contrib/reledmac/examples/2-antilabe.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf b/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf index 807f3e29d5..4f36ed6c82 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf and b/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf b/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf index 6e9b4fc87f..970ef5bc69 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf and b/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-glossaries.pdf b/macros/latex/contrib/reledmac/examples/2-glossaries.pdf index eb7bef384e..a57d00a95f 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-glossaries.pdf and b/macros/latex/contrib/reledmac/examples/2-glossaries.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-indexing.pdf b/macros/latex/contrib/reledmac/examples/2-indexing.pdf index 63494b04bf..b3ace18d2b 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-indexing.pdf and b/macros/latex/contrib/reledmac/examples/2-indexing.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf b/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf index 116f0e7eb3..32dde32100 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf and b/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf b/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf index cc0877822e..7a8a407890 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf and b/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-linespacing.pdf b/macros/latex/contrib/reledmac/examples/2-linespacing.pdf index c8b233c176..00efac4682 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-linespacing.pdf and b/macros/latex/contrib/reledmac/examples/2-linespacing.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf b/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf index 7f0f4c1c95..4c3542f413 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf and b/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-notes-width.pdf b/macros/latex/contrib/reledmac/examples/2-notes-width.pdf index fa396cc06b..fe15c3bb6b 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-notes-width.pdf and b/macros/latex/contrib/reledmac/examples/2-notes-width.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf b/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf index 305b066157..0b98b45f9f 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf and b/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-performances.pdf b/macros/latex/contrib/reledmac/examples/2-performances.pdf index 12244b8f69..f962c5e6f3 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-performances.pdf and b/macros/latex/contrib/reledmac/examples/2-performances.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf b/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf index 922f1f5bc6..b1a24575ac 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf and b/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf b/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf index 1e38d33146..1f42f13dee 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf and b/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf index bdd55b8e45..cca58dc542 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf and b/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf b/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf index 94cdfe1659..06d90b3078 100644 Binary files a/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf and b/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf index fbca34a8c1..eb29881b67 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf index 45ac71f195..8926c5bba6 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf index ddc7c4e749..f8937f319b 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf index 2de01aef9e..8c7fad1e28 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf index 89e1ea3103..8fd4e56054 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf index a5f3355d67..e14e10e833 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf index 5f83fd57ee..d5beac997d 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf index 617e0ee82a..6c751b3fbf 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf index 593c24df9e..39a2542af1 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf index c80fd4b49f..635df762e1 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf index ff5d6911e6..57756dcdba 100644 Binary files a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf and b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf index 94804f51f5..4595f34253 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf index 67ae673b4f..7939487f6e 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf index e25c1b3650..d5286172bd 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf index e4bdc2d5cb..74a6bf7214 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf index 953a25666d..78bc00377b 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf index 93a9b9898f..8e1b25e4bc 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf index c442363e00..a61b80c32f 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf index 3785224913..3cb849d651 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf index 27570bd60c..1c8779e01d 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf index 3376b666bc..6dbba49ee4 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf index 042048f611..45bd9b223c 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf differ diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf index 4e93e687c9..206ce8a665 100644 Binary files a/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf and b/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf differ diff --git a/macros/latex/contrib/reledmac/migration.pdf b/macros/latex/contrib/reledmac/migration.pdf index 5c687349c4..1a5ad7baea 100644 Binary files a/macros/latex/contrib/reledmac/migration.pdf and b/macros/latex/contrib/reledmac/migration.pdf differ diff --git a/macros/latex/contrib/reledmac/reledmac.dtx b/macros/latex/contrib/reledmac/reledmac.dtx index 90a5e2558b..d5738c5e15 100644 --- a/macros/latex/contrib/reledmac/reledmac.dtx +++ b/macros/latex/contrib/reledmac/reledmac.dtx @@ -1322,7 +1322,7 @@ % \item You want to add the line number used by a previous edition of the work. % \item You want to typeset biblical text, and use division in verse. % \end{itemize} -% In such instances, you must add the second number manually, as \macpackage\ can't determine a general pattern for such numbering, which depends too heavily upon the edited text.\footnote{However, you may create your own commands dealing with such patterns which will in turn call \macpackage\ commands.} +% In such instances, you must add the second number manually, as \macpackage\ can't determine a general pattern for such numbering, which depends too heavily upon the edited text.\footnote{However, you may create your own commands dealing with such patterns which will in turn call \macpackage\ commands.}. % % \DescribeMacro{\linenumannotation} % To resolve this issue, \macpackage\ allows you to annotate line numbers using the following command: diff --git a/macros/latex/contrib/reledmac/reledmac.pdf b/macros/latex/contrib/reledmac/reledmac.pdf index a5b454de51..c1d2a8ed39 100644 Binary files a/macros/latex/contrib/reledmac/reledmac.pdf and b/macros/latex/contrib/reledmac/reledmac.pdf differ diff --git a/macros/latex/contrib/reledmac/reledpar.dtx b/macros/latex/contrib/reledmac/reledpar.dtx index e084103eaf..a619d76def 100644 --- a/macros/latex/contrib/reledmac/reledpar.dtx +++ b/macros/latex/contrib/reledmac/reledpar.dtx @@ -346,6 +346,7 @@ % \changes{v2.24.1}{2020/08/19}{Makes \protect\cs{numberstantzatrue} working with \protect\env{astanza}.} % \changes{v2.24.1}{2020/08/19}{Fixes incompatibility between lineation by \protect\cs{pstart} and (a)stanza.} % \changes{v2.24.2}{2020/09/16}{Fix some bugs with lineation by page, when a numbered section starts at the very beginning of page.} +% \changes{v2.24.3}{2020/11/08}{Fix bug with hanging verse in parallel typesetting.} % ^^A PW added following as the definitions are at some unknown elsewhere % % \newcommand{\egstart}{% @@ -1401,7 +1402,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledpar}[2020/09/16 v2.24.2 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2020/11/08 v2.24.3 reledmac extension for parallel texts]% % \end{macrocode} % \subsection{Package's requirement} @@ -5345,8 +5346,6 @@ \newcommand{\inserthangingsymbolL}{% \ifinserthangingsymbol% \ifinstanzaL% - \hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% \@hangingsymbol% \fi% \ifinastanzaL% @@ -5357,8 +5356,6 @@ \newcommand{\inserthangingsymbolR}{% \ifinserthangingsymbolR% \ifinstanzaR% - \hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% \@hangingsymbol% \fi% \ifinastanzaR% diff --git a/macros/latex/contrib/reledmac/reledpar.pdf b/macros/latex/contrib/reledmac/reledpar.pdf index 05dcb216ea..3f55ab7612 100644 Binary files a/macros/latex/contrib/reledmac/reledpar.pdf and b/macros/latex/contrib/reledmac/reledpar.pdf differ diff --git a/macros/latex/contrib/subfiles/subfiles.dtx b/macros/latex/contrib/subfiles/subfiles.dtx index 1a510c59b1..f5749c54cc 100644 --- a/macros/latex/contrib/subfiles/subfiles.dtx +++ b/macros/latex/contrib/subfiles/subfiles.dtx @@ -23,12 +23,12 @@ % %<*driver> % \fi -\ProvidesFile{subfiles.dtx}[2020/09/07 v2.0 Multi-file projects] +\ProvidesFile{subfiles.dtx}[2020/10/29 v2.1 Multi-file projects] % \iffalse \documentclass{ltxdoc} \GetFileInfo{subfiles.dtx} \title{A Document Class and a Package\\for Handling Multi-File Projects} -\date{2020/09/07 v2.0} +\date{2020/10/29 v2.1} \author{Federico Garcia, Gernot Salzer} \usepackage{hyperref} \begin{document} @@ -200,15 +200,15 @@ % The preamble of subfiles is skipped when loaded with |\subfile|, and everything after |\end{document}| is ignored. % In most cases this is what you want. % -% \DescribeMacro{v1} -% For reasons of compatibility, the option |v1| restores the behaviour of older versons: +% \DescribeMacro{[v1]} +% For reasons of compatibility, the option |v1| restores the behaviour of previous versions. % \begin{center} % |\usepackage[v1]{subfiles}| % \end{center} % This will have three effects. % % \emph{Code after the end of the main document} is added to the preamble of the subfiles, but is ignored when typesetting the main file. -% Here one can add commands that are to be processed as part of the preamble when the subfiles are typeset on their one. +% Here, one can add commands that are to be processed as part of the preamble when the subfiles are typeset on their one. % But this also means that any syntax error after |\end{document}| will ruin the \LaTeX ing of the subfile(s). % % \emph{Code in the preamble of a subfile} is processed as part of the text when typesetting the main file, but as part of the preamble when typesetting the subfile. @@ -279,6 +279,25 @@ % \end{center} % Then each of the three files can be typeset individually in its respective directory, where \LaTeX\ is able to locate all included text files and images. % +% \subsection{Cross-referencing between subfiles} +% When working with multiple subfiles under a main file, say |main.tex|, one may want to refer in subfile |A.tex| to labels in subfile |B.tex|. To make this work, load the package |xr| in the preamble of the main file and add an |\externaldocument| command after loading the |subfiles| package: +% \begin{center} +% \begin{tabular}{l} +% |\usepackage{xr}| \\ +% |\usepackage{subfiles}| \\ +% |\externaldocument[M-]{\subfix{main}}| +% \end{tabular} +% \end{center} +% In the |\externaldocument| command, |main| is the name of the main document. +% Moreover, |M-| is an arbitrary sequence of characters that is added as prefix to the labels. +% The |\subfix| command is only needed if the subfiles are not in the same directory as the main file, but it doesn't hurt if you add it in any case. +% +% To cross-reference between documents, add labels as usual. +% Suppose you have |\label{mylabel}| in any of the files. +% Then you can use |\ref{M-mylabel}| and |\pageref{M-mylabel}| to obtain the (page) number that the label refers to in the main document. +% +% Note that you first have to compile |main.tex|. +% This generates |main.aux|, which then can be loaded by the subfiles to provide the information for the labels prefixed with |M-|. % % \subsection{Avoiding extra spaces} % @@ -323,56 +342,57 @@ % \item % Make sure that |\usepackage{subfiles}| appears near the end of the main preamble. % \item -% Make sure that the strings |\begin{document}| and |\end{document}| appear on lines of their own and that there are no additional characters preceding or trailing them. -% \item % If some external program that cooperates with \TeX, like |bibtex| or |biber|, complains about not being able to find a file, locate the name of the file in the \LaTeX\ source and replace \meta{filename} by |\subfix{|\meta{filename}|}|. % \item -% If nothing of the above helps, ask the nice people on tex.stackexchange\footnote{\url{https://tex.stackexchange.com/}}. +% If nothing of the above helps, ask the nice people on tex.stackexchange\footnote{\url{https://tex.stackexchange.com/}} or file an issue in the bug tracker of the Github repository\footnote{\url{https://github.com/gsalzer/subfiles/issues}}. % \end{enumerate} +% % % \section{Dependencies} % -% The |subfiles| package uses the |import| package by Donald Arsenau to load subfiles from different directories. -% |import.sty| is part of the standard \TeX\ distribution. +% The |import| package by Donald Arsenau is needed to load subfiles from different directories. +% When the |standalone| package is used, the |subfiles| package requires the |xpatch| package by Enrico Gregorio to patch the command |\includestandalone|. +% Both packages are part of the standard \TeX\ distributions. +% % % \section{Version history} % -% \begin{description} +% \begin{enumerate} % \item[v1.1:] -% Initial version by Federico Garcia. Subsequent versions by Gernot Salzer. -% \item[v1.2:] \mbox{} +% Initial version by Federico Garcia. (Subsequent versions by Gernot Salzer.) +% \item[v1.2:] % \begin{itemize} % \item Incompatibility with classes and packages removed that modify the |\document| command, like the class |revtex4|. % \end{itemize} -% \item[v1.3:] \mbox{} +% \item[v1.3:] % \begin{itemize} % \item Use of |import| package to handle directory hierarchies. % \item |\ignorespaces| added to avoid spurious spaces. % \item Incompatibility with commands removed that expect |\document| to be equal to |\@onlypreamble| after the preamble. Thanks to Eric Domenjoud for analysing the problem. % \end{itemize} -% \item[v1.4:] \mbox{} +% \item[v1.4:] % \begin{itemize} % \item Incompatibility with |memoir| class and |comment| package removed. % \item Bug `|\unskip| cannot be used in vertical mode` fixed. % \end{itemize} -% \item[v1.5:] \mbox{} +% \item[v1.5:] % \begin{itemize} % \item Command |\subfileinclude| added. % \item Basic support for |bibtex| related bibliographies in subfiles added. % Seems to suffice also for sub-bibliographies with the package |chapterbib|. % \item Support for sub-bibliographies with package |bibunits| added. % \end{itemize} -% \item[v1.6:] \mbox{} +% \item[v1.6:] % \begin{itemize} % \item Support for sub-bibliographies with package |bibunits| dropped, in favor of |\subfix|. % \item Command |\subfix| added. % \item Incompatibility with |standalone| class removed. % \item The options of the main class are now also processed when typesetting a subfile; before they were ignored. Thanks to J\'an Kl'uka for analysing the problem. % \end{itemize} -% \item[v2.0:] \mbox{} +% \item[v2.0:] % \begin{itemize} % \item Incompatibility with \LaTeX\ Oct.~2020 removed. -% Thanks to Ulrike \mbox{Fischer} from the \LaTeX~3 team for the warning in time. +% Thanks to Ulrike \mbox{Fischer} from the \LaTeX3 team for the timely warning. % \item By default, text after |\end{document}| as well as the preamble of subfiles, when loaded with |\subfile|, are ignored now. % The old behaviour is available via the new package option |v1|. % \item Command |\ifSubfilesClassLoaded| added and documentation regarding the use of the |\bibliography| command corrected. @@ -382,14 +402,26 @@ % \item Problem with the search path for images resolved. % Thanks to Github user |maxnick| for reporting the issue. % \end{itemize} -% \end{description} +% \item[v2.1] +% \begin{itemize} +% \item Bugfix: In some situations, the hooks of |\begin{document}| and |\end{document}| were triggered when loading a subfile. +% This occurred in particular with packages for handling CJK languages. +% Thanks to Github user |yuishin-kikuchi| for reporting the issue. +% \item Section about cross-referencing added. +% Thanks to Github user |ndvanforeest| for the input. +% \end{itemize} +% \end{enumerate} % %\section{The Implementation} %\subsection{The class} -% \begin{macrocode} +% +% \iffalse %<*class> +% \fi +% +% \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{subfiles}[2020/09/07 v2.0 Multi-file projects (class)] +\ProvidesClass{subfiles}[2020/10/29 v2.1 Multi-file projects (class)] \DeclareOption*{% \typeout{Preamble taken from file `\CurrentOption'}% \let\preamble@file\CurrentOption @@ -422,6 +454,7 @@ % In earlier versions, we used |\subimport| to load the preamble of the main file, which has the unwanted effect of undoing changes to the graphics path. % Therefore we use |\input| and initialize |\import@path| and |\input@path| to the path of the main file. % We use the internal \LaTeX\ macro |\filename@parse| to obtain this path. +% % \begin{macrocode} \filename@parse{\preamble@file} \edef\import@path{\filename@area} @@ -429,112 +462,195 @@ \input{\preamble@file} % \end{macrocode} % -% After loading the preamble of the main file, we reset |\import@path{}|. +% After loading the preamble of the main file, we reset |\import@path|. % Since the preamble may have changed the catcode of the |@| sign, we make it (again) a letter. Better safe than sorry. % % \begin{macrocode} {\makeatletter \gdef\import@path{} } -% % \end{macrocode} % +% \iffalse +% +% \fi +% % % \subsection{The package} -% \begin{macrocode} +% +% \iffalse %<*package> +% \fi +% +% \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{subfiles}[2020/09/07 v2.0 Multi-file projects (package)] +\ProvidesPackage{subfiles}[2020/10/29 v2.1 Multi-file projects (package)] +% \end{macrocode} +% \subsubsection*{Auxiliary commands} +% \begin{flushleft} +% |\ifDOCUMENT{|\meta{string}|}{|\meta{then code}|}{|\meta{else code}|}|\\ +% If \meta{string} equals |document|, then execute \meta{then code}, else \meta{else code}. +% \end{flushleft} +% \begin{macrocode} +\def\subfiles@DOCUMENT{document} +\def\ifDOCUMENT#1#2#3{% + \def\subfiles@tmp{#1}% + \ifx\subfiles@tmp\subfiles@DOCUMENT + \def\subfiles@tmp{#2}% + \else + \def\subfiles@tmp{#3}% + \fi + \subfiles@tmp +} % \end{macrocode} % -% The package has one option, |v1|, which affects the way how the text after |\end{document}| and in the preamble of subfiles is handled. -% With this option, |subfiles| behaves like in version 1.x. -% To implement the retro behaviour, we need a few definitions. +% \begin{flushleft} +% |\subfiles@renewDocument{begin}{|\meta{begin-document-code}|}|\\ +% |\subfiles@renewDocument{end}{|\meta{end-document-code}|}|\\ +% Redefines |\begin|/|\end| to execute the given code in place of the next |\begin{document}|/|\end{document}|. +% \end{flushleft} +% \begin{macrocode} +\def\subfiles@renewDocument#1#2{% + \expandafter\def\csname#1\endcsname##1{% + \ifDOCUMENT{##1}{% + \expandafter\let\csname#1\expandafter\endcsname\csname subfiles@#1\endcsname + #2% + }{% + \csname subfiles@#1\endcsname{##1}% + }% + }% +} +% \end{macrocode} +% |\subfiles@renewDocument{begin}{}| is actually the same as +% \begin{verbatim} +%\def\begin#1{% +% \ifDOCUMENT{#1}{% +% \let\begin\subfiles@begin +% +% }{% +% \subfiles@begin{#1}% +% }% +%}%\end{verbatim} +% \begin{flushleft} +% |\subfiles@newSkipToDocument\begin|\meta{cmd}|{|\meta{continuation}|}|\\ +% |\subfiles@newSkipToDocument\end|\meta{cmd}|{|\meta{continuation}|}|\\ +% Defines \meta{cmd} to skip to the next |\begin{document}| or |\end{document}| and to execute \meta{continuation}. +% \end{flushleft} % -% First, we define three macros containing the strings |\begin{document}|, |\end{document}| and |document|. -% We need them later to detect these strings in the input. % \begin{macrocode} -\def\subfiles@DOCUMENT{document} -{\escapechar=-1\relax - \xdef\subfiles@BEGINDOCUMENT{\string\\begin\string\{document\string\}}% - \xdef\subfiles@ENDDOCUMENT{\string\\end\string\{document\string\}}% +\def\subfiles@newSkipToDocument#1#2#3{% + \long\def#2##1#1##2{\ifDOCUMENT{##2}{#3}{#2}}% } % \end{macrocode} % -% The macro |\subfiles@skipDocument| skips everything until it encounters the string |\end{document}|. -% In earlier versions of the package, this was accomplished by redefining the |document| environment to the |comment| environment of the |verbatim| package. -% This clashes with the \LaTeX\ format published in October 2020, so we copy and adapt the code from the |verbatim| package (see the definition of |\subfiles@skiplines| below). +% \subsubsection*{Handling the main document} % +% When the main document is loaded from a subfile, the preamble is read, but the document itself is skipped. +% The lines after |\end{document}| are treated again as part of the preamble in old versions (1.x), but are ignored in new versions (2.x). +% % \begin{macrocode} -\def\subfiles@skipDocument{% - \let\subfiles@skiplinescont\ignorespaces - \let\subfiles@skiplinesend\subfiles@ENDDOCUMENT - \subfiles@skiplines +\def\subfiles@handleMainDocumentVi{% + \let\subfiles@begin\begin + \subfiles@renewDocument{begin}{% + \subfiles@newSkipToDocument\end\subfiles@skipToEndDocument\ignorespaces + \subfiles@skipToEndDocument + }% +} +\def\subfiles@handleMainDocumentVii{% + \let\subfiles@begin\begin + \subfiles@renewDocument{begin}{% + \endinput + \ignorespaces + }% } % \end{macrocode} % -% To skip |\documentclass| the old way, we redefine it to do nothing except restoring its original definition. +% \subsubsection*{Handling subfiles} +% +% When a subfile is loaded, the preamble and |\end{document}| have to be ignored. +% More precisely, in older versions (v1.x), the following happens: +% \begin{itemize} +% \item |\documentclass[...]{subfiles}| is ignored. +% \item The contents of the preamble becomes part of the text. +% \item |\begin{document}| is ignored. +% \item |\end{document}| is ignored. +% \item Any lines after |\end{document}| are also part of the text. +% \end{itemize} % % \begin{macrocode} -\def\subfiles@skipDocumentclass{% - \renewcommand\documentclass[2][]{% +\def\subfiles@handleSubDocumentVi{% + \let\subfiles@documentclass\documentclass + \def\documentclass{% + \@ifnextchar[\subfiles@documentclass@{\subfiles@documentclass@[]}% + }% + \def\subfiles@documentclass@[##1]##2{% \let\documentclass\subfiles@documentclass \ignorespaces }% + \let\subfiles@begin\begin + \subfiles@renewDocument{begin}{% + \subfiles@saveEnd + \subfiles@renewDocument{end}\ignorespaces + \ignorespaces + }% } % \end{macrocode} +% In newer versions (v2.x), the following happens: +% \begin{itemize} +% \item The preamble, up to |\begin{document}|, is ignored. +% \item |\end{document}| as well as any lines after it are ignored. +% \end{itemize} % -% To ignore the preamble of a subfile, we redefine |\documentclass| to skip everything until the string |\begin{document}| is encountered. % \begin{macrocode} -\def\subfiles@skipPreamble{% - \def\documentclass{% +\def\subfiles@handleSubDocumentVii{% + \let\subfiles@documentclass\documentclass + \subfiles@newSkipToDocument\begin\documentclass{% \let\documentclass\subfiles@documentclass - \def\subfiles@skiplinescont{\begin{document}}% - \let\subfiles@skiplinesend\subfiles@BEGINDOCUMENT - \subfiles@skiplines + \subfiles@saveEnd + \subfiles@renewDocument{end}{% + \endinput + \ignorespaces + }% + \ignorespaces }% } % \end{macrocode} % -% Now we set the default behaviour of the subfiles package: -% When loading the main preamble in a subfile, everything after the preamble is ignored. -% Moreover, when reading a subfile, its preamble as well as everything after |\end{document}| is ignored. +% Before redefining |\begin| and |\end|, we remember their original definitions in |\subfiles@begin| and |\subfiles@end|. +% We don't do this once and for all in the preamble, because there might be other packages also fiddling with these commands. +% To reset |\begin| to the definition it had at the point where we modified it, we do |\let\subfiles@begin\begin| immediately before redefining it. +% For |\end|, the situation is different. +% For nested subfiles, |\end| does not have its original definition but ours. +% Therefore we save |\end| only if |\subfiles@end| is still undefined (meaning that we are outside of subfiles). +% % \begin{macrocode} -\let\subfiles@handleMain\endinput -\let\subfiles@handleSubpreamble\subfiles@skipPreamble -\let\subfiles@handleTextAfterSubdocument\endinput +\def\subfiles@saveEnd{% + \ifcsname subfiles@end\endcsname + \else + \let\subfiles@end\end + \fi +} % \end{macrocode} % -% The option |v1| restores the behaviour of the old |subfiles| package: When loading the main preamble in a subfile, only the contents of the |document| environent is ignored, but not the stuff following it. Moreover, when reading a subfile, only the |\documentclass| command and the lines |\begin{document}| and |\end{document}| are ignored, but the subfile preamble as well as everything after |\end{document}| is retained. +% \subsubsection*{Processing the package options} +% +% The package has currently only one option, |v1|, which affects the way how the text after |\end{document}| and in the preamble of subfiles is handled. +% We initialize the macros for handling main and sub documents with the behavior of version 2.x. +% \begin{macrocode} +\let\subfiles@handleMainDocument\subfiles@handleMainDocumentVii +\let\subfiles@handleSubDocument\subfiles@handleSubDocumentVii +% \end{macrocode} +% When option |v1| is present, the macros are set to the behavior of version 1.x. % \begin{macrocode} \DeclareOption{v1}{% - \let\subfiles@handleMain\subfiles@skipDocument - \let\subfiles@handleSubpreamble\subfiles@skipDocumentclass - \let\subfiles@handleTextAfterSubdocument\relax + \let\subfiles@handleMainDocument\subfiles@handleMainDocumentVi + \let\subfiles@handleSubDocument\subfiles@handleSubDocumentVi } \DeclareOption*{\PackageWarning{subfiles}{Option '\CurrentOption' ignored}} \ProcessOptions\relax % \end{macrocode} -% -% To skip everything until a specific string is read, we adapt code from the |verbatim| package. -% The skipping of lines is controlled by two macros that have to be set before calling |\subfiles@skiplines|. -% |\subfiles@skiplinesend| is the string that marks the end of the skipped area; it has to appear on a line of its own, as the only content of this line. -% |\subfiles@skiplinescont| contains the code to be executed after skipping has ended. -% -% \begin{macrocode} -\def\subfiles@skiplines{% - \begingroup - \let\do\@makeother\dospecials - \@makeother\^^L% - \endlinechar`\^^M\relax \catcode`\^^M=12\relax \subfiles@skipline} -{\catcode`\^^M=12 \endlinechar=-1 % - \gdef\subfiles@skipline#1^^M{\def\subfiles@tmp{#1}% - \ifx\subfiles@tmp\subfiles@skiplinesend - \def\subfiles@tmp{\endgroup\subfiles@skiplinescont}% - \else\let\subfiles@tmp\subfiles@skipline - \fi \subfiles@tmp} -} -% \end{macrocode} +% +% \subsubsection*{Loading subfiles} % % To handle subfiles in separate directories, we use the |import| package. % If it has already been loaded, e.g.\ by the |subfiles| class, this line does nothing. @@ -542,7 +658,7 @@ \RequirePackage{import} % \end{macrocode} % -% The |\subimport| command requires path and filename as separate arguments, so we have to split file locations into these two components. +% The |\subimport| command requires path and filename as separate arguments, so we have to split qualified filenames into these two components. % The internal \LaTeX\ command |\filename@parse| almost fits the bill, except that it additionally splits the filename into basename and extension. % Unfortunately, concatenating basename and extension to recover the filename is not clean: % Under Unix/Linux, the filenames |base| and |base.| denote different entities, but after |\filename@parse| both have the same basename and an empty extension. @@ -579,36 +695,21 @@ } % \end{macrocode} % -% The main functionality of the two commands is implemented in |\subfiles@subfile|. -% It redefines |\documentclass| and the |document| environment to do nothing but reverting these command to their original meaning and avoiding spurious spaces. -% Reverting |\documentclass| and |\document| to their original definition is important for being compatible with classes like |standalone| or packages like |bibentry|, which rely on this definition. +% The main functionality is implemented in |\subfiles@subfile|. +% It sets up the handling of the sub-preamble, splits the filename and loads the subfile. % % \begin{macrocode} -\newcommand\subfiles@subfile[1]{% +\def\subfiles@subfile#1{% \begingroup - \let\subfiles@documentclass\documentclass - \let\subfiles@document\document - \let\subfiles@enddocument\enddocument - \subfiles@handleSubpreamble - \renewenvironment{document}{% - \let\document\subfiles@document - \ignorespaces - }{% - \let\enddocument\subfiles@enddocument - \@ignoretrue - \subfiles@handleTextAfterSubdocument - }% -% \end{macrocode} -% -% Now we split the file name into path and base name and load the file. -% -% \begin{macrocode} + \subfiles@handleSubDocument \subfiles@split{#1}% \subfiles@loadfile{\filename@area}{\filename@base}% \endgroup } % \end{macrocode} % +% \subsubsection*{Fixing incompatibilities} +% % \DescribeMacro{\subfix} % If some package provides a command that takes a filename as argument, then it has to be prefixed with the current |\import@path|. % This is what the |\subfix| command tries to do. @@ -643,13 +744,13 @@ % % \begin{macrocode} \let\subfiles@bibliography\bibliography -\renewcommand\bibliography[1]{% +\def\bibliography#1{% \subfiles@fixfilelist{#1}% \expandafter\subfiles@bibliography\expandafter{\subfiles@list}% } \@ifpackageloaded{graphics}{% \let\subfiles@graphicspath\graphicspath - \renewcommand\graphicspath[1]{% + \def\graphicspath#1{% \subfiles@fixpathlist{#1}% \edef\subfiles@list{{\subfix{}}\subfiles@list}% \expandafter\subfiles@graphicspath\expandafter{\subfiles@list}% @@ -657,6 +758,25 @@ }{} % \end{macrocode} % +% \DescribeMacro{\includestandalone} +% The command |\includestandalone| handles subfiles in its own way. +% Therefore we modify it to use the original definition of |\end|. +% +% \begin{macrocode} +\@ifpackageloaded{standalone}{ + \RequirePackage{xpatch} + \xpretocmd\includestandalone{% + \let\subfiles@end@\end + \ifcsname subfiles@end\endcsname + \let\end\subfiles@end + \fi + }{}{} + \xapptocmd\includestandalone{\let\end\subfiles@end@}{}{} +}{} +% \end{macrocode} +% +% \subsubsection*{Do we typeset the main file or a subfile?} +% % \DescribeMacro{\ifSubfilesClassLoaded} % To add code or text conditionally, depending on whether the main document or a subfile is typeset, we provide the command |\ifSubfilesClassLoaded|. % @@ -670,26 +790,17 @@ } % \end{macrocode} % -% The |subfiles| package is loaded near the end of the main preamble. -% If it is loaded from a subfile, i.e., if |subfiles.cls| has been loaded, then we have to prepare for skipping the main document. -% We do this be redefining the |\begin| command. -% Normally, the first |\begin| after the |subfiles| package starts the main document. -% To allow for the case that some other environment occurs before (does it really happen?) we test whether we are dealing with |\begin{document}|. -% If not, we execute the original definition of |\begin|; otherwise we skip the main document as specified by |\subfiles@handleMain|. % +% \subsubsection*{The end is near} +% +% The |subfiles| package is loaded near the end of the main preamble. +% If it is loaded from a subfile, i.e., if |subfiles.cls| has been loaded, then we prepare for skipping the main document. % \begin{macrocode} \ifSubfilesClassLoaded{% - \let\subfiles@begin\begin - \def\begin#1{% - \def\subfiles@tmp{#1}% - \ifx\subfiles@tmp\subfiles@DOCUMENT - \let\begin\subfiles@begin - \let\subfiles@tmp\subfiles@handleMain - \else - \def\subfiles@tmp{\subfiles@begin{#1}}% - \fi - \subfiles@tmp - }% + \subfiles@handleMainDocument }{} -% % \end{macrocode} +% +% \iffalse +% +% \fi diff --git a/macros/latex/contrib/subfiles/subfiles.pdf b/macros/latex/contrib/subfiles/subfiles.pdf index ae8b02f6af..da66849064 100644 Binary files a/macros/latex/contrib/subfiles/subfiles.pdf and b/macros/latex/contrib/subfiles/subfiles.pdf differ diff --git a/macros/latex/contrib/translations/README b/macros/latex/contrib/translations/README index 4f93dfa1da..e9a9f012f8 100644 --- a/macros/latex/contrib/translations/README +++ b/macros/latex/contrib/translations/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the TRANSLATIONS package v1.8b - 2020/04/28 +the TRANSLATIONS package v1.9 - 2020/11/08 internationalization of LaTeX2e packages -------------------------------------------------------------------------- @@ -10,12 +10,12 @@ E-Mail: contact@mychemistry.eu Copyright 2012--2020 Clemens Niederberger This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 +conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of LaTeX -version 2005/12/01 or later. +and version 1.3c or later is part of all distributions of LaTeX +version 2008/05/04 or later. This work has the LPPL maintenance status `maintained'. @@ -23,6 +23,7 @@ The Current Maintainer of this work is Clemens Niederberger. -------------------------------------------------------------------------- The translations package consists of the files - translations.sty, translations_en.tex, translations_en.pdf, + translations-basic-dictionary-brazil.trsl, translations-basic-dictionary-catalan.trsl, translations-basic-dictionary-english.trsl, translations-basic-dictionary-dutch.trsl, diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-brazil.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-brazil.trsl new file mode 100644 index 0000000000..9d0c440480 --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-brazil.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012--2020 Clemens Niederberger +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{Brazil}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Resumo} +\ProvideDictTranslation{Addresses}{Endere\c{c}os} +\ProvideDictTranslation{addresses}{endere\c{c}os} +\ProvideDictTranslation{Address}{Endere\c{c}o} +\ProvideDictTranslation{address}{Endere\c{c}o} +\ProvideDictTranslation{and}{e} +\ProvideDictTranslation{Appendix}{Ap\^{e}ndice} +\ProvideDictTranslation{Authors}{Autores} +\ProvideDictTranslation{authors}{autores} +\ProvideDictTranslation{Author}{Autor} +\ProvideDictTranslation{author}{autor} +\ProvideDictTranslation{Bibliography}{Bibliografia} +\ProvideDictTranslation{cc}{c\slash{c}} +\ProvideDictTranslation{Chapters}{Cap\'{i}tulos} +\ProvideDictTranslation{chapters}{cap\'{i}tulos} +\ProvideDictTranslation{Chapter}{Cap\'{i}tulo} +\ProvideDictTranslation{chapter}{cap\'{i}tulo} +\ProvideDictTranslation{Conclusion}{Conclus\~{a}o} +\ProvideDictTranslation{conclusion}{conclus\~{a}o} +\ProvideDictTranslation{Contents}{Conte\'{u}do} +\ProvideDictTranslation{Continuation}{Continua\c{c}\~{a}o} +\ProvideDictTranslation{continuation}{continua\c{c}\~{a}o} +\ProvideDictTranslation{cont}{cont.} +\ProvideDictTranslation{encl (plural)}{anexos} +\ProvideDictTranslation{encl (singular)}{anexo} +\ProvideDictTranslation{encl}{anexo} +\ProvideDictTranslation{Figures}{Figuras} +\ProvideDictTranslation{figures}{figuras} +\ProvideDictTranslation{Figure}{Figura} +\ProvideDictTranslation{figure}{figura} +\ProvideDictTranslation{From}{De} +\ProvideDictTranslation{from}{de} +\ProvideDictTranslation{Glossary}{Gloss\'{a}rio} +\ProvideDictTranslation{Index}{\'{I}ndice} +\ProvideDictTranslation{Introduction}{Introdu\c{c}\~{a}o} +\ProvideDictTranslation{introduction}{introdu\c{c}\~{a}o} +\ProvideDictTranslation{List of Figures and Tables}{Lista de Figuras e Tabelas} +\ProvideDictTranslation{List of Figures}{Lista de Figuras} +\ProvideDictTranslation{List of Tables}{Lista de Tabelas} +\ProvideDictTranslation{or}{ou} +\ProvideDictTranslation{Outline}{T\'{o}picos} +\ProvideDictTranslation{Overview}{Vis\~{a}o Geral} +\ProvideDictTranslation{Pages}{P\'{a}ginas} +\ProvideDictTranslation{pages}{p\'{a}ginas} +\ProvideDictTranslation{Page}{P\'{a}gina} +\ProvideDictTranslation{page}{p\'{a}gina} +\ProvideDictTranslation{Paragraphs}{Par\'{a}grafos} +\ProvideDictTranslation{paragraphs}{par\'{a}grafos} +\ProvideDictTranslation{Paragraph}{Par\'{a}grafo} +\ProvideDictTranslation{paragraph}{par\'{a}grafo} +\ProvideDictTranslation{Parts}{Partes} +\ProvideDictTranslation{parts}{partes} +\ProvideDictTranslation{Part}{Parte} +\ProvideDictTranslation{part}{parte} +\ProvideDictTranslation{Preface}{Pref\'{a}cio} +\ProvideDictTranslation{Proofs}{Demonstra\c{c}\~{o}es} +\ProvideDictTranslation{proofs}{demonstra\c{c}\~{o}es} +\ProvideDictTranslation{Proof}{Demonstra\c{c}\~{a}o} +\ProvideDictTranslation{proof}{demonstra\c{c}\~{a}o} +\ProvideDictTranslation{References}{Refer\^{e}ncias} +\ProvideDictTranslation{Related work}{Trabalho Relacionado} +\ProvideDictTranslation{Related Work}{Trabalho relacionado} +\ProvideDictTranslation{Sections}{Se\c{c}\~{o}es} +\ProvideDictTranslation{sections}{se\c{c}\~{o}es} +\ProvideDictTranslation{Section}{Se\c{c}\~{a}o} +\ProvideDictTranslation{section}{se\c{c}\~{a}o} +\ProvideDictTranslation{See also}{Ver tamb\'{e}m} +\ProvideDictTranslation{see also}{ver tamb\'{e}m} +\ProvideDictTranslation{See}{Ver} +\ProvideDictTranslation{see}{ver} +\ProvideDictTranslation{Sketch of Proofs}{Esboço de Demonstra\c{c}\~{o}es} +\ProvideDictTranslation{Sketch of proofs}{Esboço de demonstra\c{c}\~{o}es} +\ProvideDictTranslation{Sketch of Proof}{Esboço de Demonstra\c{c}\~{a}o} +\ProvideDictTranslation{Sketch of proof}{Esboço de demonstra\c{c}\~{a}o} +\ProvideDictTranslation{Subsections}{Subse\c{c}\~{o}es} +\ProvideDictTranslation{subsections}{subse\c{c}\~{o}es} +\ProvideDictTranslation{Subsection}{Subse\c{c}\~{a}o} +\ProvideDictTranslation{subsection}{subse\c{c}\~{a}o} +\ProvideDictTranslation{Summary}{Sum\'{a}rio} +\ProvideDictTranslation{Tables}{Tabelas} +\ProvideDictTranslation{tables}{tabelas} +\ProvideDictTranslation{Table}{Tabela} +\ProvideDictTranslation{table}{tabela} +\ProvideDictTranslation{To}{Para} +\ProvideDictTranslation{to}{para} + +\ProvideDictTranslation{Monday}{Segunda-feira} +\ProvideDictTranslation{Tuesday}{Terça-feira} +\ProvideDictTranslation{Wednesday}{Quarta-feira} +\ProvideDictTranslation{Thursday}{Quinta-feira} +\ProvideDictTranslation{Friday}{Sexta-feira} +\ProvideDictTranslation{Saturday}{S\'{a}bado} +\ProvideDictTranslation{Sunday}{Domingo} + +\ProvideDictTranslation{January}{Janeiro} +\ProvideDictTranslation{February}{Fevereiro} +\ProvideDictTranslation{March}{Mar\c{c}o} +\ProvideDictTranslation{April}{Abril} +\ProvideDictTranslation{May}{Maio} +\ProvideDictTranslation{June}{Junho} +\ProvideDictTranslation{July}{Julho} +\ProvideDictTranslation{August}{Agosto} +\ProvideDictTranslation{September}{Setembro} +\ProvideDictTranslation{October}{Outubro} +\ProvideDictTranslation{November}{Novembro} +\ProvideDictTranslation{December}{Dezembro} + diff --git a/macros/latex/contrib/translations/translations.sty b/macros/latex/contrib/translations/translations.sty index 1749329c9b..49418ecc85 100644 --- a/macros/latex/contrib/translations/translations.sty +++ b/macros/latex/contrib/translations/translations.sty @@ -25,8 +25,8 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -\newcommand*\@trnslt@date{2020/04/28} -\newcommand*\@trnslt@version{v1.8b} +\newcommand*\@trnslt@date{2020/11/08} +\newcommand*\@trnslt@version{v1.9} \newcommand*\@trnslt@packageinfo{internationalization of LaTeX2e packages} \ProvidesPackage{translations}[% @@ -86,14 +86,18 @@ % -------------------------------------------------------------------------- % test string equality, expandably: -\newcommand\@trnslt@ifstrequal[2]{% - \ifnum\pdf@strcmp{\unexpanded{#1}}{\unexpanded{#2}}=\z@ +\newcommand\@trnslt@ifstrequalTF[2]{% + \@trnslt@ifstrequal{#1}{#2}% \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi } +\newcommand\@trnslt@ifstrequal[2]{% + \ifnum\pdf@strcmp{\unexpanded{#1}}{\unexpanded{#2}}=\z@ +} + \long\def\@trnslt@getnext@braced#1#2#3{#2\@trnslt@firstofone{#3{#1}}} \long\def\@trnslt@firstofone#1{#1} \long\def\@trnslt@braced@expanded@fully#1\@trnslt@firstofone#2#3{% @@ -258,6 +262,15 @@ % #1: language % #2: true % #3: false +\newcommand*\@trnslt@iflanguageTF[1]{% + \@trnslt@braced@expanded@fully + \@trnslt@braced@expanded@fully + \@trnslt@firstofone + \@trnslt@ifstrequalTF + {\@trnslt@language{#1}} + {\@trnslt@language{\languagename}}% +} + \newcommand*\@trnslt@iflanguage[1]{% \@trnslt@braced@expanded@fully \@trnslt@braced@expanded@fully @@ -268,6 +281,19 @@ } % check the current /base/ language, expandably: +\newcommand*\@trnslt@ifbaselanguageTF[1]{% + \@trnslt@if@dialect{\languagename} + {% + \@trnslt@braced@expanded@fully + \@trnslt@braced@expanded@fully + \@trnslt@firstofone + \@trnslt@ifstrequalTF + {\@trnslt@language{\@trnslt@dialect@of{\languagename}}} + {\@trnslt@language{#1}}% + } + {\@trnslt@iflanguageTF{#1}}% +} + \newcommand*\@trnslt@ifbaselanguage[1]{% \@trnslt@if@dialect{\languagename} {% @@ -283,9 +309,16 @@ % user commands for the above: \newcommand*\ifcurrentlanguage[1]{% - \@trnslt@iflanguage{#1}% + \@trnslt@iflanguageTF{#1}% } \newcommand*\ifcurrentbaselanguage[1]{% + \@trnslt@ifbaselanguageTF{#1}% +} + +\newcommand*\ifcurrentlang[1]{% + \@trnslt@iflanguage{#1}% +} +\newcommand*\ifcurrentbaselang[1]{% \@trnslt@ifbaselanguage{#1}% } @@ -1196,3 +1229,8 @@ available) 2020/04/26 v1.8a - fix problem with loading of dictionaries in some circumstances +2020/04/28 v1.8b - fix issue #9 +2020/11/08 v1.9 - add \ifcurrentlang{} ... \else ... \fi + - add \ifcurrentbaselang{} ... \else ... \fi + - add Brazilian basic dictionary + diff --git a/macros/latex/contrib/translations/translations_en.pdf b/macros/latex/contrib/translations/translations_en.pdf index 427707ca89..fea9e5ce3f 100644 Binary files a/macros/latex/contrib/translations/translations_en.pdf and b/macros/latex/contrib/translations/translations_en.pdf differ diff --git a/macros/latex/contrib/translations/translations_en.tex b/macros/latex/contrib/translations/translations_en.tex index 340eaafac8..7118e67b3e 100644 --- a/macros/latex/contrib/translations/translations_en.tex +++ b/macros/latex/contrib/translations/translations_en.tex @@ -1,7 +1,7 @@ -% arara: pdflatex: { shell: on, interaction: nonstopmode } +% !arara: pdflatex: { shell: on, interaction: nonstopmode } % !arara: biber -% !arara: pdflatex -% !arara: pdflatex +% arara: pdflatex +% arara: pdflatex % -------------------------------------------------------------------------- % the TRANSLATIONS package % @@ -30,7 +30,7 @@ % feel free to contact me. % -------------------------------------------------------------------------- \documentclass[load-preamble]{cnltx-doc} -\usepackage[french,spanish,ngerman,english]{babel} +\usepackage[french,brazil,spanish,ngerman,english]{babel} % ---------------------------------------------------------------------------- \usepackage{imakeidx} % document layout and typographic features @@ -52,6 +52,8 @@ declaretranslationfallback, GetTranslation, GetTranslationFor, + ifcurrentbaselang, + ifcurrentlang, IfTranslation, LoadDictionary, LoadDictionaryFor, @@ -98,7 +100,8 @@ % ---------------------------------------------------------------------------- % other packages, bibliography, index \usepackage{array,longtable,booktabs} -\AfterPackage!{hyperref}{\usepackage[sort]{cleveref}} +\usepackage{hyperref} +\usepackage[sort]{cleveref} % ---------------------------------------------------------------------------- % example definitions that have to be done in the preamble: @@ -115,6 +118,8 @@ \newrobustcmd\fnote[1]{\textsuperscript{#1}} +\tracingmacros=1 + \begin{document} \section{Motivation} @@ -423,12 +428,18 @@ Commands without the marker aren't expandable. \sinceversion{1.2}Places \meta{true} in the input stream if the current language is \meta{lang}. Note: a dialect counts as a language of it's own here. \cs{ifcurrentlanguage}\Marg{English} will for example be - \meta{false} if the current \pkg{babel} language is \code{american}. + \meta{false} if the current \pkg{babel} language is \code{american}. + \expandable\command{ifcurrentlang}[\marg{lang}] + \sinceversion{1.9}The same as \cs{ifcurrentlanguage} but uses the + \dots\cs{else}\dots\cs*{fi} syntax. \expandable\command{ifcurrentbaselanguage}[\marg{lang}\marg{true}\marg{false}] \sinceversion{1.2}Places \meta{true} in the input stream if the current language is \meta{lang}. Note: a dialect does not count as a language of it's own here. If the current \pkg{babel} language is \code{american} then \cs{ifcurrentbaselanguage}\Marg{English} will be \meta{true}. + \expandable\command{ifcurrentbaselang}[\marg{lang}] + \sinceversion{1.9}The same as \cs{ifcurrentbaselanguage} but uses the + \dots\cs{else}\dots\cs*{fi} syntax. \end{commands} \subsection{A Small Example} @@ -617,6 +628,7 @@ Every dictionary file \emph{must} contain the declaration \subsubsection{\translations' Basic Dictionaries}\label{sec:transl-basic-dict} \translations\ already provides a basic dictionary for the languages \begin{itemize} + \item Brazilian, \item Catalan, \item English, \item Dutch, -- cgit v1.2.3