From 460879b45ff6e83765da88734e8cc0c6da5043eb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 2 Feb 2022 03:04:47 +0000 Subject: CTAN sync 202202020304 --- macros/latex/contrib/csvsimple/CHANGES.md | 14 + macros/latex/contrib/csvsimple/README.md | 2 +- macros/latex/contrib/csvsimple/csvsimple-doc.sty | 6 +- .../latex/contrib/csvsimple/csvsimple-example.pdf | Bin 75628 -> 75624 bytes .../latex/contrib/csvsimple/csvsimple-example.tex | 2 +- macros/latex/contrib/csvsimple/csvsimple-l3.pdf | Bin 1087253 -> 1093900 bytes macros/latex/contrib/csvsimple/csvsimple-l3.sty | 53 +- macros/latex/contrib/csvsimple/csvsimple-l3.tex | 56 +- .../latex/contrib/csvsimple/csvsimple-legacy.pdf | Bin 823839 -> 823702 bytes .../latex/contrib/csvsimple/csvsimple-legacy.sty | 4 +- .../latex/contrib/csvsimple/csvsimple-legacy.tex | 2 +- macros/latex/contrib/csvsimple/csvsimple.pdf | Bin 309007 -> 309204 bytes macros/latex/contrib/csvsimple/csvsimple.sty | 4 +- macros/latex/contrib/csvsimple/csvsimple.tex | 2 +- macros/latex/contrib/dtxdescribe/README.txt | 5 +- macros/latex/contrib/dtxdescribe/dtxdescribe.dtx | 658 ++-- macros/latex/contrib/dtxdescribe/dtxdescribe.pdf | Bin 334193 -> 389219 bytes macros/latex/contrib/easybook/easybook.dtx | 6 +- macros/latex/contrib/easybook/easybook.pdf | Bin 575824 -> 575857 bytes macros/latex/contrib/easybook/easybook.tex | 52 +- macros/latex/contrib/fcolumn/README | 11 +- macros/latex/contrib/fcolumn/fcolumn.dtx | 595 ++-- macros/latex/contrib/fcolumn/fcolumn.ins | 6 +- macros/latex/contrib/fcolumn/fcolumn.pdf | Bin 318179 -> 319237 bytes macros/latex/contrib/fcolumn/makefile | 2 +- macros/latex/contrib/lwarp/README.txt | 4 +- macros/latex/contrib/lwarp/lwarp.dtx | 3649 ++++++++++++-------- macros/latex/contrib/lwarp/lwarp.ins | 2 + macros/latex/contrib/lwarp/lwarp.pdf | Bin 3144374 -> 3176264 bytes macros/latex/contrib/lwarp/lwarpmk.lua | 13 +- macros/latex/contrib/mindflow/README.md | 4 +- macros/latex/contrib/mindflow/mindflow.dtx | 112 +- macros/latex/contrib/mindflow/mindflow.pdf | Bin 172607 -> 191911 bytes macros/latex/contrib/proof-at-the-end/README.md | 13 +- .../contrib/proof-at-the-end/proof-at-the-end.dtx | 55 +- .../contrib/proof-at-the-end/proof-at-the-end.ins | 2 +- .../contrib/proof-at-the-end/proof-at-the-end.pdf | Bin 347459 -> 315974 bytes .../proof-at-the-end/proof-at-the-end_demo.pdf | Bin 121561 -> 121558 bytes macros/latex/contrib/zref-vario/CHANGELOG.md | 7 +- .../latex/contrib/zref-vario/zref-vario-code.pdf | Bin 539239 -> 538943 bytes macros/latex/contrib/zref-vario/zref-vario.dtx | 140 +- macros/latex/contrib/zref-vario/zref-vario.pdf | Bin 119911 -> 121131 bytes macros/latex/contrib/zref-vario/zref-vario.tex | 23 +- 43 files changed, 3412 insertions(+), 2092 deletions(-) (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/csvsimple/CHANGES.md b/macros/latex/contrib/csvsimple/CHANGES.md index 717bee870a..f41204bcb7 100644 --- a/macros/latex/contrib/csvsimple/CHANGES.md +++ b/macros/latex/contrib/csvsimple/CHANGES.md @@ -17,6 +17,20 @@ and this project adheres to +## [2.3.0] - 2022-02-01 + +### Added +- Option `column names detection` (related to issue #16) +- Documentation: csvautotabular inspired example for tabularray. + +### Changed +- `\csvlinetotablerow` changed to be expandable and to be + usable inside a *Data Collection* (issue #16) +- Options `autotabular`, `autobooktabular`, `autolongtable`, `autobooklongtable` + use `column names detection=false` now. + + + ## [2.2.1] - 2022-01-07 ### Fixed diff --git a/macros/latex/contrib/csvsimple/README.md b/macros/latex/contrib/csvsimple/README.md index 64b189014c..f874770dd8 100644 --- a/macros/latex/contrib/csvsimple/README.md +++ b/macros/latex/contrib/csvsimple/README.md @@ -1,4 +1,4 @@ -# The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +# The LaTeX package csvsimple - version 2.3.0 (2022/02/01) > Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm diff --git a/macros/latex/contrib/csvsimple/csvsimple-doc.sty b/macros/latex/contrib/csvsimple/csvsimple-doc.sty index 913d36faa0..4d4d8beba8 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-doc.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-doc.sty @@ -1,5 +1,5 @@ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple-doc.sty: style file for the documentation %% %% ------------------------------------------------------------------------------------------- @@ -18,8 +18,8 @@ %% %% This work consists of all files listed in README.md %% -\def\version{2.2.1}% -\def\datum{2022/01/07}% +\def\version{2.3.0}% +\def\datum{2022/02/01}% \IfFileExists{csvsimple-doc.cfg}{\input{csvsimple-doc.cfg}}{}\providecommand\csvpkgprefix{} diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.pdf b/macros/latex/contrib/csvsimple/csvsimple-example.pdf index 5bf8775667..b59dc4f269 100644 Binary files a/macros/latex/contrib/csvsimple/csvsimple-example.pdf and b/macros/latex/contrib/csvsimple/csvsimple-example.pdf differ diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.tex b/macros/latex/contrib/csvsimple/csvsimple-example.tex index 9c06e60240..ee5efffe8a 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-example.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-example.tex @@ -1,4 +1,4 @@ -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple-example.tex: an example for csvsimple %% %% ------------------------------------------------------------------------------------------- diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.pdf b/macros/latex/contrib/csvsimple/csvsimple-l3.pdf index e456d428df..2ed9105de7 100644 Binary files a/macros/latex/contrib/csvsimple/csvsimple-l3.pdf and b/macros/latex/contrib/csvsimple/csvsimple-l3.pdf differ diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.sty b/macros/latex/contrib/csvsimple/csvsimple-l3.sty index 12230aa6e6..1af04edf9c 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.sty @@ -1,4 +1,4 @@ -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple-l3.sty: Simple LaTeX CSV file processing (LaTeX3) %% %% ------------------------------------------------------------------------------------------- @@ -17,7 +17,7 @@ %% %% This work consists of all files listed in README.md %% -\ProvidesExplPackage{csvsimple-l3}{2022/01/07}{2.2.1} +\ProvidesExplPackage{csvsimple-l3}{2022/02/01}{2.3.0} {LaTeX3 CSV file processing} @@ -41,6 +41,7 @@ \bool_new:N \g__csvsim_check_column_count_bool \bool_new:N \g__csvsim_collect_data_bool +\bool_new:N \g__csvsim_colnames_detection_bool \bool_new:N \g__csvsim_firstline_bool \bool_new:N \g__csvsim_head_bool \bool_new:N \g__csvsim_head_to_colnames_bool @@ -196,7 +197,6 @@ { \tl_set:No \l_tmpa_tl {\cs:w csvcol\int_to_roman:n{#1} \cs_end:} \exp_args:NnV \cs_set_nopar:cpn {__csvsim__/\l_tmpa_tl} \l_tmpa_tl - \bool_if:NT \g__csvsim_head_to_colnames_bool { \tl_set:No \l_tmpb_tl {\cs:w \g__csvsim_headname_prefix_tl \l_tmpa_tl \cs_end:} @@ -216,7 +216,10 @@ { \int_gzero:N \g_csvsim_columncount_int \__csvsim_scan_line: - \int_step_function:nN \g_csvsim_columncount_int \__csvsim_process_head_name:n + \bool_if:NT \g__csvsim_colnames_detection_bool + { + \int_step_function:nN \g_csvsim_columncount_int \__csvsim_process_head_name:n + } } } @@ -401,22 +404,28 @@ %---- auxiliary user macros -\NewDocumentCommand \csvlinetotablerow { } +% \NewDocumentCommand \csvlinetotablerow { } + % { + % \tl_clear:N \l_tmpa_tl + % \bool_set_false:N \l_tmpa_bool + % \seq_map_inline:Nn \g__csvsim_line_seq + % { + % \bool_if:NTF \l_tmpa_bool + % { + % \tl_put_right:Nn \l_tmpa_tl { & ##1 } + % } + % { + % \tl_put_right:Nn \l_tmpa_tl { ##1 } + % \bool_set_true:N \l_tmpa_bool + % } + % } + % \l_tmpa_tl + % } + + +\NewExpandableDocumentCommand \csvlinetotablerow { } { - \tl_clear:N \l_tmpa_tl - \bool_set_false:N \l_tmpa_bool - \seq_map_inline:Nn \g__csvsim_line_seq - { - \bool_if:NTF \l_tmpa_bool - { - \tl_put_right:Nn \l_tmpa_tl { & ##1 } - } - { - \tl_put_right:Nn \l_tmpa_tl { ##1 } - \bool_set_true:N \l_tmpa_bool - } - } - \l_tmpa_tl + \seq_use:Nn \g__csvsim_line_seq { & } } @@ -593,6 +602,7 @@ head .bool_gset:N = \g__csvsim_head_bool, head~to~column~names~prefix .tl_gset:N = \g__csvsim_headname_prefix_tl, head~to~column~names .bool_gset:N = \g__csvsim_head_to_colnames_bool, + column~names~detection .bool_gset:N = \g__csvsim_colnames_detection_bool, column~count .int_gset:N = \g_csvsim_columncount_int, separator .choice:, separator/comma .code:n = @@ -1178,6 +1188,7 @@ { _autotabular_ = #1, head, + column~names~detection = false, after~head = \g__csvsim_before_table_tl \begin{tabular}{|*{\int_use:N\g_csvsim_columncount_int}{l|}} \g__csvsim_table_head_tl, @@ -1198,6 +1209,7 @@ { _autotabular_ = #1, head, + column~names~detection = false, after~head = \g__csvsim_before_table_tl \begin{tabular}{*{\int_use:N\g_csvsim_columncount_int}{l}} \g__csvsim_table_head_tl, @@ -1224,6 +1236,7 @@ { _autolongtable_ = #1, head, + column~names~detection = false, after~head = \g__csvsim_before_table_tl \begin{longtable}{|*{\int_use:N\g_csvsim_columncount_int}{l|}} \g__csvsim_table_head_tl, @@ -1244,6 +1257,7 @@ { _autolongtable_ = #1, head, + column~names~detection = false, after~head = \g__csvsim_before_table_tl \begin{longtable}{*{\int_use:N\g_csvsim_columncount_int}{l}} \g__csvsim_table_head_tl, @@ -1408,6 +1422,7 @@ command = \csvline, column~names~reset, head, + column~names~detection, check~column~count, head~to~column~names~prefix = , head~to~column~names = false, diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.tex b/macros/latex/contrib/csvsimple/csvsimple-l3.tex index a8ed99a34b..d8bd01a613 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.tex @@ -1,6 +1,6 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- @@ -708,12 +708,13 @@ purpose: \end{docCommand} -\begin{docCommand}[doc updated=2016-07-01]{csvlinetotablerow}{} +\clearpage +\begin{docCommand}[doc updated=2022-01-11]{csvlinetotablerow}{} Typesets the current processed data line with |&| between the entries. - %Most users will never apply this command. + This macro is \emph{expandable}. \end{docCommand} -\clearpage + \begin{docCommands}{ { doc name = thecsvrow , doc updated = 2021-06-25 }, { doc name = g_csvsim_row_int, doc new = 2021-06-25 } @@ -975,6 +976,16 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. \end{docCsvKey} +\begin{docCsvKey}[][doc new=2022-02-01]{column names detection}{\colOpt{=true\textbar false}}{default |true|, initially |true|} + If this key is set, the header line is detected for names which can be used + for \refKey{/csvsim/column names} and \refKey{/csvsim/head to column names}. + Otherwise, these options are not functional.\\ + This key can and should be set to |false|, if the header line contains + macros or characters not allowed inside \LaTeX\ control sequences, because + otherwise compilation error are to be expected. +\end{docCsvKey} + + \clearpage \subsection{Consistency Check}\label{sec:consistency}% @@ -1554,7 +1565,7 @@ completeness, but are unlikely to be used directly. doc description = no default, ] { - { doc name = autotabular }, + { doc name = autotabular, doc updated = {2022-02-01} }, { doc name = autotabular* }, } Reads the whole CSV file denoted \meta{file name} with an automated formatting. @@ -1567,7 +1578,7 @@ completeness, but are unlikely to be used directly. doc description = no default, ] { - { doc name = autolongtable }, + { doc name = autolongtable, doc updated = {2022-02-01} }, { doc name = autolongtable* }, } Reads the whole CSV file denoted \meta{file name} with an automated formatting @@ -1581,7 +1592,7 @@ completeness, but are unlikely to be used directly. doc description = no default, ] { - { doc name = autobooktabular }, + { doc name = autobooktabular, doc updated = {2022-02-01} }, { doc name = autobooktabular* }, } Reads the whole CSV file denoted \meta{file name} with an automated formatting @@ -1595,7 +1606,7 @@ completeness, but are unlikely to be used directly. doc description = no default, ] { - { doc name = autobooklongtable }, + { doc name = autobooklongtable, doc updated = {2022-02-01} }, { doc name = autobooklongtable* }, } Reads the whole CSV file denoted \meta{file name} with an automated formatting @@ -2032,6 +2043,7 @@ Observe the following hints for \refKey{/csvsim/command}: the \emph{value} of this macro to \refCom{csvdatacollection}. This is optional, if |\csvcoli| contains numbers or text without active characters, but essential, if it contains macros. +\item \refCom{csvlinetotablerow} is to be used \emph{without} |\csvexpval|. \item For macros like |\textbf| use |\csvexpnot\textbf| to \emph{prevent} expansion. \item Using computations or not expandable conditionals may likely cause @@ -2071,7 +2083,7 @@ Sets the collection macro to an alternative for \refCom{csvdatacollection}. \begin{docCommand}[doc new=2021-07-06]{csvdatacollection}{} Macro which contains the collected data of a CSV file processed with \refKey{/csvsim/collect data}. This macro name can be changed by - settiing \refKey{/csvsim/data collection}. + setting \refKey{/csvsim/data collection}. \end{docCommand} @@ -2088,6 +2100,8 @@ Sets the collection macro to an alternative for \refCom{csvdatacollection}. Alternatively, |\noexpand| could be used. \end{docCommand} +The following macros can only be used inside keys which are \emph{not} +collected to \refCom{csvdatacollection}, e.g. inside \refKey{/csvsim/after filter}. \begin{docCommand}[doc new=2021-07-06]{csvcollectn}{\marg{code}} Appends the given \meta{code} to \refCom{csvdatacollection}.\\ @@ -2703,6 +2717,30 @@ Display data from line 3 on:\par \end{dispExample} +\clearpage + +The following example displays a \ctanpkg{tabularray} variant of the +\refCom{csvautotabular} command. Note the \refKey{/csvsim/no head} option +to read the first line as data line. Also note that \refCom{csvlinetotablerow} +is used without preceding modifier. + +\begin{dispExample} +% \usepackage{tabularray} +\csvreader[ + no head, + centered tabularray = + { + row{odd} = {blue!85!gray!7}, + row{1} = {blue!50!gray!25, font=\bfseries}, + }, + table head = {\hline[0.1em,blue!50!black]}, + table foot = {\hline[0.1em,blue!50!black]}, + late after first line = {\\\hline[blue!50!black]}, +]{data.csv}{}{% + \csvlinetotablerow% +} +\end{dispExample} + \clearpage \subsection{Imported CSV data}\label{sec:importeddata}% diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf b/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf index 2679c11d73..dc99089c0a 100644 Binary files a/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf and b/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf differ diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.sty b/macros/latex/contrib/csvsimple/csvsimple-legacy.sty index 8451131c6e..9495978c55 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-legacy.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-legacy.sty @@ -1,4 +1,4 @@ -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple-legacy.sty: Simple LaTeX CSV file processing (LaTeX2e) %% %% ------------------------------------------------------------------------------------------- @@ -18,7 +18,7 @@ %% This work consists of all files listed in README.md %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{csvsimple-legacy}[2022/01/07 version 2.2.1 LaTeX2e CSV file processing] +\ProvidesPackage{csvsimple-legacy}[2022/02/01 version 2.3.0 LaTeX2e CSV file processing] %---- check package diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.tex b/macros/latex/contrib/csvsimple/csvsimple-legacy.tex index 711798f4a9..bffc4b53b4 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-legacy.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-legacy.tex @@ -1,6 +1,6 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- diff --git a/macros/latex/contrib/csvsimple/csvsimple.pdf b/macros/latex/contrib/csvsimple/csvsimple.pdf index 8ef7047fb2..0b356e3122 100644 Binary files a/macros/latex/contrib/csvsimple/csvsimple.pdf and b/macros/latex/contrib/csvsimple/csvsimple.pdf differ diff --git a/macros/latex/contrib/csvsimple/csvsimple.sty b/macros/latex/contrib/csvsimple/csvsimple.sty index 9d8f85bbb3..b34de03816 100644 --- a/macros/latex/contrib/csvsimple/csvsimple.sty +++ b/macros/latex/contrib/csvsimple/csvsimple.sty @@ -1,4 +1,4 @@ -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple.sty: Simple LaTeX CSV file processing %% %% ------------------------------------------------------------------------------------------- @@ -19,7 +19,7 @@ %% \RequirePackage{l3keys2e} -\ProvidesExplPackage{csvsimple}{2022/01/07}{2.2.1} +\ProvidesExplPackage{csvsimple}{2022/02/01}{2.3.0} {LaTeX CSV file processing} \cs_if_exist:NT \c__csvsim_package_expl_bool diff --git a/macros/latex/contrib/csvsimple/csvsimple.tex b/macros/latex/contrib/csvsimple/csvsimple.tex index 0f98435406..a9870b5063 100644 --- a/macros/latex/contrib/csvsimple/csvsimple.tex +++ b/macros/latex/contrib/csvsimple/csvsimple.tex @@ -1,6 +1,6 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.2.1 (2022/01/07) +%% The LaTeX package csvsimple - version 2.3.0 (2022/02/01) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- diff --git a/macros/latex/contrib/dtxdescribe/README.txt b/macros/latex/contrib/dtxdescribe/README.txt index 60d788aa99..ec9337e57f 100644 --- a/macros/latex/contrib/dtxdescribe/README.txt +++ b/macros/latex/contrib/dtxdescribe/README.txt @@ -1,8 +1,9 @@ The LaTeX dtxdescribe package Describe additional object types in dtx source files. -v1.01 — 2019/03/22 -Copyright 2016–2019 Brian Dunn — www.BDTechConcepts.com +v1.03 — 2012/02/01 +Copyright 2016–2022 Brian Dunn — www.BDTechConcepts.com + LaTeX Project Public License, version 1.3 The doc package includes tools for describing macros and environments in diff --git a/macros/latex/contrib/dtxdescribe/dtxdescribe.dtx b/macros/latex/contrib/dtxdescribe/dtxdescribe.dtx index 1c7ae225e3..0f12529663 100644 --- a/macros/latex/contrib/dtxdescribe/dtxdescribe.dtx +++ b/macros/latex/contrib/dtxdescribe/dtxdescribe.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 2016-2019 Brian Dunn +% Copyright 2016-2022 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -17,7 +17,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{dtxdescribe} -% [2019/07/16 v1.02 Describe additional object types in source files.] +% [2022/02/01 v1.03 Describe additional object types in source files.] % %<*driver> \documentclass{ltxdoc} @@ -26,6 +26,10 @@ \newcommand{\quicksummary}{Describe additional object types in \texttt{dtx} source files.} +\usepackage{iftex} + +\ifpdftex + % \usepackage{lmodern} % \usepackage{libertine} \usepackage[space]{erewhon} @@ -41,10 +45,6 @@ \usepackage[utf8]{inputenc} \usepackage{textcomp} % provides \degree, \textquotesingle, \textmu - - - - % copy/paste special unicode symbols: \input{glyphtounicode} \pdfglyphtounicode{prime}{2032}% hex @@ -74,24 +74,26 @@ \newunicodechar{‡}{\ddag} \newunicodechar{⚠}{\warningsign} -\usepackage{microtype} +\else + +\usepackage{fontspec} + +\setmainfont{Erewhon-Regular} +\setsansfont{Cabin} +\setmonofont{inconsolata} + +\fi -\usepackage{metalogo} -\makeatletter -\@ifpackageloaded{erewhon}{ -\setlogokern{Te}{-.08em} -\setlogokern{eX}{-0.04em} -\setlogokern{La}{-.25em} -\setlogokern{aT}{-.08em} -\setlogokern{Xe}{-.04em} -\setlogokern{eL}{-.06em} -\setlogodrop{0.27ex} -}{} -\makeatother \usepackage{etoolbox} -\usepackage[log-declarations=false]{xparse} +\usepackage{xparse} + + + +\usepackage{microtype} + +\usepackage{metalogox} \usepackage{titleps} @@ -119,7 +121,7 @@ \usepackage{\mypackagename} -\usepackage[pdftex,bookmarks=true,hidelinks,% +\usepackage[bookmarks=true,hidelinks,% colorlinks,linkcolor=mylinkcolor,urlcolor=myurlcolor,% pageanchor=true,hyperindex=true, ]{hyperref} @@ -136,6 +138,21 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \usepackage{cleveref} +\renewenvironment{abstract} + { + \bigskip + \begin{center} + \textbf{\abstractname} + \end{center} +% \small + \setlength{\parindent}{2em} + \setlength{\parskip}{0ex} + } + { + \bigskip + } + + \setcounter{IndexColumns}{2} \DisableCrossrefs @@ -153,7 +170,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% %<*package> % \fi % -% \CheckSum{1118} +% \CheckSum{1211} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -176,6 +193,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/11}{\ 2019/01/11} % \changes{v1.01}{2019/03/22}{\ 2019/03/22} % \changes{v1.02}{2019/07/16}{\ 2019/07/16} +% \changes{v1.03}{2022/02/01}{\ 2022/02/01} @@ -200,12 +218,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % \bigskip % -% {\small\textcopyright{} 2016--2018} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2022} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \vspace{.5in} % % {\Large \textup{\quicksummary}} % +% \end{center} +% % \vfill % % @@ -214,7 +234,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % The \pkg{doc} package includes tools for describing macros and environments % in \LaTeX\ source \filenm{.dtx} format. % The \pkg{dtxdescribe} package adds additional tools for describing -% booleans, lengths, counters, keys, packages, classes, options, +% booleans, lengths, counters, hooks, keys, packages, classes, options, % files, commands, arguments, and other objects. % \pkg{dtxdescribe} also works with the regular document classes, for those % who do not wish to use the \pkg{ltxdoc} class and \filenm{.dtx} files. @@ -240,12 +260,13 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % the \env{macro} and \env{environment} environments are not supported. % Either \pkg{makeidx} or \pkg{splitidx} may be loaded by the user. % \pkg{makeidx} will be used by default. -% \end{abstract} % +% \pkg{dtxdescribe} works with pdf\TeX, \XeTeX, and \LuaTeX, and perhaps other engines +% as well. +% \end{abstract} % % \vfill % -% \end{center} % \clearpage % % \tableofcontents @@ -312,8 +333,8 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % % \end{sourceverb} -% Various objects inside the |dtx| file may be described with \cs{DescribeBoolean}, -% \cs{DescribeLength}, \cs{DescribeCounter}, and related macros, +% Various objects inside the |dtx| file may be described with new +% macros such as \cs{DescribeBoolean}, \cs{DescribeLength}, \cs{DescribeCounter}, % similar to the already-familiar \cs{DescribeMacro} and \cs{DescribeEnv}. % Optional ``classes'' may be assigned to the objects being described, including the new versions @@ -419,7 +440,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % See \cref{ex:arguments} on \cpageref{ex:arguments}. -% \subsection{Booleans, lengths, counters, keys} +% \subsection{Booleans, lengths, counters, hooks, keys} % % See \cref{ex:common} on \cpageref{ex:common}. % @@ -438,6 +459,16 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % Describes a counter. Given a `Ctr' tag in the margin and index. % % +% \DescribeMacro{\DescribeHook} \oarg{class} \marg{name} +% +% Describes a hook. Given a `Hook' tag in the margin and index. +% The |class| may be used to categorize hooks by package. +% Example: +% \begin{sourceverb} +% \DescribeHook[LaTeX]{para/begin} +% \end{sourceverb} +% +% % \DescribeMacro{\DescribeKey} \oarg{class} \marg{name} % % Describes a key. Given a `Key' tag in the margin and index. @@ -523,6 +554,8 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % \DescribeMacro{\ItemDescribeCounter} \oarg{class} \marg{name} A description. % +% \DescribeMacro{\ItemDescribeHook} \oarg{class} \marg{name} A description. +% % \DescribeMacro{\ItemDescribeKey} \oarg{class} \marg{name} A description. % % \DescribeMacro{\ItemDescribePackage} \oarg{class} \marg{package\_name} With underscores. @@ -558,6 +591,29 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \DescribeDefault{green!50!black} +% \subsection{Nesting} +% +% \DescribeMacro{\shownesting} +% * \oarg{fraction of \cs{linewidth}} \marg{container name} \marg{contents} +% +% It may be useful to show which objects contain which other objects. +% \cs{shownesting} shows a box enclosing a name for the container, +% and the container's contents. +% \cs{shownesting} be nested, showing boxes inside other boxes, +% which displays how each environment and macro is fit together inside each other. +% +% The optional argument is the fraction of \cs{linewidth} to use for the box, +% from |[0]| to |[1]|. +% The default is |[1]|. +% Each \cs{shownesting} starts its own paragraph, unless the star |*| is used, +% in which case the \cs{shownesting*} appears inline with previous text. +% To place two \cs{shownesting} boxes side-by-side, use optional arguments to +% specify less than full \cs{linewidth} for each box, and use \cs{shownesting*} for +% the second box to place it inline. +% +% See \cref{ex:nesting} on \cpageref{ex:nesting} for an example. + + % \subsection{\cs{margintag}, \cs{watchout}} % % @@ -616,13 +672,15 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % \subsection{\env{noindmacro} and \env{noindenvironment} environments} % -% These only make sense if using the \pkg{ltxdoc} class and \pkg{doc} package +% These are like \env{macro} and \env{environment}, but not indexed. % \watchout[\filenm{.dtx} only] +% These only make sense if using the \pkg{ltxdoc} class and \pkg{doc} package % to document a \filenm{.dtx} file, where comments are used by \prog{docstrip} % to disable these environments in the resulting \filenm{.sty} file. -% When using the regular document classes, the \env{noindmacro} and -% \env{noindenvironment} environments would localize any definitions, -% and \cs{DescribeMacro} and \cs{DescribeEnv} should be used instead. +% When using the regular document classes, \env{noindmacro} and +% \env{noindenvironment} environments should not be used, as they +% would localize any definitions. +% \cs{DescribeMacro} and \cs{DescribeEnv} should be used instead. % % \DescribeEnv{noindmacro} \marg{\cs{name}} % To document macros which should not be included in the index. @@ -704,22 +762,32 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % Macros to format references to various kinds of objects. % -% This \pkg{dtxdescribe} package documentation uses \pkg{erewhon}, \pkg{roboto}, -% and \pkg{inconsolata}, along with \pkg{metalogo}, +% This \pkg{dtxdescribe} package documentation uses \pkg{erewhon}, \pkg{cabin}, +% and \pkg{inconsolata}, along with \pkg{metalogox}, % to demonstrate the following font effects. % % % \subsubsection{\LaTeX\ objects} % -% \DescribeMacro{\pkg} \pkg{packagename}, also for a \pkg{classname} +% \DescribeMacro{\pkg} \marg{packagename} \quad Prints as \pkg{packagename}. +% Also for a \pkg{classname}. + +% \DescribeMacro{\cs} \marg{csname} \quad Prints as \cs{csname}. + +% \DescribeMacro{\env} \marg{environment} \quad Prints as \env{environment}. + +% \DescribeMacro{\marg} \marg{argument} \quad Prints \marg{arg}. Mandatory argument. -% \DescribeMacro{\env} \env{environment} +% \DescribeMacro{\oarg} \marg{argument} \quad Prints \oarg{arg}. Optional argument. -% \DescribeMacro{\ctr} \ctr{counter} +% \DescribeMacro{\parg} \marg{argument} \quad Prints \parg{arg}. Picture-mode argument. -% \DescribeMacro{\bool} \bool{boolean} +% \DescribeMacro{\ctr} \marg{counter} \quad Prints as \ctr{counter}. -% \DescribeMacro{\optn} \optn{option}: to a macro, package, class +% \DescribeMacro{\bool} \marg{boolean} \quad Prints as \bool{boolean}. + +% \DescribeMacro{\optn} \marg{option} \quad Prints as \optn{option}, +% for example to a macro, package, class. % \DescribeMacro{\TOC} \TOC: Table of contents. @@ -730,17 +798,17 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \subsubsection{Programs and commands} -% \DescribeMacro{\progcode} \progcode{inline program code}: +% \DescribeMacro{\progcode} Prints as \progcode{inline program code}: % Escape underscores and other special characters such as \{, \%, \$. -% \DescribeMacro{\prog} \prog{grep}, \prog{make}: A program name. Underscores allowed. +% \DescribeMacro{\prog} Prints as \prog{grep}, \prog{make}: A program name. Underscores allowed. -% \DescribeMacro{\filenm} \filenm{file_name}: Underscores allowed. +% \DescribeMacro{\filenm} Prints as \filenm{file_name}: Underscores allowed. -% \DescribeMacro{\UI} \UI{General user-interface text.} What the user sees on the display. +% \DescribeMacro{\UI} Prints as \UI{General user-interface text.} What the user sees on the display. % Also see the \env{UIdisplay} environment. % -% \DescribeMacro{\cmds} \cmds{commands to be entered}: What the user enters. +% \DescribeMacro{\cmds} Prints as \cmds{Commands to be entered}: What the user enters. % Escape underscores and other special characters such as \{, \%, \$. % Also see the \cs{userentry} macro. % @@ -770,9 +838,17 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \DescribeMacro{\URL} \URL: Uniform Resource Locator -% \DescribeMacro{\element} \element{element}: \HTML \Slash \CSS\ element +% \DescribeMacro{\element} \marg{element name} \quad Prints as \element{element}, +% an \HTML \Slash \CSS\ element + +% \DescribeMacro{\attribute} \marg{attribute name} \quad Prints as \attribute{attribute}, +% an \HTML \Slash \CSS\ attribute. +% pdf\TeX\ and \XeTeX\ only. +% \textcolor{\watchoutcolor}{Not for \LuaTeX.} -% \DescribeMacro{\attribute} \attribute{attribute}: \HTML \Slash \CSS\ attribute +% \DescribeMacro{\attrib} \marg{attribute name} \quad Prints as \attribute{attribute}, +% an \HTML \Slash \CSS\ attribute. +% pdf\TeX, \XeTeX, or \LuaTeX. % \DescribeMacro{\HTML} \HTML: Hypertext Markup Language @@ -789,18 +865,20 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % \DescribeMacro{\tikz} \tikz: Package logo -% \DescribeMacro{\MathML} \MathML: Mathematical Markup Language - % \DescribeMacro{\CTAN} \CTAN: Comprehensive \TeX\ Archive Network % \DescribeMacro{\TDS} \TDS: \TeX\ Directory Structure % +% \DescribeMacro{\MathML} \MathML: Mathematical Markup Language +% +% \DescribeMacro{\MathJax} \MathJax: Math on the web. +% % % \subsubsection{Acronyms, brand names, trademarks} % -% \DescribeMacro{\brand} \brand{Brandname}, \brand{Company Name} +% \DescribeMacro{\brand} \marg{name} \quad \brand{Brandname}, \brand{Company Name} -% \DescribeMacro{\acro} \acro{acro}: Acronym +% \DescribeMacro{\acro} \marg{acronym} \quad \acro{acro}: Acronym % \DescribeMacro{\supregistered} Superscript trademark symbol\supregistered % @@ -809,7 +887,17 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % \subsection{Logos} % -% Several additional logos are provided: +% Several additional logos are provided. +% +% Also see the \pkg{metalogo} and \pkg{metalogox} packages. +% +% \DescribeMacro{\dviTeX} \dviTeX +% +% \DescribeMacro{\dviLaTeX} \dviLaTeX +% +% \DescribeMacro{\pdfTeX} \pdfTeX +% +% \DescribeMacro{\pdfLaTeX} \pdfLaTeX % % \DescribeMacro{\LuaTeX} \LuaTeX % @@ -1072,6 +1160,31 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % Uses a \env{description} environment to describe objects. +% \clearpage +% +% \begin{dtxexample}{Nesting\label{ex:nesting}} +% \shownesting{\env{environmentA}}{ +% \shownesting{\cs{macroB}}{ +% \shownesting{\env{environmentC}}{ +% The contents. +% } +% } +% } +% +% \shownesting{\env{sidebyside}}{ +% \shownesting[.35]{minipage}{ +% Left contents. +% } +% \hfill \cs{hfill} \hfill +% \shownesting*[.35]{minipage}{ +% Right contents. +% } +% } +% \end{dtxexample} +% +% Note the use of the optional arguments to select less than full \cs{linewidth}, +% and the starred form for the second box to place it inline with the \cs{hfill} text. + % \clearpage % @@ -1192,7 +1305,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % It may be useful to use \cs{DeclareBoolean} and friends both at the code location % and also in the User's Manual section. % -% \item[Extra spaces:] When placing multiple \cs{Describe}, \cs{index}, \cs{margintag}, and +% \item[Extra spaces:] When placing multiple uses of \cs{Describe}, \cs{index}, \cs{margintag}, and % \cs{watchout} macros % together, care must be taken to avoid extra space in the printed text where % these macros occur. @@ -1270,12 +1383,12 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \RequirePackage{xparse} % \end{macrocode} -% \DescribePackage{xifthen} Used for the examples. +% \changes{v1.03}{2021/09/02}{No longer requires \pkg{xifthen}.} + +% \DescribePackage{calc} Used for \cs{shownesting}. % \begin{macrocode} -\RequirePackage{xifthen} +\RequirePackage{calc} % \end{macrocode} -% -% % \DescribePackage{xcolor} Used for the examples. @@ -1345,7 +1458,6 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \def\filenm#1{\detokenize{#1}}% \def\brand#1{#1}% \def\acro#1{#1}% - \def\HTML{HTML}% \def\ODT{ODT}% \def\SVG{SVG}% \def\PNG{PNG}% @@ -1358,6 +1470,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \def\URL{URL}% \def\element#1{#1}% \def\attribute#1{#1}% + \def\attrib#1{#1}% \def\HTML{HTML}% \def\HTMLfive{HTML5}% \def\CSS{CSS}% @@ -1580,18 +1693,23 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % The |class| is used to sub-categories keys into their key/value groups. % % \changes{v1.01}{2019/01/20}{Put margin tag class in brackets.} +% \changes{v1.03}{2022/01/08}{Reduce hbox warnings.} % \begin{macrocode} \newcommand*{\DTXD@margintag}[3]{% -\@ifundefined{@captype}{% not float? -\leavevmode% -\marginpar{% -\DTXD@printtype{% -#3% margintag -\ifblank{#1}{}{ [#1]}% class -}% Desc@Type -\texttt{#2}% name -}% marginpar -}{}% not float? + \@ifundefined{@captype}{% not float? + \leavevmode% + \marginpar{% + {% + \hbadness=10000% + \hfuzz=5em% + \DTXD@printtype{% + #3% margintag + \ifblank{#1}{}{ [#1]}% class + }% + \texttt{#2}% name + }% + }% marginpar + }{}% not float? } % \end{macrocode} % \end{macro} @@ -1731,15 +1849,20 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \@bsphack% % \end{macrocode} % Create a margin tag with the name of the macro: +% \changes{v1.03}{2022/01/08}{Reduce hbox warnings.} % \begin{macrocode} \@ifundefined{@captype}{% not float? \leavevmode% \marginpar{% -\DTXD@printtype{% -#3% margin tag -\ifblank{#1}{}{ [#1]}% class -}% Desc@Type -\cmd{#2}% name + {% + \hbadness=10000% + \hfuzz=5em% + \DTXD@printtype{% + #3% margin tag + \ifblank{#1}{}{ [#1]}% class + }% + \cmd{#2}% name + }% }% marginpar }{}% not float? % \end{macrocode} @@ -1786,6 +1909,7 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Sans tag font.} % \changes{v1.01}{2019/01/20}{Put margin tag class in brackets.} % \changes{v1.02}{2019/07/14}{Fix if not \pkg{ltxdoc} class.} +% \changes{v1.03}{2022/01/08}{Reduce hbox warnings.} % \begin{macrocode} \providecommand*{\DescribeMacro}{} \renewcommand*{\DescribeMacro}[2][]{% @@ -1796,12 +1920,17 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% \@ifundefined{@captype}{% not float? \leavevmode% \marginpar{% -\raggedleft% -\ifblank{#1}{}{{\scriptsize\textsf{[#1]}} }% class -\cmd{#2}% name + {% + \hbadness=10000% + \hfuzz=5em% + \raggedleft% + \ifblank{#1}{}{{\scriptsize\textsf{[#1]}} }% class + \cmd{#2}% name + }% }% marginpar }{}% not float? % \end{macrocode} +% % Write the index sorted by the name without the backslash, % followed by the actual name with the backslash. % Append the class if given. @@ -1810,9 +1939,10 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \begin{macrocode} \begingroup% \DTXD@origwrindex{% -\DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% name -\ifblank{#1}{}{\levelchar[#1]}% class -\encapchar usage}% + \DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% name + \ifblank{#1}{}{\levelchar[#1]}% class + \encapchar usage% +}% % \end{macrocode} % Only if a class was given: % \begin{macrocode} @@ -1823,11 +1953,11 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % % Write class=(class):>name=csname\verb+|usage+ % \begin{macrocode} -\begingroup% -\DTXD@origwrindex{% -#1\actualchar[#1]:\levelchar% -\DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% -\encapchar usage}% + \begingroup% + \DTXD@origwrindex{% + #1\actualchar[#1]:\levelchar% + \DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% + \encapchar usage}% }% class given \@esphack% \ignorespaces% @@ -2054,6 +2184,15 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \end{macrocode} % \end{macro} % +% \begin{macro}{\DescribeHook} \oarg{class} \marg{name} +% \changes{v1.03}{2021/12/18}{Added.} +% \begin{macrocode} +\newcommand*{\DescribeHook}[2][] + {\DTXD@margintagindex{#1}{#2}{Hook}{hook}{usage}} +% \end{macrocode} +% \end{macro} +% +% % \begin{macro}{\DescribeKey} \oarg{class} \marg{name} % % The |class| may be used to categorize keys by their kev/value group. @@ -2072,35 +2211,39 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.01}{2019/01/20}{Put margin tag class in brackets.} % \changes{v1.02}{2019/07/14}{Added \cs{ignorespaces}.} % \changes{v1.02}{2019/07/16}{\cs{raggedleft} margin par.} +% \changes{v1.03}{2022/01/08}{Reduce hbox warnings.} % \begin{macrocode} \newcommand*{\DescribeObject}[2][]{% \@ifundefined{@captype}{% not float? -\@bsphack% -\leavevmode% -\marginpar{% - \raggedleft% - \ifblank{#1}{}{\raggedleft{\scriptsize[#1]} } - \texttt{#2}% -}% + \@bsphack% + \leavevmode% + \marginpar{% + \hbadness=10000% + \hfuzz=5em% + \raggedleft% + \ifblank{#1}{}{\raggedleft{\scriptsize[#1]} } + \texttt{#2}% + }% }{}% not float? \ifblank{#1}% -{\begingroup% -\DTXD@origwrindex{% -#2\actualchar{\protect\ttfamily#2}% -\encapchar usage% -}% -}% {% -\begingroup% -\DTXD@origwrindex{% -#2\actualchar{\protect\ttfamily#2} [#1]% -\encapchar usage% -}% -\begingroup% -\DTXD@origwrindex{% -#1\actualchar[#1]:\levelchar#2\actualchar{\protect\ttfamily#2}% -\encapchar usage% + \begingroup% + \DTXD@origwrindex{% + #2\actualchar{\protect\ttfamily#2}% + \encapchar usage% + }% }% +{% + \begingroup% + \DTXD@origwrindex{% + #2\actualchar{\protect\ttfamily#2} [#1]% + \encapchar usage% + }% + \begingroup% + \DTXD@origwrindex{% + #1\actualchar[#1]:\levelchar#2\actualchar{\protect\ttfamily#2}% + \encapchar usage% + }% }% \@esphack% \ignorespaces% @@ -2115,27 +2258,30 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.01}{2019/01/20}{Put margin tag class in brackets.} % \changes{v1.02}{2019/07/14}{Added \cs{ignorespaces}.} % \changes{v1.02}{2019/07/16}{\cs{raggedleft} margin par.} +% \changes{v1.03}{2022/01/08}{Reduce hbox warnings.} % \begin{macrocode} \newcommand*{\DescribeOther}[2][]{% \@ifundefined{@captype}{% not float? -\@bsphack% -\leavevmode% -\marginpar{% - \raggedleft% - \ifblank{#1}{}{\raggedleft{\scriptsize[#1]} }% - #2% -}% + \@bsphack% + \leavevmode% + \marginpar{% + \hbadness=10000% + \hfuzz=5em% + \raggedleft% + \ifblank{#1}{}{\raggedleft{\scriptsize[#1]} }% + #2% + }% }{}% not float? \ifblank{#1}% {% -\begingroup% -\DTXD@origwrindex{#2\encapchar usage}% + \begingroup% + \DTXD@origwrindex{#2\encapchar usage}% }% {% -\begingroup% -\DTXD@origwrindex{#2 [#1]\encapchar usage}% -\begingroup% -\DTXD@origwrindex{#1\actualchar[#1]:\levelchar#2\encapchar usage}% + \begingroup% + \DTXD@origwrindex{#2 [#1]\encapchar usage}% + \begingroup% + \DTXD@origwrindex{#1\actualchar[#1]:\levelchar#2\encapchar usage}% }% \@esphack% \ignorespaces% @@ -2184,9 +2330,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeMacro}[2][]{% -\item[\cmd{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeMacro[#1]{#2}% + \item[\cmd{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeMacro[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2195,9 +2341,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeEnv}[2][]{% -\item[\env{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeEnv[#1]{#2}% + \item[\env{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeEnv[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2206,9 +2352,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeArgument}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeArgument[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeArgument[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2217,9 +2363,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeBoolean}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeBoolean[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeBoolean[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2228,9 +2374,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeLength}[2][]{% -\item[\cmd{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeLength[#1]{#2}% + \item[\cmd{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeLength[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2239,9 +2385,20 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeCounter}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeCounter[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeCounter[#1]{#2}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\ItemDescribeHook} \oarg{class} \marg{name} +% \changes{v1.03}{2021/12/18}{Added.} +% \begin{macrocode} +\newcommand{\ItemDescribeHook}[2][]{% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeHook[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2250,9 +2407,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeKey}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeKey[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeKey[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2261,14 +2418,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\DTXD@ItemDescribePackage}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribePackage[#1]{#2}% -\endgroup + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribePackage[#1]{#2}% + \endgroup% } \newcommand{\ItemDescribePackage}{% -\begingroup\catcode`\_=12 \DTXD@ItemDescribePackage% + \begingroup\catcode`\_=12 \DTXD@ItemDescribePackage% } % \end{macrocode} % \end{macro} @@ -2277,14 +2434,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\DTXD@ItemDescribeClass}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeClass[#1]{#2}% -\endgroup + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeClass[#1]{#2}% + \endgroup% } \newcommand{\ItemDescribeClass}{% -\begingroup\catcode`\_=12 \DTXD@ItemDescribeClass% + \begingroup\catcode`\_=12 \DTXD@ItemDescribeClass% } % \end{macrocode} % \end{macro} @@ -2293,9 +2450,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeOption}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeOption[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeOption[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2305,14 +2462,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\DTXD@ItemDescribeFile}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeFile[#1]{#2}% -\endgroup + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeFile[#1]{#2}% + \endgroup% } \newcommand{\ItemDescribeFile}{% -\begingroup\catcode`\_=12 \DTXD@ItemDescribeFile% + \begingroup\catcode`\_=12 \DTXD@ItemDescribeFile% } % \end{macrocode} % \end{macro} @@ -2321,14 +2478,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\DTXD@ItemDescribeProgram}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeProgram[#1]{#2}% -\endgroup + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeProgram[#1]{#2}% + \endgroup% } \newcommand{\ItemDescribeProgram}{% -\begingroup\catcode`\_=12 \DTXD@ItemDescribeProgram% + \begingroup\catcode`\_=12 \DTXD@ItemDescribeProgram% } % \end{macrocode} % \end{macro} @@ -2337,14 +2494,14 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\DTXD@ItemDescribeCommand}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeCommand[#1]{#2}% -\endgroup + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeCommand[#1]{#2}% + \endgroup% } \newcommand{\ItemDescribeCommand}{% -\begingroup\catcode`\_=12 \DTXD@ItemDescribeCommand% + \begingroup\catcode`\_=12 \DTXD@ItemDescribeCommand% } % \end{macrocode} % \end{macro} @@ -2353,9 +2510,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeObject}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeObject[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeObject[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2364,9 +2521,9 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \changes{v1.00}{2019/01/09}{Added.} % \begin{macrocode} \newcommand{\ItemDescribeOther}[2][]{% -\item[\texttt{#2}:]% -\setlength{\parskip}{1.5ex}% -\DescribeOther[#1]{#2}% + \item[\texttt{#2}:]% + \setlength{\parskip}{1.5ex}% + \DescribeOther[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -2434,6 +2591,35 @@ Keywords={LaTeX, dtx, source, DescribeMacro}% % \end{macro} +% \subsection{Nesting} +% +% Shows a box enclosing a label for the container, and the container's contents. +% May be nested. +% +% \begin{macro}{\shownesting} +% \oarg{fraction of \cs{linewidth}} \marg{container} \marg{contents} +% \changes{v1.03}{2021/09/01}{Added.} +% \begin{macrocode} +\NewDocumentCommand{\shownesting}{s O{1} m m}{ + \IfBooleanF{#1}{ + \par\smallskip + } + \fbox{ + \begin{minipage}{#2\linewidth-2em} + \hbadness=10000\relax% + #3\par\smallskip + \hspace{1em} + \begin{minipage}{\linewidth-1.5em} + #4 + \end{minipage} + \end{minipage} + } +} +% \end{macrocode} +% \end{macro} + + + % \subsection{The \env{dtxexample} environment} % % Also see \cref{ex:dtxexample} on page \cpageref{ex:dtxexample}. @@ -2760,31 +2946,62 @@ position=top, % % \subsubsection{\LaTeX\ objects} % -% \begin{macro}{\pkg} or class +% \begin{macro}{\pkg} \marg{name} \quad Also useable for class names. % \begin{macrocode} \providerobustcmd*{\pkg}[1]{\mbox{\textsf{#1}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\env} +% \begin{macro}{\cs} \marg{csname} \quad From \pkg{ltxdoc}. +% \changes{v1.03}{2021/09/02}{Provided.} +% \begin{macrocode} +\providerobustcmd*{\cs}[1]{\texttt{\char`\\#1}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\env} \marg{name} % \begin{macrocode} \providerobustcmd*{\env}[1]{\mbox{\texttt{#1}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\ctr} +% \begin{macro}{\marg} \marg{argument} \quad From \pkg{ltxdoc}. +% \changes{v1.03}{2021/09/02}{Provided.} +% \begin{macrocode} +\providecommand\marg[1]{% + {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\oarg} \oarg{argument} \quad From \pkg{ltxdoc}. +% \changes{v1.03}{2021/09/02}{Provided.} +% \begin{macrocode} +\providecommand\oarg[1]{% + {\ttfamily[}\meta{#1}{\ttfamily]}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\parg} \parg{argument} \quad From \pkg{ltxdoc}. +% \changes{v1.03}{2021/09/02}{Provided.} +% \begin{macrocode} +\providecommand\parg[1]{% + {\ttfamily(}\meta{#1}{\ttfamily)}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\ctr} \marg{name} % \begin{macrocode} \providerobustcmd*{\ctr}[1]{\mbox{\texttt{#1}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\bool} +% \begin{macro}{\bool} \marg{name} % \begin{macrocode} \providerobustcmd*{\bool}[1]{\mbox{\texttt{#1}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\optn} +% \begin{macro}{\optn} \marg{name} % \begin{macrocode} \providerobustcmd*{\optn}[1]{\mbox{\texttt{#1}}} % \end{macrocode} @@ -2811,19 +3028,21 @@ position=top, % \subsubsection{Programs and commands} -% \begin{macro}{\cmds} +% \begin{macro}{\cmds} \marg{commands to print} +% \quad No processing is provided for special characters. % \begin{macrocode} \providerobustcmd*{\cmds}[1]{\mbox{\textbf{\texttt{#1}}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\progcode} +% \begin{macro}{\progcode} \marg{code to print} +% \quad No processing is provided for special characters. % \begin{macrocode} \providerobustcmd*{\progcode}[1]{\mbox{\texttt{#1}}} % \end{macrocode} % \end{macro} -% \begin{macro}{\prog} +% \begin{macro}{\prog} \marg{program name} \quad Underscores are allowed. % \begin{macrocode} \newcommand*{\DTXD@prog}[1]{% \mbox{\textsf{\textsl{\detokenize{#1}}}}% @@ -2838,7 +3057,7 @@ position=top, % \end{macrocode} % \end{macro} -% \begin{macro}{\filenm} +% \begin{macro}{\filenm} \marg{file name} \quad Underscores are allowed. % \begin{macrocode} \newcommand*{\DTXD@filenm}[1]{% \mbox{\texttt{\detokenize{#1}}}% @@ -2925,17 +3144,27 @@ position=top, % \end{macrocode} % \end{macro} -% \begin{macro}{\element} +% \begin{macro}{\element} \marg{name} % \begin{macrocode} \providerobustcmd*{\element}[1]{\texttt{<#1>}} % \end{macrocode} % \end{macro} -% \begin{macro}{\attribute} +% \begin{macro}{\attribute} \marg{name} +% \begin{macro}{\attrib} \marg{name} +% +% Each of these is ``provided'', and any prior meaning will +% be unchanged. +% In particular, \LuaTeX\ uses \cs{attribute}, so its meaning +% is unchanged if using \LuaTeX. +% \changes{v1.03}{2021/09/01}{For \LuaTeX.} % \begin{macrocode} +\providerobustcmd*{\attrib}[1]{\mbox{\texttt{#1}}} + \providerobustcmd*{\attribute}[1]{\mbox{\texttt{#1}}} % \end{macrocode} % \end{macro} +% \end{macro} % \begin{macro}{\HTML} % \begin{macrocode} @@ -2976,12 +3205,6 @@ position=top, % \end{macrocode} % \end{macro} -% \begin{macro}{\MathML} -% \begin{macrocode} -\providerobustcmd*{\MathML}{Math\acro{ML}} -% \end{macrocode} -% \end{macro} - % \begin{macro}{\CTAN} % \begin{macrocode} \providerobustcmd*{\CTAN}{\acro{CTAN}} @@ -2994,16 +3217,29 @@ position=top, % \end{macrocode} % \end{macro} % +% \begin{macro}{\MathML} +% \begin{macrocode} +\providerobustcmd*{\MathML}{Math\acro{ML}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\MathJax} +% \changes{v1.03}{2021/09/02}{Added.} +% \begin{macrocode} +\providerobustcmd*{\MathJax}{\brand{MathJax}} +% \end{macrocode} +% \end{macro} +% % % \subsubsection{Acronyms, brand names, trademarks} % -% \begin{macro}{\brand} +% \begin{macro}{\brand} \marg{name} % \begin{macrocode} \providerobustcmd*{\brand}[1]{\textsc{#1}} % \end{macrocode} % \end{macro} -% \begin{macro}{\acro} +% \begin{macro}{\acro} \marg{acronym} % \begin{macrocode} \providerobustcmd*{\acro}[1]{\textsc{\lowercase{#1}}} % \end{macrocode} @@ -3022,6 +3258,34 @@ position=top, % % \changes{v1.00}{2019/01/11}{Added logos.} % +% \begin{macro}{\dviTeX} \dviTeX +% \changes{v1.03}{2021/09/02}{Added.} +% \begin{macrocode} +\providerobustcmd*{\dviTeX}{\mbox{\DVI\,\TeX}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dviLaTeX} \dviLaTeX +% \changes{v1.03}{2021/09/02}{Added.} +% \begin{macrocode} +\providerobustcmd*{\dviLaTeX}{\mbox{\DVI\,\LaTeX}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfTeX} \pdfTeX +% \changes{v1.03}{2021/09/02}{Added.} +% \begin{macrocode} +\providerobustcmd*{\pdfTeX}{\mbox{\PDF\,\TeX}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfLaTeX} \pdfLaTeX +% \changes{v1.03}{2021/09/02}{Added.} +% \begin{macrocode} +\providerobustcmd*{\pdfLaTeX}{\mbox{\PDF\,\LaTeX}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\LuaTeX} \LuaTeX % \begin{macrocode} \providerobustcmd*{\LuaTeX}{\mbox{Lua\TeX}} @@ -3116,13 +3380,17 @@ position=top, % % \begin{macro}{\thinbrspace} A thin space which allows a line break. % \begin{macrocode} -\newcommand{\thinbrspace}{\hspace{.16667em}\penalty\exhyphenpenalty\hspace{0pt}} +\newcommand{\thinbrspace}{% + \hspace{.16667em}\penalty\exhyphenpenalty\hspace{0pt}% +} % \end{macrocode} % \end{macro} % % \begin{macro}{\thinthinbrspace} A thin space which allows a line break. % \begin{macrocode} -\newcommand{\thinthinbrspace}{\hspace{.08333em}\penalty\exhyphenpenalty\hspace{0pt}} +\newcommand{\thinthinbrspace}{% + \hspace{.08333em}\penalty\exhyphenpenalty\hspace{0pt}% +} % \end{macrocode} % \end{macro} % diff --git a/macros/latex/contrib/dtxdescribe/dtxdescribe.pdf b/macros/latex/contrib/dtxdescribe/dtxdescribe.pdf index 25fb713686..28847b413e 100644 Binary files a/macros/latex/contrib/dtxdescribe/dtxdescribe.pdf and b/macros/latex/contrib/dtxdescribe/dtxdescribe.pdf differ diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 7c5b54eddd..a95ac16fc4 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2022/01/31}{1.58} +\ProvidesExplClass{easybook}{2022/02/01}{1.59} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -305,7 +305,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2022/01/31}{1.58} +\ProvidesExplPackage{easybase}{2022/02/01}{1.59} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -2343,7 +2343,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/31}{1.58} +\ProvidesExplFile{eb-tcolorbox.cfg}{2022/02/01}{1.59} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf index 2380b1c3d2..cca5377c8e 100644 Binary files a/macros/latex/contrib/easybook/easybook.pdf and b/macros/latex/contrib/easybook/easybook.pdf differ diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index 0a8668bd86..8c16272c70 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -21,8 +21,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK 使用手册, - version = v1.58, - date = 2022/01/31, + version = v1.59, + date = 2022/02/01, authors = 瞿毅, info = 排版简体中文学位论文和书籍, email = q1jx@foxmail.com, @@ -244,7 +244,7 @@ \keyval-{config}{配置文件列表} 载入用户配置的文件名列表,文件列表以花括号包裹并以英文逗号分隔。文件名应包含如 \code{tex}、\code{def} 或 \code{cfg} 等扩展名。若配置文件不在当前文件夹则文件名需要包含路径。 \keybool{floatpage}\dtag\Default{false} - 开启这个选项后浮动环境 \env*{table} 和 \env*{figure} 的比例参数会使用默认值,关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。 + 开启这个选项后浮动环境 \env*{table} 和 \env*{figure} 的比例参数会使用默认值。关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。 \keybool{theorem}\dtag\Default{true} 是否提供定理功能支持。选项开启时定理样式模块生效,此时会载入 \pkg*{amsthm} 和 \pkg*{thmtools} 宏包。 \end{options} @@ -266,7 +266,7 @@ \subsection{英文字体} \begin{options} \keychoice{font}{noto,times,times*,ebgaramond,libertine,palatino,auto}\Default{auto} - 预置的英文字体相关配置方案如下表所示,这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其它英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。 + 预置的英文字体相关配置方案如下表所示。这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其它英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。 \insertblr { colspec = @{}*{4}{c}@{}, @@ -410,7 +410,7 @@ \label{sec:interface options} \begin{commands} \command*{ctexset}[\marg{键值列表}] - \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示。模块名也是统一接口 \cs*{ctexset} 的路径,不同模块单独接口的命令名\textbf{加上前缀} \code{eb}: + \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置,原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示。模块名也是统一接口 \cs*{ctexset} 的路径,不同模块单独接口的命令名\textbf{加上前缀} \code{eb}: \insertblr { colspec = @{}*{5}{c}@{}, @@ -451,7 +451,7 @@ 声明新的颜色主题命令。它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成主题颜色列表。类似地更改超链接颜色见\ref{subsec:hyperlinks}。 \end{commands} \keyval-{color-every}{HTML颜色代码} - 统一设置主题的各部分颜色,参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 + 统一设置主题的各部分颜色。参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 \keyval-{multoc}{整数}\Default{2} 使目录多栏排版,与\ref{sec:document command} 中目录命令的同名选项有相同效果。 \keybool{withpart}\Default{false} @@ -467,7 +467,7 @@ \ebstyle{brackets = {\bracketsf,]}} \end{ctexexam} \kvsplit-{figurepath}{\marg{路径名1}\marg{路径名2}} - 设置插入图片的文件夹路径名,可以有多个路径名,每个路径包含在括号分隔,只有一个路径时需要包含在两层括号内。 + 设置插入图片的文件夹路径名。可以有多个路径名,每个路径包含在花括号内分隔,只有一个路径时需要包含在两层括号内。 \end{options} \subsubsection{连字符} @@ -518,15 +518,15 @@ 模块 \module*{refset} 将超链接选项交给 \pkg*{hyperref} 宏包处理,除了一些关于 \code{pdf} 书签或已预设的选项可能失效,其它由接口命令 \cs*{hypersetup} 支持的多数选项可用。 \begin{options} \keychoice{linktype}{edge,colors,none}\Module{refset}\Default{edge} - 超链接类型,\code{edge} 使超链接形式为边框,\code{colors} 使超链接字体为彩色,\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。 + 超链接类型。\code{edge} 使超链接形式为边框,\code{colors} 使超链接字体为彩色,\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。 \keychoice{linkcolor}{fresh,cutepink,navyblue,crimson}\Default{navyblue} - 超链接颜色样式,预置了四种超链接颜色风格。为使相关颜色能够正确显示,\option{linkcolor} 选项应当在 \option{linktype} 前使用。 + 超链接颜色样式。预置了四种超链接颜色风格。为使相关颜色能够正确显示,\option{linkcolor} 选项应当在 \option{linktype} 前使用。 \begin{commands} \command{DeclareLinkColor}[\splitmarg{风格名称,ctex@link,ctex@url,ctex@cite}] 声明新的超链接颜色样式命令。它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成超链接颜色列表。 \end{commands} \keyval-{linkcolor-every}{HTML颜色代码} - 统一设置超链接的各部分颜色,参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 + 统一设置超链接的各部分颜色。参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 \keychoice{linktoc}{none,section,page,all}\Default{all} 将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。 \end{options} @@ -538,7 +538,7 @@ \keyval-{line}{数值}\Module{spread}\Default{1.354} 正文行距因子,注意 C\TeX 宏集原有的行距选项 \option*{linespread} 失效。 \keyval-{table}{数值}\Default{1.354} - 表格内容行距因子,对传统表格 \env*{tabular} 和 \env*{tabularx} 等环境以及 \pkg*{tabularray} 宏包的 \env{tblr} 环境生效,同时 \env{tblr} 也自带有 \option*{stretch} 选项设置行距系数。 + 表格内容行距因子。对传统表格 \env*{tabular} 和 \env*{tabularx} 等环境以及 \pkg*{tabularray} 宏包的 \env{tblr} 环境生效,同时 \env{tblr} 也自带有 \option*{stretch} 选项设置行距系数。 \keyval-{math}{数值}\Default{1.3} 数学环境的行距因子,包含了 \pkg*{amsmath} 和 \pkg*{mathtools} 宏包提供的公式环境。 \keyval-{caption-figure}{数值}\Default{1.2} @@ -665,7 +665,7 @@ \keyval-{headpunct}{代码} 紧随定理标题末尾的标记代码,位于定理第一段内容的间距 \option{postheadspace} 之前,可以是字符或插入换行符 \cs*{newline} 等命令。 \keyval-{headindent}{刚性长度} - 定理标题的缩进,默认无缩进,可用 \cs*{parindent} 命令设置为段落缩进。 + 定理标题的缩进。默认无缩进,可用 \cs*{parindent} 命令设置为段落缩进。 \keyval-{postheadspace}{刚性长度} 定理标题后与定理第一段内容的间距。 \keyval-{spaceabove}{弹性长度} @@ -724,7 +724,7 @@ \keyval-{subsec-mark}{标题标记} 标题标记命令 \cs*{subsectionmark} 的内容,包括了标签选项 \option{subsec-label} 的内容。 \kvsplit-{chap-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}} - 标题标记命令 \cs*{chaptermark} 内容的标签(标题有编号时),比标题标记选项更常用,可选参数是对应于章节编号计数器的输出命令,必选参数是编号与标题之间的距离命令: + 标题标记命令 \cs*{chaptermark} 内容的标签(标题有编号时)。比标题标记选项更常用,可选参数是对应于章节编号计数器的输出命令,必选参数是编号与标题之间的距离命令: \begin{ctexexam} \ebhdrset { @@ -776,7 +776,7 @@ 模块 \module*{hdrset} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号、对齐方式和缩进距离等,以及脚注内容的首行缩进、行距和字体等。基本思想是默认脚注和自定义编号脚注标记的格式分离,两种类型脚注各自正文和内容的标记又共享格式,默认脚注中正文和内容标记的编号类型分离。 \begin{options} \keychoice{footnotetype}{hang,default,flush,bottom}\Module{hdrset}\Default{hang} - 脚注的类型,悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: + 脚注的类型。悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型。在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: \begin{ctexexam} \ebhdrset{footnotetype = default,footnotetype = bottom} \ebhdrset{footnotetype = {hang,bottom}} @@ -790,7 +790,7 @@ \keychoice{fntext-pos}{normal,super}\Default{super} 设置脚注内容标记的位置,正常文本或是上标形式。 \keychoice{fnmark-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} - 脚注正文标记编号的类型,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。 + 脚注正文标记编号的类型。默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。 短编号的形式与列表环境类似,不过增加了中文数字 \code{c} 和符号 \code{s} 格式参数。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号类型。 \begin{commands} @@ -812,17 +812,17 @@ \end{ctexexam} \end{commands} \keychoice{fntext-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} - 脚注内容标记编号的类型,用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号类型\textbf{可以不同}。 + 脚注内容标记编号的类型。用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号类型\textbf{可以不同}。 \keychoice{fnmate-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} 同时设定脚注正文标记编号 \option{fnmark-num} 与脚注内容标记编号 \option{fntext-num} 的类型。目前脚注编号类型选项对于迷你页环境 \env*{minipage} 无效,其中的脚注保持默认英文字母的编号类型。 \keychoice{fnmark-vmove}{fixed length,match}\Default{0pt} - 脚注正文标记的垂直偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{spvmove} 全局的值。 + 脚注正文标记的垂直偏移。可以设为刚性长度,或用 \code{match} 匹配 \option*{spvmove} 全局的值。 \keychoice{fnmark-hmove}{fixed length,match}\Default{0pt} - 脚注正文标记的水平偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{sphmove} 全局的值。 + 脚注正文标记的水平偏移。可以设为刚性长度,或用 \code{match} 匹配 \option*{sphmove} 全局的值。 \keychoice{fntext-vmove}{fixed length,match}\Default{0pt} - 脚注内容标记的垂直偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{spvmove} 全局的值。 + 脚注内容标记的垂直偏移。可以设为刚性长度,或用 \code{match} 匹配 \option*{spvmove} 全局的值。 \keychoice{fnmate-form}{format code,match} - 默认脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。一般与 \keyis-{fnmate-num}{plain} 原生编号形式使用,例如用 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: + 默认脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。一般配合 \keyis-{fnmate-num}{plain} 原生编号形式使用,例如用 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: \begin{ctexexam} \usepackage{circledsteps} \ebhdrset @@ -863,7 +863,7 @@ \keyval-{fnpara-form}{格式代码} 脚注内容的格式,在此设置字体命令会覆盖 \option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注内容。 \kvsplit{fntext-code}{前代码,后代码} - 可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码,也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,一般用于在脚注内容标记与脚注首行间插入一点距离,或与脚注正文标记的格式稍有不同。 + 可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码。也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,一般用于在脚注内容标记与脚注首行间插入一点距离,或与脚注正文标记的格式稍有不同。 \begin{ctexexam} \ebhdrset { @@ -878,7 +878,7 @@ 模块 \module*{tocset} 将使用 \pkg*{titletoc} 宏包处理目录样式。模块或扩展包括了 \module*{part}、\module*{chapter}、\module*{section}、\module*{subsection}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 二级路径,而使用 \module*{list} 路径可以统一设置图片、表格和代码目录的样式。选项前带有 \ding{73} 符号表示支持所有相应\textbf{标题级别}的路径,其它选项则处于 \module*{tocset} 路径下。目前支持标准的论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 的相关用法。 \begin{options} \keyval-{tocformat}{条目格式}\dtag\smodule{tocset}% - 目录中各级别条目的格式,可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。 + 目录中各级别条目的格式。可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。 \keyval-{tocformat+}{条目格式}\dtag 与 \option{tocformat} 用法一样,只是在已有的格式命令后附加代码。 \keyval-{tocindent}{刚性长度}\dtag @@ -902,7 +902,7 @@ \command{tocrule}[\sarg\harg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}] 目录命令 \cs{tocrule} 生成目录引导线,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令会使当前级别的目录引导线右端与页码相连而不是对齐。带有 \harg{} 号的命令不添加引导线后的目录页码。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 不带单位,为 \meta{引导点} 的放大倍数,\meta{引导点} 一般为英文句号或 \cs*{cdot} 中心点符号。\meta{页码格式} 的代码位于页码前面,可以设置页码字体和距离等,最后一个命令可以带有一个参数,这个参数为页码编号。 \command*{CTEXnumberline}[\marg{编号级别}] - 目录命令 \cs*{CTEXnumberline} 用于在 C\TeX 文档类的 \option*{tocline} 选项中设置章节的目录标签,它已经被重新定义,使得目录标签后代码选项 \option{tocafter} 仍然有效。\meta{编号级别} 为 \code{chapter} 和 \code{section} 等,也可用参数 \code{\#1} 代替当前级别类型,标题名用参数 \code{\#2} 代替一般不变。 + 目录命令 \cs*{CTEXnumberline} 用于在 C\TeX 文档类的 \option*{tocline} 选项中设置章节的目录标签。它已经被重新定义,使得目录标签后代码选项 \option{tocafter} 仍然有效。\meta{编号级别} 为 \code{chapter} 和 \code{section} 等,也可用参数 \code{\#1} 代替当前级别类型,标题名用参数 \code{\#2} 代替一般不变。 \command{listnumberline}[\marg{编号级别}] 这个命令用于设置图片、表格或代码的目录标签,默认包含与题注名相同的目录标签名。其中 \meta{编号级别} 需要显示指定,即为 \code{figure}、\code{table} 或 \code{lstlisting}。关于命令的用法可见\ref{exam:list command usage}。 \begin{ctexexam} @@ -921,11 +921,11 @@ \begin{options} \keybool{hang}\Default{true} - 悬挂缩进选项 \option{hang} 使目录标题为悬挂缩进形式,缩进距离为标签及其与标题间距的长度,但此时标题编号会失去超链接。这个选项对所有标题级别有效。 + 悬挂缩进选项 \option{hang} 使目录标题为悬挂缩进形式。缩进距离为标签及其与标题间距的长度,但此时标题编号会失去超链接。这个选项对所有标题级别有效。 \keyval-{lolskip}{弹性长度}\Default{10pt} - 代码目录中每章代码标题的额外距离,与 C\TeX 的表格和图片目录中每章间的标题距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。 + 代码目录中每章代码标题的额外距离。与 C\TeX 的表格和图片目录中每章间的标题距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。 \keyval-{between}{代码钩子} - 目录标题与内容间的钩子,一般插入负的垂直距离代码,用于抵消目录首行额外的垂直间距。一级路径此选项对应文档主目录的钩子,二级路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用位于 \module*{list} 路径的此选项统一设置相应类型目录的钩子。 + 目录标题与内容间的钩子,一般插入负的垂直距离代码用于抵消目录首行额外的垂直间距。一级路径此选项对应文档主目录的钩子,二级路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用位于 \module*{list} 路径的此选项统一设置相应类型目录的钩子。 \keybool{dotalign}\Default{true} 引导线选项 \option{dotalign} 可以使目录引导线右端对齐并与页码保持一定间距,否则会与页码相连。 \keyval-{pagenumwd}{刚性长度}\Default{1.55em} diff --git a/macros/latex/contrib/fcolumn/README b/macros/latex/contrib/fcolumn/README index e585aa6aaf..2e9980d6a2 100644 --- a/macros/latex/contrib/fcolumn/README +++ b/macros/latex/contrib/fcolumn/README @@ -15,7 +15,7 @@ column. For example the f-column in the current version of the package is using 3,2 as #3, meaning that numbers are typeset with 2 decimal digits and grouping is done on 3 digits. The grouping character is ``.'' and the decimal separator is ``,'', thereby coding for the -continental European standard. People in the Anglo-saxon world would +continental European standard. People in the Anglo-Saxon world would rather code |\newcolumntype{f}{F{,}{.}{3,2}{}}|. To show where and how the f-column is used, let's look at a typical @@ -48,7 +48,8 @@ which allows one to restart a table, so that multiple tables that are aligned are possible in one tabular environment. The fcolumn specifier can be used in a tabular environment and in the longtable environment. Specific fcolumn formatting, -like colour and/or font changes are possible. +like colour and/or font changes are possible, see the file +fcolumn.pdf. To install: ----------- @@ -56,12 +57,12 @@ Run the file fcolumn.ins through (La)TeX (in a directory also containing fcolumn.dtx) or type ``make install'' and move the resultant file fcolumn.sty to a place searched by TeX. -To produce the documentation: ------------------------------ +To generate the documentation: +------------------------------ Type ``make''. Or run the file fcolumn.dtx through LaTeX, update the glossary and index by makeindex: makeindex -s gglo.ist -o fcolumn.gls fcolumn.glo - makeindex -s gglo.ist -o fcolumn.ind fcolumn.idx + makeindex -s gind.ist -o fcolumn.ind fcolumn.idx and then LaTeX fcolumn.dtx again; presto! diff --git a/macros/latex/contrib/fcolumn/fcolumn.dtx b/macros/latex/contrib/fcolumn/fcolumn.dtx index 26aaf7faff..0aef28889c 100644 --- a/macros/latex/contrib/fcolumn/fcolumn.dtx +++ b/macros/latex/contrib/fcolumn/fcolumn.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% Copyright (C) 2015--2021 by Edgar Olthof +% Copyright (C) 2015--2022 by Edgar Olthof % % This file may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -14,13 +14,14 @@ % \fi % \iffalse %\ProvidesPackage{fcolumn} -% [2021/11/22 v1.4 Automatic Currency Package (EHTO)] +% [2022/02/01 v1.4.1 Automatic Currency Package (EHTO)] %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{array}[v2.4k] %<*driver> \documentclass{ltxdoc} -\usepackage{longtable} -\usepackage{fcolumn} +\usepackage{longtable} +\usepackage{dcolumn} +\usepackage{fcolumn} \usepackage{booktabs} \usepackage[tableposition=top,aboveskip=0pt]{caption} \DeclareCaptionStyle{normal}{labelfont={rm,bf,small},textfont={rm,small},% @@ -40,7 +41,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % % \fi % \RecordChanges -% \CheckSum{1292} +% \CheckSum{1200} % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -80,6 +81,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % backwards compatible to~1.2: it only adds functionality.} % \changes{v1.4}{2021/11/21}{More robust version on the extra formatting information: alternative % formatting after the comma (if any), instead of additional information. Corrected a few typos.} +% \changes{v1.4.1}{2022/01/31}{Definition needed for longtable only if that package is loaded. +% General update, streamlining code. Excess digits silently ignored when all zero.} % \GetFileInfo{fcolumn.sty} % \DoNotIndex{\@@endpbox,\@@startpbox,\@acol,\@arstrut,\@arstrutbox,\@classiv,\@classz,\@depth} % \DoNotIndex{\@firstampfalse,\@firstamptrue,\@gobble,\@halignto,\@height,\@mkpream,\@ne,\@nextchar} @@ -121,16 +124,15 @@ indention=0pt,labelsep=colon,justification=raggedright} % People in the Anglo-Saxon world would rather code % |\newcolumntype{f}{F{,}{.}{3,2}{}}| for the same input, yielding % $12{,}345{.}67$ as output for the number given above. The default -% value for |#3| is |3,2|, indicating -% that grouping of the integer part is by three digits, that a comma is -% used in the \TeX-source to indicate the decimal separator, and that -% the decimal part consists of two digits. -% If however, in your country or company grouping is done with a thinspace every -% four digits, that the separator in the source should be the character |p|, -% and there are three digits after the decimal mark---that happens to be a -% |\cdot|---, then simply specify |\newcolumntype{f}{F{\,}{\cdot}{4p3}{}}| in -% that case. The input could be 123456p78 then, yielding $12{\,}3456{\cdot}780$ -% as output. +% value for |#3| is |3,2|, indicating that grouping of the integer +% part is by three digits, that a comma is used in the \TeX-source to +% indicate the decimal mark, and that the decimal part consists of +% two digits. However, if in your country or company grouping is done +% with a thinspace every four digits, that the decimal mark in the +% source should be the character |p|, and there are three digits after +% the decimal mark---that happens to be a |\cdot|---, then simply specify +% |\newcolumntype{f}{F{\,}{\cdot}{4p3}{}}| in that case. The input could +% be 123456p78 then, yielding $12{\,}3456{\cdot}780$ as output. % % By default two digits are used for the decimal part, so if you really % want no decimal digits (in that case of course also skipping the decimal @@ -153,10 +155,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings & 28000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings & 28000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \bottomrule % \end{tabular} @@ -174,10 +176,10 @@ indention=0pt,labelsep=colon,justification=raggedright} %\toprule %properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ %\midrule -%house & 200000 & equity capital& 50000 \\ -%bank account & -603,23 & mortgage & 150000 \\ -%savings & 28000 \\ -%cash & 145,85 & profit & 27542,62 \\ +%house & 200000 & equity capital & 50000 \\ +%bank account & -603,23 & mortgage & 150000 \\ +%savings & 28000 \\ +%cash & 145,85 & profit & 27542,62 \\ %\sumline %\bottomrule %\end{tabular} @@ -192,8 +194,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % package~\cite{booktabs} was used, but that is not the point here. % % This package is heavily inspired by the |dcolumn| package by -% David Carlisle~\cite{dcolumn}, some constructions are more or less -% copied from that package. Version~1.4 (this version) incorporates the idea +% David Carlisle~\cite{dcolumn}; some constructions are more or less +% copied from that package. From version~1.3 onwards it incorporates the idea % of Christian Hoff of providing additional (formatting) information per column. % A rather contrived example is given in Table~\ref{tab:ex3}, combining colour and fonts. % \newcolumntype{q}[1]{F{.}{,}{3,2}{#1}} @@ -205,10 +207,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings & 28000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings & 28000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \bottomrule % \end{tabular} @@ -225,7 +227,7 @@ indention=0pt,labelsep=colon,justification=raggedright} %\begin{tabular}{@{}lq{\color{red}\mathsf,\mathbf}lq{\color{green}}@{}} %\multicolumn4c{\bfseries Balance sheet}\\ %... -%...(same financial contents as in Table 1) +%... (Same financial contents as in Table 1.) %... %\end{tabular} %\end{table} @@ -234,13 +236,13 @@ indention=0pt,labelsep=colon,justification=raggedright} % The font changing commands like |\mathsf| and |\mathbf| act on an argument, hence require % braces, but these are already provided internally for this purpose. For that reason this % type of commands must be given last, without braces (and if you don't specify a font -% changing command, these extra internal braces are just redundant). The argument to the +% changing command, these extra internal braces are just redundant). The fourth argument to the % new columntype may consist of two parts, separated by a comma. In that case, the part to % the left of the comma is applied to the data entered by the user and the right part % is applied to the result. The example in Table~\ref{tab:ex3} shows this: the bold font -% is only used in the |\sumline| and also the colour is back to the default (black). If -% you want formatting for the whole column, like green colour as in the last column of -% Table~\ref{tab:ex3}, leave out the comma. +% is only used in the |\sumline| and there is no colour specification, so that's back to +% the default (black). If you want formatting for the whole column, like green colour as +% in the last column of Table~\ref{tab:ex3}, leave out the comma. % % Note that changes in font size, e.g., ``|\huge|'' in ``|\huge\color{red}\mathbf|'' % as parameter to column type |q| are ignored by \LaTeX, since the formatting @@ -266,18 +268,21 @@ indention=0pt,labelsep=colon,justification=raggedright} %\midrule %\endfirsthead %\caption[]{\textit{(continued from previous page)\/}}\\ -%\midrule +%\toprule %properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ %\midrule %\endhead +%\bottomrule %\multicolumn4{r@{}}{\small\textit{(Table continues on next page)\/}}\\ -%\midrule %\endfoot %\bottomrule %\endlastfoot +%house & 200000 & equity capital & 50000 \\ %... -%...(somewhat altered financial contents as in Table 1) +%... (Somewhat altered financial contents compared to +%... Table 1 to demonstrate the page break.) %... +%\sumline %\end{longtable} % \end{verbatim} % \end{table} @@ -295,35 +300,27 @@ indention=0pt,labelsep=colon,justification=raggedright} % \midrule % \endfirsthead % \caption[]{\textit{(continued from previous page)\/}}\\ -% \midrule +% \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule % \endhead +% \bottomrule % \multicolumn4{r@{}}{\small\textit{(Table continues on next page)\/}}\\ -% \midrule % \endfoot % \bottomrule % \endlastfoot -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings 1 & 2000 \\ -% savings 2 & 2000 \\ -% savings 3 & 2000 \\ -% savings 4 & 2000 \\ -% savings 5 & 2000 \\ -% savings 6 & 2000 \\ -% savings 7 & 2000 \\ -% savings 8 & 2000 \\ -% savings 9 & 2000 \\ -% savings 10 & 2000 \\ -% savings 11 & 2000 \\ -% savings 12 & 2000 \\ -% savings 13 & 2000 \\ -% savings 14 & 2000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings 1 & 4000 \\ +% savings 2 & 4000 \\ +% savings 3 & 4000 \\ +% savings 4 & 4000 \\ +% savings 5 & 4000 \\ +% savings 6 & 4000 \\ +% savings 7 & 4000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \end{longtable} - % \section{Commands} % The user only needs to know six commands or constructions. These six are given here. % \begin{macro}{F} @@ -340,7 +337,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % than just setting the input decimal mark. By default the input grouping % character is the dot, except when the dot is specified as input decimal % mark; in that case the comma is acting as input grouping character. With -% this convention the continental Europe and Anglo-Saxon part of the world +% this convention continental Europe and the Anglo-Saxon part of the world % is served. And using input grouping markers is optional anyway. % \end{macro} % \begin{macro}{\sumline} @@ -364,7 +361,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\sumline|. Give, e.g., |\sumline[10pt]|, in case you want this spacing % to be 10\thinspace pt. And you may even give two options, like in % |\sumline[10pt][5pt]|, in which the second option is the extra space below -% the summary row. In fact that second option is the option to |\\| that is +% the summary row. In fact that second option is parsed to |\\|, that is % implicit in |\sumline|. % \end{macro} % \begin{macro}{\resetsumline} @@ -441,7 +438,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macro} % \begin{macro}{\leeg} % If an |F|-column should be empty then simply leave it empty. If however -% it should not be empty but the entry should be treated as text---even +% it should not be empty but the entry should be treated as text---even % if it is a number---, this can be done with |\leeg|. It expects an % argument and this argument is typeset in the column. The common case is % where |p.m.| (\textit{pro memoria}) is entered. In contrast to v1.1.2 @@ -451,21 +448,21 @@ indention=0pt,labelsep=colon,justification=raggedright} % The automatic column balance check can also be done manually. If % |F|-columns~1 and~4 should balance and you want them to be checked, % then simply say |\checkfcolumns14|. With more than nine |F|-columns -% you may be forced to say something like |\checkfcolumns{10}{12}|. If +% you may be forced to say something like |\checkfcolumns{10}{12}|. If % |\checkfcolumns| is used, the automatic check is disabled. Multiple % |\checkfcolumns|s are supported; if |F|-columns~1, 2, and~3 should % balance, you specify |\checkfcolumns12| and |\checkfcolumns23|. % There is no explicit command to disable all checking, but -% |\checkfcolumns11| obviously also serves that purpose. +% |\checkfcolumns11| obviously does the trick. % \end{macro} % \begin{macro}{\ifstrict@ccounting} % In the rare occasion that a negative number occurs in a financial table, -% the sign of that number can be an explicit minus sign ($-$) or the number +% the sign of that number can be an explicit minus sign~($-$) or the number % is coloured red, or it is typeset between parentheses, and there may be % even other ways. By default (for aesthetic reasons) |fcolumn| typesets % it with a minus~sign, but strict accounting prescibes that the number % should be put between parentheses. The latter can be accomplished by -% setting |\strict@ccountingtrue|. But since this contains a non-letter, +% setting |\strict@ccountingtrue|, but since this contains a non-letter, % it is also possible to invoke |fcolumn| with the option |strict|, i.e., % |\usepackage[strict]{fcolumn}|, which sets this flag. % \end{macro} @@ -513,7 +510,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % an amount expressed in cents (dollar cents, euro cents, centen, Pfennige, % centimes, kopecks, groszy) and typesets it as the amount in entire % currency units (dollars, euros, guldens, Marke, francs, rubles, z\l oty) -% with comma as decimal separator and the dot as grouping character +% with comma as decimal mark and the dot as grouping character % (thousand separator if the first part of |#1| is~3). % As explained, this can be changed. It uses two private booleans: % |\withs@p| and |\strict@ccounting|. The latter is used to typeset @@ -536,14 +533,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % are always used within |$|s, so it is really a minus sign that is printed, not a hyphen. % All calculations are done with |\count0|, |\count1|, etc.\ i.e., without |F|-column-specific % \meta{count}s because it is all done locally. Leaving the tabular environment will -% restore their values. This is also true for the effect of |\FCform@t|, so that formatting -% information is local to this column. The reason for inserting the opening brace between -% |\FCform@t| and |\ifnum| (and the accompanying closing brace after |\fi|) is to facilitate -% the possible use of |\mathbf| or any other font changing command as the last item in |\FCform@t|. +% restore their values. This is also true for the effect of |\FCform@t|, so that +% formatting information is local to this column. The reason for inserting the |{| +% between |\FCform@t| and |\ifnum| (and the accompanying |}| just before finishing +% this definition) is to facilitate the possible use of |\mathbf| or any other font +% changing command as the last item in |\FCform@t|. % \begin{macrocode} -\def\g@ldm@cro#1\relax#2{\FCform@t{\ifnum#2<0 \ifstrict@ccounting (\else - -\fi \count2=-#2 \else\count2=#2 -\fi +\def\g@ldm@cro#1\relax#2{\FCform@t{\ifnum#2<0 \ifstrict@ccounting + (\else -\fi \count2=-#2 \else\count2=#2 \fi % \end{macrocode} % Calculate the entire currency units: this is the result of $x/a$ as integer % division, with $a=10^n$ and $n$ the part of |#1| after the separator (if any). @@ -613,7 +610,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\count0| locally. This also implies that tail recursion is not % possible here, but that is not very important, as the largest number % (which is $2^{31}-1$) will only cause a threefold recursion using the -% default |3,2| (ninefold when using |1,0|, but who does that?). The +% default |3,2| (ninefold when using~|1,0|, but who does that?). The % largest amount this package can deal with is therefore 2.147.483.647 % (using |3,0|). For most people this is probably more than enough if % the currency is euros or dollars. And otherwise make clear that you @@ -623,8 +620,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % would lead to a maximum of slightly more than 92.2\thinspace P\EUR{}; % about 100 times the current world economy~\cite{world_economy}. Yet % another method is to use Heiko Oberdiek's package |bigintcalc|: -% then only memory restrictions apply. This, however, requires a major -% rewrite of |fcolumn|. For now, version~1.4 sticks to the moderate amounts. +% then only memory restrictions apply. This, however, would require +% a major rewrite of |fcolumn|. % % There is no straightforward interpretation of |#1| being zero or % negative, therefore this is used as an indicator that no grouping @@ -705,7 +702,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % First it checks whether there is a risk of overflow in this step. If % $A$ and $B$ are two \TeX-registers and $B$ is to be added to $A$, % overflow will not occur if one is (or both are) zero or if $A$ and~$B$ -% have different signs. Otherwise, be careful. Note that \TeX\ does not +% have different signs; otherwise be careful. Note that \TeX\ does not % check for overflow when performing an |\advance| (done in section~1238 % of Ref.~\cite{CandTB}), in contrast to |\multiply|, see section~105. % \begin{macrocode} @@ -722,9 +719,9 @@ indention=0pt,labelsep=colon,justification=raggedright} \global\advance\csname FCtot@\romannumeral\FCsc@l\endcsname by \count0 \ifx\FCs@gn\m@ne % \end{macrocode} -% They had the same sign: risk of overflow. Record the sign -% of |\count0| (and of the original total of this column; they were -% the same) in |\FCs@gn|. Table~\ref{tab:ex9} +% They have the same sign, hence risk of overflow. Record the sign +% of |\count0| (and of the original total of this column; we just established +% they were the same) in |\FCs@gn|. Table~\ref{tab:ex9} % \begin{table}[htb] % \def\PackageError#1#2#3{\PackageWarning{#1}{#2: #3}} % \caption{Examples on overflow.} @@ -735,8 +732,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % income & \leeg{31 dec 2014} & \leeg{31 dec 2015} & \leeg{31 dec 2016} \\ % \midrule % item~1 & 20000000 & 20000000 &20000000 \\ -% item~2 & 10000000 & 2000000 &-2000000 \\ -% item~3 & 5000000 & -2000000 & 2000000 \\ +% item~2 & 10000000 & 2000000 &-1500000 \\ +% item~3 & 5000000 & -1500000 & 2000000 \\ +% \checkfcolumns12 % \checkfcolumns23 % \sumline % \bottomrule @@ -750,18 +748,19 @@ indention=0pt,labelsep=colon,justification=raggedright} % is correct in the end. Nevertheless, it is advised to swap the two % items that caused the overflow, as shown in the right |F|-column. % -% Since the absolute value of |\FCs@gn| is unity, no overflow will -% occur in the multiplication step below. +% Check that the sign of the updated column total is still correct. +% If so, |\FCs@gn| is reset (to |\@ne|) at the end of this chunk. % \begin{macrocode} \ifnum\count0>0 \let\FCs@gn\@ne \fi \count0=\csname FCtot@\romannumeral\FCsc@l\endcsname - \multiply\count0 by \FCs@gn + \ifnum\FCs@gn<0 \count0=-\count0 \fi \ifnum\count0<0 \let\FCs@gn=\m@ne \PackageError{fcolumn}{Register overflow}{Overflow occurred - in fcolumn \number\FCsc@l. You can press now and I'll - proceed,\MessageBreak but check your table. The offending entry is - indicated with an exclamation\MessageBreak mark in the output.}% + in fcolumn \number\FCsc@l.\MessageBreak You can press + now and I'll proceed, but check\MessageBreak your table. The + offending entry is indicated with an\MessageBreak exclamation + mark in the output.}% \else\let\FCs@gn=\@ne \fi \fi @@ -775,7 +774,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % \end{macro} % -% The \meta{count}s |\FC@l| and |\FC@r| capture the part to the left and to the +% The \meta{count}s |\FC@l| and |\FC@r| capture the parts to the left and to the % right of the decimal mark, respectively. % \begin{macrocode} \newcount\FC@l \newcount\FC@r @@ -786,6 +785,22 @@ indention=0pt,labelsep=colon,justification=raggedright} \def\assignform@t#1,#2,#3\assignform@t{\def\FCform@t{#1}% \def\FCform@tt{#2}\ifx\FCform@tt\@empty \def\FCform@tt{#1}\fi} % \end{macrocode} +% \begin{macro}{\m@thcodeswitch} +% As will be shown below, once the first digit, or sign, or decimal mark, or +% grouping character is scanned, the decimal digits should loose their +% activeness. That is done here for the digits in a rather blunt way, by putting their +% |\mathcode|s to zero if |#1| equals~0, since the actual |\mathcode| is not important---as +% long as it is not |"8000|---because the digits are not used for typesetting. +% (And even if they were; it's inside |\box0|, whose contents will be discarded.) +% When the |$| in |\e@fi| is encountered, the digits get back their original +% |\mathcode|s so that the actual typesetting in |\zetg@ld| is correct again. +% With a non-zero |#1| the activeness is switched on. +% \begin{macrocode} +\def\m@thcodeswitch#1{\count0=10 \loop\ifnum\count0>0 +\advance\count0 by \m@ne\mathcode\expandafter`\the\count0= +\ifnum#1=0 0 \else "8000 \fi\repeat} +% \end{macrocode} +% \end{macro} % \def\<#1>{\leavevmode\hbox{$\langle$#1\/$\rangle$}} % \begin{macro}{\b@fi} % The macro |\b@fi| provides the beginning of the financial column. It @@ -800,10 +815,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % An intermediate macro |\sep@xt| to extract the first character % of |#1|, which in most cases will be the only character. % \begin{macrocode} -\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}% -\sep@xt#1\end\def\decim@lmark{{#2}}% -\def\sp@l{#3}\assignform@t#4,,\assignform@t\global\advance\FCsc@l by - \@ne \global\FC@l=0 \global\FC@r=1 +\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}\sep@xt#1\end +\def\decim@lmark{{#2}}\def\sp@l{#3}\assignform@t#4,,\assignform@t +\global\advance\FCsc@l by \@ne\global\FC@l=0 \global\FC@r=1 % \end{macrocode} % The value specified by the user is then captured by |\FC@l| and % this is done in a special way: |\FC@l| is assigned globally within @@ -817,12 +831,13 @@ indention=0pt,labelsep=colon,justification=raggedright} % \. Here \ is a plus or minus character with % category code~12, \ is a sequence of zero % or more (decimal) \s, and \ is the middel -% part of |#3|, i.e., the comma in |3,2| or the period in |3.2|. -% If the \ is absent with no space characters between -% the two \ terms, these merge, making four redundant -% entries. One of the combinations is \, a sequence of exactly -% zero non-space tokens: this is the only combination that doesn't put -% anything in an |F|-column---and was the most difficult part to handle. +% part of |#3|, i.e., the comma in |3,2| or the period in |3.2|. If +% the \ is absent with no space characters between the +% two \ terms, these merge, making four redundant +% entries. One of the combinations is \, a sequence of characters +% outside the ones that are made active, e.g., plain text or nothing at all: +% this is the only combination that doesn't put anything in an |F|-column---and +% was the most difficult part to handle. % % The minus sign must be captured separately, because in an entry like % |-0,07| the 7~cents are negative, but this cannot be seen from the @@ -831,22 +846,16 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\ifnum-0<0| yields |false|. |\FCs@gn| is a general purpose flag. Its % first use is to capture the sign. % \begin{macrocode} -\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$% +\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$ % \end{macrocode} -% Do the scan inside a box and inside math mode. Start with -% defining all characters that may appear as the first one in an |F|-column -% as active. +% Do the scan inside a box and inside math mode. Start with defining all +% characters that may appear as the first one in an |F|-column as active; +% digits first. This needs a complicated |\edef| with accompanying |\noexpand| +% because the starting digit for |\FC@l| must be packed inside each definition. % \begin{macrocode} -\uccode`\~=`0\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=0} -\uccode`\~=`1\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=1} -\uccode`\~=`2\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=2} -\uccode`\~=`3\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=3} -\uccode`\~=`4\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=4} -\uccode`\~=`5\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=5} -\uccode`\~=`6\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=6} -\uccode`\~=`7\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=7} -\uccode`\~=`8\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=8} -\uccode`\~=`9\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=9} +\count@=10 \loop\ifnum\count@>0 \advance\count@ by \m@ne + \uccode`\~=\expandafter`\the\count@ \uppercase{\edef~}{\noexpand + \m@thcodeswitch0 \global\FC@l=\the\count@}\repeat % \end{macrocode} % For the input decimal mark something extra is needed: if it is the % first character in an |F|-column (like in |,07|), it should also @@ -854,14 +863,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % is the first is easy, since in that case the |\mathcode|s of the % decimal digits is still |"8000|. The assignment to |\FC@r| starts % with~1, so that appended digits get captured correctly, even if they -% start with~0. Postprocessing of |\FC@r| is done in |\e@fi|. +% start with~0; postprocessing of |\FC@r| is done in |\e@fi|. % The input decimal mark switches itself off as active character, -% so at most one input decimal separator is allowed (N.B.: +% so at most one input decimal mark is allowed (N.B.: % this makes sense). % \begin{macrocode} \def\deactdecm@rk##1##2\relax{\mathcode`##1=0 }% \afterassignment\setucc@de\count@#3\relax -\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\fi +\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi \afterassignment\deactdecm@rk\count@#3\relax \global\FC@r=1}% % \end{macrocode} % The input grouping character effectively expands to ``nothing, i.e., @@ -872,14 +881,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % input decimal mark was encountered; that can be checked by looking % at its |\mathcode|. % -% The input grouping character is the dot |.|, except when that character +% The input grouping character is the dot ``|.|'', except when that character % was already chosen as input decimal mark. In that case, the grouping -% character will be the comma. This is easy to check because the |\uccode| +% character will be the comma. This is easy to check because the |\uccode| % of |`\~| is still preserved. % \begin{macrocode} \def\d@cm##1##2{\count@=\mathcode`##1 } \ifnum\uccode`\~=`. \uccode`\~=`,\relax\else \uccode`\~=`.\relax\fi -\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\fi +\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi \afterassignment\d@cm\count@#3\relax % \end{macrocode} % The |\expandafter| below is necessary because the global assignment @@ -892,37 +901,28 @@ indention=0pt,labelsep=colon,justification=raggedright} % needed (it should be: a minus sign between digits screws up everything), % and start scanning the number. % \begin{macrocode} -\uccode`\~=`+\relax -\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- -\restorem@thcodes\fi\global\FC@l=0}% -\uccode`\~=`-\relax -\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- -\restorem@thcodes\fi\global\let\FCs@gn\m@ne \global\FC@l=0}% +\uccode`\~=`+\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000 +\m@thcodeswitch0 \fi\global\FC@l=0} +\uccode`\~=`-\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000 +\m@thcodeswitch0 \fi\global\let\FCs@gn\m@ne \global\FC@l=0}% % \end{macrocode} -% Now actually activate all these codes. The first is simple, but -% after that, one can't say |"8000| anymore because |0| acts as active. -% But copying |\mathcode|s still works. +% Now actually activate all these codes. % \begin{macrocode} -\mathcode`-="8000 \mathcode`+=\mathcode`- \mathcode`.=\mathcode`- +\mathcode`-="8000 \mathcode`+="8000 \mathcode`.="8000 % \end{macrocode} % These three remain active until the |$| in |\e@fi| is encountered. % The following ones will, except in the \ case, have their activeness % turned off at some time. % \begin{macrocode} -\def\actdecm@rk##1##2\relax{\ifx##1.\relax \mathcode`,=\mathcode`- -\else \mathcode`##1=\mathcode`- \fi}% -\afterassignment\actdecm@rk\count@#3\relax -\mathcode`\0=\mathcode`- \mathcode`\1=\mathcode`- -\mathcode`\2=\mathcode`- \mathcode`\3=\mathcode`- -\mathcode`\4=\mathcode`- \mathcode`\5=\mathcode`- -\mathcode`\6=\mathcode`- \mathcode`\7=\mathcode`- -\mathcode`\8=\mathcode`- \mathcode`\9=\mathcode`- } +\m@thcodeswitch1 \def\actdecm@rk##1##2\relax{% +\ifx##1.\relax \mathcode`,="8000 \else \mathcode`##1="8000 \fi}% +\afterassignment\actdecm@rk\count@#3\relax} % \end{macrocode} % \end{macro} % \begin{macro}{\e@fi} % If the digits are still active then either nothing was entered or only % characters that did not deactivate the digits were entered. In -% either case the output should be \. To flag this outside +% both cases the output should be \. To flag this outside % the group that started with the opening |$| of |\b@fi|, |\FC@r| is set % globally to a negative value. This doesn't harm, because it didn't % contain relevant information anyway. Outside the group, the sign @@ -930,7 +930,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\count|, but now it's documented. In effect, |\FC@r| can only be~|-1|, % |1|, or at least~|10|, so the comparison |\ifnum\FC@r>0| does not miss~0. % \begin{macrocode} -\def\e@fi{\ifnum\mathcode`\0=\mathcode`- \global\FC@r=\m@ne\fi$\egroup +\def\e@fi{\ifnum\mathcode`\0="8000 \global\FC@r=\m@ne\fi$\egroup \ifnum\FC@r>0 % \end{macrocode} % If there was no decimal mark or if there was a decimal mark but no @@ -941,22 +941,41 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Next is a loop for bringing the decimal part in the correct way to % the integer part. The loop is performed the number of decimal -% digits to be printed (the~2 in |3,2| of the default setting). This also -% means that if you provided more decimal digits than this, the excess -% digit(s) will not be handled and a |\PackageWarning| will be given, -% showing these excess digits. This is truncation, not rounding! -% There is one situation in which this code doesn't catch all: -% when exactly one extra zero was provided. And in that case truncation -% is a no-op. +% digits to be printed (the~2 in |3,2| of the default setting). % \begin{macrocode} \def\i@ts##1##2{\count0=##2} \afterassignment\i@ts\count@\sp@l \loop\ifnum\count0>0 \multiply\FC@l by 10 - \expandafter\secd@xt\number\FC@r\end \advance\count0 by \m@ne + \expandafter\secd@xt\number\FC@r\secd@xt \advance\count0 by \m@ne \repeat - \ifnum\FC@r>10 +% \end{macrocode} +% This also means that if you provided more decimal digits than this, the excess +% digit(s) will not be handled. This is truncation, not rounding! If all +% truncated digits are zero, this truncation is a no-op and they are silently ignored, +% see the example Table~\ref{tab:ex10}, +% \begin{table}[htb] +% \newcolumntype{d}{D{,}{,}{-1}} +% \caption{Truncating excess digits.} +% \label{tab:ex10} +% \begin{tabular}{@{}ldfl@{}} +% \toprule +% composer & \multicolumn1c{raw entry} & \leeg{debt} & remark \\ +% \midrule +% Berg & 123,450 & 123,450 & ``0'' silently ignored \\ +% Eisler & 234,567 & 234,567 & ``7'' ignored with warning \\ +% Sch\"onberg & 345,6709 & 345,6709 & ``09'' ignored with warning \\ +% Webern & 2,3456 & 2,3456 & ``56'' ignored with warning \\ +% \sumline +% \bottomrule +% \end{tabular} +% \end{table} +% that was created with |@{}ldfl@{}| (|d| for centering on the decimal +% mark~\cite{dcolumn}) as tabular key. If, however, at least one of them is +% not zero, a |\PackageWarning| will be given, showing the excess digit(s). +% \begin{macrocode} + \ifnum\expandafter\@gobble\number\FC@r>0 \def\tw@l##1##2\relax{##2} - \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>100 s\fi\space + \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>19 s\fi\space ``\expandafter\tw@l\number\FC@r\relax'' in decimal part \MessageBreak ignored near or} \fi @@ -974,72 +993,48 @@ indention=0pt,labelsep=colon,justification=raggedright} % The second digit from the left is needed from a string of characters % representing a decimal number. The macro |\secd@xt| extracts that digit, % provided that the number has at least two digits, but that is guaranteed by -% |\e@fi|. That second digit is then added to |\FC@l|. A new number is -% assigned to |\FC@r|, that consists of the digits of |#1#3|. If |#3| was -% empty, 10 is assigned. In this way |\FC@r| is prepared for insertion in -% the next invocation of |\secd@xt|. In iterating: 1234 yields~134, yields~14, -% yields~10, stays~10, etc. +% |\e@fi|. That second digit is then added to |\FC@l|. +% A new number is assigned to |\FC@r|, that consists +% of the digits of |#1#3|. If |#3| was empty, 10 is assigned. In this way +% |\FC@r| is prepared for insertion in the next invocation of |\secd@xt|. +% In iterating: 1234 yields~134, yields~14, yields~10, stays~10, etc. % \begin{macrocode} -\def\secd@xt#1#2#3\end{\advance\FC@l by #2 +\def\secd@xt#1#2#3\secd@xt{\advance\FC@l by #2 \FC@r=#1#3 \ifnum\FC@r=1 \FC@r=10 \fi} % \end{macrocode} % \end{macro} -% \begin{macro}{\restorem@thcodes} -% As shown above, once the first digit, or sign, or decimal separator, or -% grouping character is scanned, the decimal digits should loose their -% activeness. That is done here in a rather blunt way, since the actual -% |\mathcode| is not important---as long as it is not |"8000|---because -% the digits are not used for typesetting (and even if they were; it's -% inside |\box0|, whose contents will be discarded). When the |$| -% in |\e@fi| is encountered, the digits get back their original -% |\mathcode|s so that the actual typesetting in |\zetg@ld| is -% correct again. -% \begin{macrocode} -\def\restorem@thcodes{\mathcode`\0=0 \mathcode`\1=0 -\mathcode`\2=0 \mathcode`\3=0 \mathcode`\4=0 \mathcode`\5=0 -\mathcode`\6=0 \mathcode`\7=0 \mathcode`\8=0 \mathcode`\9=0 } -% \end{macrocode} -% \end{macro} % \subsection{Adaptations to existing macros} % \begin{macro}{\@array} % The definition of |\@array| had to be extended slightly because it should % also include |\@mksumline| (acting on the same |#2| as |\@mkpream| gets). % This change is transparant: it only adds functionality and if you don't % use that, you won't notice the difference. It starts by just copying the -% original definition from v2.4k of the |array| package~\cite{array}. +% original definition from v2.4k of the |array| package~\cite{array}, +% compacted. % \begin{macrocode} -\def\@array[#1]#2{% -\@tempdima \ht \strutbox -\advance \@tempdima by\extrarowheight -\setbox \@arstrutbox \hbox{\vrule - \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% +\def\@array[#1]#2{\@tempdima\ht\strutbox\advance\@tempdima by + \extrarowheight\setbox\@arstrutbox\hbox{\vrule\@height\arraystretch + \@tempdima\@depth\arraystretch\dp\strutbox\@width\z@}% % \end{macrocode} % Here comes the first change: after each |\\| (or |\cr| for that matter) % the \meta{count} |\FCsc@l| should be reset. This is easiest done with % |\everycr|, but |\everycr| is put to |{}| by |\ialign|, so that definition % should change. The resetting should be done globally. % \begin{macrocode} -\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}% - \tabskip\z@skip\halign} +\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}\tabskip\z@skip\halign} % \end{macrocode} % Then the definition is picked up again. % \begin{macrocode} -\begingroup -\@mkpream{#2}% -\xdef\@preamble{\noexpand \ialign \@halignto +\begingroup\@mkpream{#2}\xdef\@preamble{\noexpand\ialign\@halignto \bgroup\@arstrut\@preamble\tabskip\z@\cr}% \endgroup % \end{macrocode} -% The combination |\endgroup| followed by |\begingroup| seems redundant, -% but that is not the case: the |\endgroup| restores everything that was -% not |\global|. With the following |\begingroup| it is ensured that -% |\@mksumline| experiences the same settings as |\@mkpream| did. +% The combination |\endgroup| in the previous chunk followed by |\begingroup| +% in the next chunk seems redundant, but that is not the case: the |\endgroup| +% restores everything that was not |\global|. With the following |\begingroup| +% it is ensured that |\@mksumline| experiences the same settings as |\@mkpream| did. % \begin{macrocode} -\begingroup -\@mksumline{#2}% -\endgroup +\begingroup\@mksumline{#2}\endgroup % \end{macrocode} % As a side product of |\@mksumline| also the \meta{count}s for the totals % and \meta{dimen}s for the widths of the colums are created. The columns @@ -1049,14 +1044,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % From here on it is just the old definition of |array.sty|. % \begin{macrocode} -\@arrayleft -\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi -\bgroup -\let \@sharp ##\let \protect \relax -\lineskip \z@ -\baselineskip \z@ -\m@th -\let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} +\@arrayleft\if #1t\vtop\else\if#1b\vbox\else\vcenter\fi\fi\bgroup +\let\@sharp ##\let\protect\relax\lineskip\z@\baselineskip\z@ +\m@th \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} % \end{macrocode} % Because |\@array| was changed here and it is this version that should % be used, |\@@array| should be |\let| equal to |\@array| again. @@ -1072,11 +1062,11 @@ indention=0pt,labelsep=colon,justification=raggedright} % is grammatically correct because it has already been screened by |\@mkpream|. % Furthermore, most entries will simply add nothing to |\s@ml@ne|, e.g., |@|, |!|, % and \verb+|+ can be fully ignored. Ampersands are only inserted by |c|, |l|, |r|, -% |p|, |m|, and |b|. So a specifier like |@{}lflf@{}| will yield the sumline -% |&\a&&\a\\|, (where |\a| is a macro that prints the desired result of the column, -% see below). Had the specifier been \verb+l|f||@{ }l|f+, then the same sumline must -% be constructed: all difficulties are already picked up and solved in the creation -% of the preamble. +% |p|, |m|, and |b|. So, if |\a| is a macro that prints the desired result of the +% column (see below), then a specifier like |@{}lflf@{}| will yield the sumline +% |&\a&&\a\\|. Had the specifier been \verb+l|f||@{ }l|f+, then the same +% sumline must be constructed: all difficulties are already picked up and +% solved in the creation of the preamble. % % In reality the sumline must be constructed from the expanded form of the % specifier, so |@{}lf@{}| will expand as @@ -1089,9 +1079,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \item ignore everything else; % \item close with a |\\|. % \end{compactitem} -% (In reality also the column check is inserted just before the |\\|, see -% |\aut@check|.) To discriminate, a special version of |\@testpach| could -% be written, but that is not necessary: |\@testpach| can do all the work, +% (For completeness' sake it should be mentioned that prior to the |\\| also the column +% check is inserted, see |\aut@check|.) +% To discriminate, a special version of |\@testpach|~\cite{array} +% could be written, but that is not necessary: |\@testpach| can do all the work, % although much of it will be discarded. Here speed is sacrificed for space % and this can be afforded because the creation of the sumline is done only % once per |\tabular| or |\longtable|. @@ -1108,9 +1099,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Then |\@mkpream| is picked up again. % \begin{macrocode} -\@temptokena{#1}\@tempswatrue -\@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}% -\count0\m@ne\let\the@toks\relax\prepnext@tok +\@temptokena{#1}\@tempswatrue\@whilesw\if@tempswa\fi{\@tempswafalse +\the\NC@list}\count0\m@ne\let\the@toks\relax\prepnext@tok % \end{macrocode} % Next is the loop over all tokens in the expanded form of the specifier. The change % with respect to |\@mkpream| is that the body of the loop is now only dealing @@ -1118,11 +1108,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % what to do when constructing the preamble, so special definitions are created, see % below. % \begin{macrocode} -\expandafter \@tfor \expandafter \@nextchar - \expandafter :\expandafter =\the\@temptokena \do - {\@testpach - \ifcase \@chclass \@classfz \or \or \@classfii \or \or \or \or \or - \or \or \or \@classfx \fi\@lastchclass\@chclass}% +\expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=\the +\@temptokena\do{\@testpach\ifcase\@chclass\@classfz\or\or\@classfii\or +\or\or\or\or\or\or\or\@classfx\fi\@lastchclass\@chclass}% % \end{macrocode} % And the macro is finished by applying the |\aut@check| and appending the % |\\| to the sumline. Note that the |\aut@check| is performed {\itshape @@ -1149,9 +1137,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % \end{macro} % \begin{macro}{\@classfz} -% Class~f0 is applicable for specifiers |c|, |l|, and |r|, and if the arguments of |p|, -% |m|, or |b| are given. The latter three cases, with |\@chnum| is 0, 1, or~2 should be -% ignored and the first three cases are now similar to class~f10. +% Class~f0 is applicable for specifiers |c|, |l|, and |r|, and if the arguments +% of |p|, |m|, or |b| are given. The latter three cases, with |\@chnum| is 0, +% 1, or~2 should be ignored and the first three cases are now similar to class~f10. % \begin{macrocode} \def\@classfz{\ifnum\@chnum<\thr@@ \@classfx\fi} % \end{macrocode} @@ -1170,14 +1158,15 @@ indention=0pt,labelsep=colon,justification=raggedright} \edef\t@stn{\string\e@fi} \ifx\t@stm\t@stn % \end{macrocode} -% If both tests yield |true|, i.e., we encountered a |<{\e@fi}| where we expect one to -% find, then add the macro to typeset everything. +% If both tests yield |true|, i.e., we encountered a |<{\e@fi}| where we expect +% one to find, then add the macro to typeset everything. % \begin{macrocode} \@addtosumline{\prr@sult} % \end{macrocode} -% But we're not done yet: in the following lines of code the appropriate \meta{count}s and -% \meta{dimen}s are created, if necessary. Note that |\FCsc@l| was set to~0 in the -% beginning of |\@mksumline|, so it is well-defined when |\@classfii| is used. +% But we're not done yet: in the following lines of code the appropriate +% \meta{count}s and \meta{dimen}s are created, if necessary. Note that +% |\FCsc@l| was set to~0 in the beginning of |\@mksumline|, so it is +% well-defined when |\@classfii| is used. % \begin{macrocode} \global\advance\FCsc@l by \@ne \ifnum\FCsc@l>\FCtc@l @@ -1217,7 +1206,7 @@ indention=0pt,labelsep=colon,justification=raggedright} \else \PackageError{fcolumn}{Name clash for }{\expandafter\csname FCwd@\romannumeral\FCsc@l\endcsname is already defined and it may - not even be a . If you're\MessageBreak sure it is a , + not even be a . If you're\MessageBreak sure it is a , you can press now and I'll proceed, but things\MessageBreak will get overwritten.}% \fi @@ -1250,8 +1239,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Then the information for the last line is computed. It is not sufficient % to calculate the width of the result (in points) to use that as the width -% of the rule separating the individual entries and the result. It may be -% that the sum is larger (in points) than any of the entries, e.g., when the +% of the rule separating the individual entries and the result. It may happen +% that the sum is wider (in points) than any of the entries, e.g., when the % result of $6+6$ (using specifier~|3,2|) is typeset. The width of the rule % should be equal to the width of |\hbox{$12{,}00$}| then. On the other % hand the width of the rule when summing $24$ and $-24$ should be that of @@ -1283,17 +1272,18 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % a number in the table, e.g., |\leeg{p.m.}|, this definition is without % at-sign. By defining |\leeg| in this way, instead of |\multicolumn1r{}| % (which contains |\omit|), the default spacing in the column is retained. -% It has its normal effect on the column width, but doesn't alter the -% width of the sumrule. +% It doesn't alter the width of the sumrule, but has its normal effect on +% the column width, so be careful: don't insert the unabridged version of +% Romeo and Juliet~\cite{RJ} here. It is not typeset in math mode, nor +% does it use the extra (formatting) information of |#4| of the fcolumn, +% so you're completely free here. % \begin{macrocode} \def\leeg#1{$\egroup \let\e@fi=\relax #1} % \end{macrocode} % Note that anything may be given as argument to |\leeg|, so in principle -% it can also be used to cheat: |\leeg{0,03}| will insert |0,03| in the -% table but it doesn't increase the totals of that column by~3 (assuming -% |3,2| coding for the separations). But you won't cheat, won't you? -% It may affect the width, so be careful: don't insert the unabridged -% version of Romeo and Juliet~\cite{RJ} here. +% it can also be used to cheat: |\leeg{0,03}| will insert the text~|0,03| +% in the table but it doesn't increase the totals of that column by~3 +% (assuming |3,2| coding for the separations). But you won't cheat, won't you? % \end{macro} % \begin{macro}{\res@tsumline} % Since all changes to the totals and widths of the columns are global, @@ -1341,24 +1331,25 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% \count0=\@ne \count1=\FCsc@l \divide\count1 by \tw@ \loop\ifnum\count1<\FCsc@l - \advance\count1 by \@ne - \xdef\FC@chklist{\FC@chklist\number\count0,\number\count1;}% - \advance\count0 by\@ne + \advance\count1 by \@ne + \xdef\FC@chklist{\FC@chklist\number\count0,\number\count1;}% + \advance\count0 by\@ne \repeat - \fi + \fi \fi % \end{macrocode} % Then this list is peeled off and processed. % \begin{macrocode} \loop - \ifx\FC@chklist\@empty\let\FCs@gn=\@ne\else\let\FCs@gn=\m@ne\fi - \ifx\FCs@gn\m@ne - \expandafter\fre@t\FC@chklist\end - \ifnum\csname FCtot@\romannumeral\count0\endcsname= - \csname FCtot@\romannumeral\count1\endcsname\else - \PackageWarning{fcolumn}{F-columns \number\count0 \space - and \number\count1 \space do not balance near or}% - \fi +\ifx\FC@chklist\@empty\let\FCs@gn=\@ne\else\let\FCs@gn=\m@ne\fi +\ifx\FCs@gn\m@ne + \expandafter\fre@t\FC@chklist\end + \ifnum\csname FCtot@\romannumeral\count0\endcsname= + \csname FCtot@\romannumeral\count1\endcsname\else + \PackageWarning{fcolumn}{F-columns \number\count0 \space and + \number\count1 \space do not balance due to \string\sumline + \MessageBreak near or}% + \fi \repeat} % \end{macrocode} % When |\aut@check| is finished, |\FC@chklist| is empty again, i.e., well @@ -1386,83 +1377,69 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % \end{macrocode} % \end{macro} % \subsection{Support for package longtable} -% Package |longtable| is used for tables that may span multiple pages. |fcolumn| and -% |longtable| work together as long as |longtable| is loaded first, so that |fcolumn| -% can adapt one definition of |longtable|. If |longtable| is not loaded, that definition -% is just that: a definition. If |longtable| is loaded before |fcolumn|, it is a -% redefinition, and it should be. For that reason the user is warned (not loading -% |longtable| is not an error if you don't use it) if |fcolumn| is loaded without prior -% loading of |longtable|. +% Package |longtable| is used for tables that may span multiple pages. The +% packages |fcolumn| and |longtable| work together provided |longtable| is +% loaded first, so that |fcolumn| can adapt one definition of |longtable|. If +% |longtable| is not loaded, it's a waste of memory having that definition, so +% it is only defined when necessary. For that reason the user is warned (not +% loading |longtable| is obviously not an error if you don't use it) if +% |fcolumn| is loaded without prior loading of |longtable|. % \begin{macrocode} \ifx\longtable\@undefined - \PackageWarningNoLine{fcolumn}{fcolumn is loaded without longtable. That's - OK, but\MessageBreak if you want to load longtable as well, make sure - \MessageBreak it is done before loading fcolumn} -\fi + \PackageWarningNoLine{fcolumn}{fcolumn is loaded without longtable. + That's OK, but\MessageBreak if you want to load longtable as well, + make sure \MessageBreak it is done before loading fcolumn}\else % \end{macrocode} % \begin{macro}{\LT@array} -% And here is the only definition of |longtable| that needs to be adapted a bit, to make -% |fcolumn| work with that package. -% \begin{macrocode} -\def\LT@array[#1]#2{% - \refstepcounter{table}\stepcounter{LT@tables}% - \if l#1 \LTleft\z@\LTright\fill - \else\if r#1 \LTleft\fill\LTright\z@ - \else\if c#1 \LTleft\fill\LTright\fill - \fi\fi\fi - \let\LT@mcol\multicolumn\let\LT@@tabarray\@tabarray\let\LT@@hl\hline - \def\@tabarray{\let\hline\LT@@hl \LT@@tabarray}% - \let\\\LT@tabularcr\let\tabularnewline\\% - \def\newpage{\noalign{\break}}% - \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% - \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% - \let\hline\LT@hline\let\kill\LT@kill\let\caption\LT@caption - \@tempdima\ht\strutbox\let\@endpbox\LT@endpbox - \ifx\extrarowheight\@undefined - \let\@acol\@tabacol\let\@classz\@tabclassz\let\@classiv\@tabclassiv - \def\@startpbox{\vtop\LT@startpbox}\let\@@startpbox - \@startpbox\let\@@endpbox\@endpbox\let\LT@LL@FM@cr\@tabularcr - \else - \advance\@tempdima\extrarowheight \col@sep\tabcolsep - \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr - \fi - \setbox\@arstrutbox\hbox{\vrule\@height\arraystretch\@tempdima - \@depth\arraystretch\dp\strutbox\@width\z@}% - \let\@sharp##\let\protect\relax - \begingroup - \@mkpream{#2}% - \xdef\LT@bchunk{% - \global\advance\c@LT@chunks\@ne\global\LT@rows\z@ - \setbox\z@\vbox\bgroup\LT@setprevdepth\tabskip\LTleft - \noexpand\halign to\hsize\bgroup\tabskip\z@\@arstrut - \@preamble\tabskip\LTright\cr}% - \endgroup -% \end{macrocode} -% Until this line it was just the code for |\LT@array| from package |longtable|. -% The five lines of the next chunk are new to |\LT@array|. Their +% And here is the only definition of |longtable| that needs to be extended +% to make |fcolumn| work with that package. The lines are compacted a bit +% w.r.t.\ the original |longtable| code; if you want to study the +% code, have a look at the documentation~\cite{longtable}. +% \begin{macrocode} + \def\LT@array[#1]#2{\refstepcounter{table}\stepcounter{LT@tables}\if + l#1 \LTleft\z@\LTright\fill\else\if r#1 \LTleft\fill\LTright\z@\else + \if c#1 \LTleft\fill\LTright\fill\fi\fi\fi\let\LT@mcol\multicolumn + \let\LT@@tabarray\@tabarray\let\LT@@hl\hline\def\@tabarray{\let + \hline\LT@@hl\LT@@tabarray}\let\\\LT@tabularcr\let\tabularnewline\\ + \def\newpage{\noalign{\break}}\def\pagebreak{\noalign{\ifnum`}=0\fi + \@testopt{\LT@no@pgbk-}4}\def\nopagebreak{\noalign{\ifnum`}=0\fi + \@testopt\LT@no@pgbk4}\let\hline\LT@hline\let\kill\LT@kill\let\caption + \LT@caption\@tempdima\ht\strutbox\let\@endpbox\LT@endpbox\ifx + \extrarowheight\@undefined\let\@acol\@tabacol\let\@classz\@tabclassz + \let\@classiv\@tabclassiv\def\@startpbox{\vtop\LT@startpbox}\let + \@@startpbox\@startpbox\let\@@endpbox\@endpbox\let\LT@LL@FM@cr + \@tabularcr\else\advance\@tempdima\extrarowheight\col@sep\tabcolsep + \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr\fi\setbox + \@arstrutbox\hbox{\vrule\@height\arraystretch\@tempdima\@depth + \arraystretch\dp\strutbox\@width\z@}\let\@sharp##\let\protect\relax + \begingroup\@mkpream{#2}\xdef\LT@bchunk{\global\advance\c@LT@chunks + \@ne\global\LT@rows\z@\setbox\z@\vbox\bgroup\LT@setprevdepth\tabskip + \LTleft\noexpand\halign to\hsize\bgroup\tabskip\z@\@arstrut\@preamble + \tabskip\LTright\cr}\endgroup +% \end{macrocode} +% Until this line it was just the code for |\LT@array| from package~|longtable|. +% The two lines of the next chunk are new to |\LT@array|. Their % purpose is the same as in |\@array| above. % \begin{macrocode} - \begingroup - \@mksumline{#2}% - \endgroup - \res@tsumline + \begingroup\@mksumline{#2}\endgroup\res@tsumline \everycr{\noalign{\global\FCsc@l=0 }}% % \end{macrocode} -% From here on |\LT@array| is picked up again. +% From here on |\LT@array| is picked up again, ending with the |\fi| that belongs +% to the |\ifx| that started this definition. % \begin{macrocode} - \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols - \LT@make@row\m@th\let\par\@empty - \lineskip\z@\baselineskip\z@\LT@bchunk} + \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols\LT@make@row\m@th\let + \par\@empty\lineskip\z@\baselineskip\z@\LT@bchunk} +\fi % \end{macrocode} % \end{macro} % That's it! % \section*{Acknowledgement} -% Thanks to Karl Berry for valuable comments regarding the consistency of -% the installation procedure of this version. Frank Mittelbach gave -% various useful suggestions for improving the input parsing as well as -% hints to make the package more \LaTeX-like. He also challenged me to make |fcolumn| -% compatible with |longtable|. Christian Hoff's request on column formatting triggered -% many happy hours of coding. +% Thanks to Karl Berry for valuable comments regarding the consistency of the +% installation procedure of this version. Frank Mittelbach gave various useful +% suggestions for improving the input parsing as well as hints to make the package +% more \LaTeX-like. He also challenged me to make |fcolumn| compatible with +% |longtable|. Christian Hoff's request on column formatting triggered many +% happy hours of coding. % \bibliographystyle{plain} % \begin{thebibliography}{9} % \itemsep0pt @@ -1470,7 +1447,7 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % \parskip0pt % \bibitem{array} Frank Mittelbach and David Carlisle. % A new implementation of \LaTeX's |tabular| and |array| environment. -% \bibitem{booktabs} Simon Fear. Publication quality tables in \LaTeX. +% \bibitem{booktabs} Simon Fear. The |booktabs| package. Publication quality tables in \LaTeX. % \bibitem{dcolumn} David Carlisle. The |dcolumn| package. % \bibitem{longtable} David Carlisle. The |longtable| package. % \bibitem{world_economy} According to the IMF \url{www.imf.org}. diff --git a/macros/latex/contrib/fcolumn/fcolumn.ins b/macros/latex/contrib/fcolumn/fcolumn.ins index 993ad041c8..d4074c1507 100644 --- a/macros/latex/contrib/fcolumn/fcolumn.ins +++ b/macros/latex/contrib/fcolumn/fcolumn.ins @@ -17,7 +17,7 @@ This is a generated file. -Copyright (C) 2015--2021 by Edgar Olthof +Copyright (C) 2015--2022 by Edgar Olthof This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -42,12 +42,12 @@ LaTeX version 1999/12/01 or later. \Msg{* fcolumn.sty *} \Msg{* *} \Msg{* into a directory searched by TeX. *} -\Msg{* To produce the documentation, type ``make'' or *} +\Msg{* To generate the documentation, type ``make'' or *} \Msg{* run the file fcolumn.dtx through LaTeX. Make sure *} \Msg{* the glossary and index are updated by makeindex: *} \Msg{* *} \Msg{* makeindex -s gglo.ist -o fcolumn.gls fcolumn.glo *} -\Msg{* makeindex -s gglo.ist -o fcolumn.ind fcolumn.idx *} +\Msg{* makeindex -s gind.ist -o fcolumn.ind fcolumn.idx *} \Msg{* *} \Msg{* and then LaTeX again; presto! *} \Msg{* *} diff --git a/macros/latex/contrib/fcolumn/fcolumn.pdf b/macros/latex/contrib/fcolumn/fcolumn.pdf index 6b7dfce975..e6755b2495 100644 Binary files a/macros/latex/contrib/fcolumn/fcolumn.pdf and b/macros/latex/contrib/fcolumn/fcolumn.pdf differ diff --git a/macros/latex/contrib/fcolumn/makefile b/macros/latex/contrib/fcolumn/makefile index 1197a57167..6a05537aa6 100644 --- a/macros/latex/contrib/fcolumn/makefile +++ b/macros/latex/contrib/fcolumn/makefile @@ -25,7 +25,7 @@ install: pdftex fcolumn.ins dist: $(DIST) - mkdir FCv1.4; cp $(DIST) FCv1.4; tar -czf fcolumn.tgz FCv1.4; rm -r FCv1.4 + mkdir FCv1.4.1temp; cp $(DIST) FCv1.4.1temp; tar -czf fcolumn.tgz FCv1.4.1temp; rm -r FCv1.4.1temp fcolumn.pdf: fcolumn.dtx fcolumn.gls fcolumn.ind fcolumn.sty fcolumn.glo fcolumn.idx: fcolumn.dtx diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt index d6e0d17d05..5b687de6c9 100644 --- a/macros/latex/contrib/lwarp/README.txt +++ b/macros/latex/contrib/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.902 README.txt +LaTeX lwarp package v0.903 README.txt Files included are: @@ -41,7 +41,7 @@ and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. -Copyright 2016-2021 Brian Dunn +Copyright 2016-2022 Brian Dunn Homepage: http://BDTechConcepts.com Email: bd@BDTechConcepts.com diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx index 743e616dc1..9800198020 100644 --- a/macros/latex/contrib/lwarp/lwarp.dtx +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -1,7 +1,7 @@ % % \iffalse meta-comment % -% Copyright 2016-2021 Brian Dunn +% Copyright 2016-2022 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2021/10/01 v0.902 Allows LaTeX to directly produce HTML5 output.] +% [2022/02/01 v0.903 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -197,7 +197,7 @@ % Indexing, logos, \Describexxxx, etc: -\usepackage{dtxdescribe}[2021/09/02] +\usepackage{dtxdescribe}[2021/12/18] \usepackage{splitidx} @@ -267,7 +267,7 @@ Keywords={LaTeX, HTML, conversion}% \newcommand*{\AV}{\acro{A}\Slash\acro{V}} \makeatletter -\@ifpackageloaded{erewhon}{\renewcommand*{\HTMLfive}{\acro{HTML}\textosf{5}}}{} +\IfPackageLoadedTF{erewhon}{\renewcommand*{\HTMLfive}{\acro{HTML}\textosf{5}}}{} \makeatother \newcommand{\credits}[1]{{\footnotesize(\textit{Emulates or patches code by} \textsc{#1}.)}} @@ -1837,6 +1837,7 @@ Do not use the \optn{scale} option, since it is not well supported by \HTML\ bro \margintag{options} \optn{origin}, \optn{rotate} and \optn{scale}, plus new \optn{class} and \optn{alt} keys. +(\optn{alt} has recently been incorportated into \pkg{graphicx} itself.) With \HTML\ output, \cs{includegraphics} accepts an optional \margintag{\HTML\ class} @@ -2929,6 +2930,10 @@ The result usually looks fine, and otherwise is enough to get the meaning across Document modifications required for \MathJax: \begin{itemize} +\item Place \cs{sisetup} in the preamble before \texttt{\cs{begin}\{document\}}. + \watchout[\cs{sisetup}] + Changes made later may be ignored, especially with \MathJax. + The \MathJax\ emulation also ignores most macro options. \item Custom units may be added with \cs{CustomizeMathJax}. \margintag{custom units} See the \pkg{lwarp-siunitx} code for examples. @@ -2942,6 +2947,8 @@ Document modifications required for \MathJax: \cs{cubic}\textred{\{}\cs{centi}\cs{meter}\textred{\}} \end{sourcedisplay} Single units do not require braces. +\item For \cs{numlist}, the argument is printed as text as-is, + so use space between semicolons for improved readability. \end{itemize} Also see \nameref{sec:limitsmathjax}, \cref{sec:limitsmathjax}. @@ -3083,6 +3090,14 @@ using \cmds{pdflatex filename.tex} or similar, after which \prog{lwarpmk} may then be used with the new configuration files. } +\newcommand*{\newimagechecksums}{ +Due to changes in how automatically-generated +\watchout[New images] +\SVG\ image file names are computed, +after \cmds{lwarpmk html} use \cmds{lwarpmk cleanlimages} a single time, +and then \cmds{lwarpmk limages} to generate the new images. +} + \newcommand*{\describehashing}{% If starred, a hashed filename is used.\margintag{image filename hashing} @@ -3097,7 +3112,7 @@ but also enough additional information to provide a unique hash. An example is when the expression is a complicated \TeX\ expression, which would not copy/paste well. A simplified tag may be used, while the complicated expression is -duplicated in the additional hashing argument. +used in the additional hashing argument to ensure a unique image. Another example is when the expression is simple, but the image depends on options. These options may be decoded into text form and @@ -3137,6 +3152,11 @@ This boolean may be tested by the user for later use. \setcounter{IndexColumns}{2} + +% To color the text of the listing, but this makes it harder to read: +% \apptocmd{\MacroFont}{\color{blue!40!black}}{}{} + + \DisableCrossrefs \CodelineIndex \RecordChanges @@ -3152,7 +3172,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{54254} +% \CheckSum{54471} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -3296,6 +3316,8 @@ This boolean may be tested by the user for later use. % \changes{v0.900}{2021/07/17}{\ 2021/07/17} % \changes{v0.901}{2021/08/27}{\ 2021/08/27} % \changes{v0.902}{2021/10/01}{\ 2021/10/01} +% \changes{v0.903}{2021/12/23}{Now uses \cs{IfPackageLoadedTF}, etc.} +% \changes{v0.903}{2022/02/01}{\ 2022/02/01} @@ -3328,7 +3350,7 @@ This boolean may be tested by the user for later use. % % \fileversion{} \Dash \filedate % -% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2022} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \end{center} % @@ -3530,6 +3552,28 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.903:] Various updates and improvements. +% \begin{itemize} +% \item Error if \prog{pdftotext} not available. +% \margintag{\prog{lwarpmk}} +% Ensures that \brand{poppler} programs are installed. +% \item \prog{ps2pdf}: Allow transparency due to recent changes in \prog{ps2pdf}. +% \margintag{core} +% \item \newimagechecksums +% \item Improved back refs. +% \item Fixed \env{verbatim*}. +% \item Various internal updates for recent \LaTeX\ release. +% \item \pkg{cuted}: Updated to v2.0. +% \margintag{packages} +% \item \pkg{flushend}: Updated to v4.0. +% \item \pkg{mathalpha}: Updated for v1.14+. +% \item \pkg{minted}: Updated to v2.6. +% \item \pkg{cases}: Updated to v3.2. +% \item \pkg{siunitx} with \MathJax: Improved \cs{per}, \cs{numlist}, \cs{SIlist}, +% comma decimal points. +% \item Added \pkg{showlabels}, \pkg{wrapfig2}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.902:] \pkg{beamerarticle}, footnotes, paragraph tags. % \begin{itemize} % \item Fixed footnotes inside descriptions, minipages, \pkg{amsthm}, \cs{nameref}. @@ -5931,7 +5975,7 @@ This boolean may be tested by the user for later use. % \epkg{nonfloat}, \mpkg{picinpar}, \ipkg{placeins}, \epkg{rotfloat}, \ipkg{stfloats}, % \mpkg{subcaption}, \mpkg{subfig}, \epkg{subfigure}, \spkg{subfloat}, % \epkg{swfigure}, -% \epkg{topcapt}, \epkg{trivfloat}, \epkg{wrapfig}. \\ +% \epkg{topcapt}, \epkg{trivfloat}, \epkg{wrapfig}, \epkg{wrapfig2}. \\ % % \midrule % @@ -6137,6 +6181,7 @@ This boolean may be tested by the user for later use. % % Debug: & \ipkg{chkfloat}, \ipkg{cmdtrack}, \ipkg{dprogress}, \mpkg{lipsum}, % \ipkg{lua-visual-debug}, \mpkg{mwe}, \ipkg{refcheck}, +% \ipkg{showlabels}, \ipkg{showkeys}, % \ipkg{srcltx}, \ipkg{srctex}, \ipkg{vpe}, \ipkg{xbmks}. \\ % % \midrule @@ -6655,6 +6700,13 @@ This boolean may be tested by the user for later use. % % \changes{v0.27}{2017/04/02}{Docs: Installing utilities for \brand{MacOS}.} % +% \trouble{poppler=\prog{poppler}>install} +% \trouble{perl=\prog{perl}} +% \trouble{pdfcrop=\prog{pdfcrop}} +% \trouble{pdftotext=\prog{pdftotex}} +% \trouble{pdfseparate=\prog{pdfseparate}} +% \trouble{pdftocairo=\prog{pdftocairo}} +% % \begin{description} % \item [To test for the existence of the additional utilities:] \ % @@ -7016,13 +7068,13 @@ This boolean may be tested by the user for later use. % % \qquad Open the file |tutorial.html| in a web browser. % -% Note that math is still displayed as its \attribute{alt} tag, which is -% \margintag{math} -% the plain-text \LaTeX\ source, -% until the -% images of the math expressions have been generated. Math may be -% displayed as \SVG\ images or by a \MathJax\ script, as seen in -% \cref{sec:tutorialsvgmath,sec:tutorialmathjax}. +% Note that math images have not yet been generated, +% \margintag{math images} +% \changes{v0.903}{2022/01/24}{Docs: Math images.} +% so math is still displayed as its \attribute{alt} tag, which is +% set to the plain-text \LaTeX\ source for that expression. +% Math may be displayed as \SVG\ images (\cref{sec:tutorialsvgmath}) +% or by a \MathJax\ script (\cref{sec:tutorialmathjax}). % % \item Force a recompile: % \userentry{lwarpmk again} @@ -8939,6 +8991,9 @@ This boolean may be tested by the user for later use. % Do not nest \env{warpsvg} inside itself. \watchout[nesting] % \env{warpsvg} may be used inside \env{warpHTML}. % +% To define macros or environments which behave differently depending +% \margintag{\cs{LWR@formatted}} +% on print or \HTML\ output, see \cref{sec:definingprinthtml}. % % % \subsection{Commands to be placed into the \env{warpprint} environment} @@ -11104,14 +11159,14 @@ This boolean may be tested by the user for later use. % { % latex tm \LWRopseq % dvips -o tm-pics.ps tm.dvi \LWRopseq -% ps2pdf tm-pics.ps \LWRopseq +% ps2pdf -dALLOWPSTRANSPARENCY tm-pics.ps \LWRopseq % pdflatex tm.tex % } , % HTMLLatexCmd= % { % latex tm_html \LWRopseq % dvips -o tm_html-pics.ps tm_html.dvi \LWRopseq -% ps2pdf tm_html-pics.ps \LWRopseq +% ps2pdf -dALLOWPSTRANSPARENCY tm_html-pics.ps \LWRopseq % pdflatex tm_html.tex % } % } @@ -12841,13 +12896,25 @@ This boolean may be tested by the user for later use. % % \section{Early package requirements} % -% \DescribePackage{etoolbox} -% Provides \cs{ifbool} and other functions. % -% \DescribePackage{xpatch} -% Patches macros with optional arguments. +% \DescribePackage{etoolbox} Provides \cs{ifbool} and other functions. +% % \begin{macrocode} \RequirePackage{etoolbox}[2011/01/03]% v2.6 for \BeforeBeginEnvironment, etc. +% \end{macrocode} +% +% Patch to fix copy of environment with a \cs{par}: +% +% \href{https://github.com/josephwright/etoolbox/issues/35}{https://github.com/josephwright/etoolbox/issues/35} +% \changes{v0.903}{2021/12/21}{\pkg{etoolbox}: Patch for \cs{NewCommandCopy}.} +% \begin{macrocode} +\long\def\etb@carsquare#1#2#3\@nil{#1#2} +% \end{macrocode} +% +% +% \DescribePackage{xpatch} Patches macros with optional arguments. +% +% \begin{macrocode} \RequirePackage{xpatch} % \end{macrocode} @@ -12902,7 +12969,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@loadafter}[1]{% -\@ifpackageloaded{#1} +\IfPackageLoadedTF{#1} { \PackageError{lwarp} {% @@ -12931,7 +12998,7 @@ This boolean may be tested by the user for later use. % % \changes{v0.45}{2017/12/03}{Added.} % \begin{macrocode} -\@ifclassloaded{memoir} +\IfClassLoadedTF{memoir} {\newcommand*{\LWR@notmemoirloadafter}[1]{}} {\LetLtxMacro\LWR@notmemoirloadafter\LWR@loadafter} % \end{macrocode} @@ -12946,17 +13013,17 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \LetLtxMacro\LWR@notltjloadafter\LWR@loadafter -\@ifclassloaded{ltjarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjspf}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjskiyou}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjspf}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjskiyou}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} % \end{macrocode} % \end{macro} @@ -12968,7 +13035,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@loadbefore}[1]{% -\@ifpackageloaded{#1} +\IfPackageLoadedTF{#1} {\relax} { \PackageError{lwarp} @@ -13065,7 +13132,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@earlyloadnever}[2]{% - \@ifpackageloaded{#1}{% + \IfPackageLoadedTF{#1}{% \LWR@loadnever{#1}{#2}% }{}% } @@ -13083,7 +13150,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@earlyclassloadnever}[2]{% -\@ifclassloaded{#1}{% +\IfClassLoadedTF{#1}{% \PackageError{lwarp} {% Class #1 is not supported\MessageBreak @@ -13164,7 +13231,7 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{libgreek}{libertinust1math, newtx} \LWR@checkloadnever{newthm}{ntheorem} \LWR@checkloadnever{pdfcprot}{microtype} -\LWR@checkloadnever{picins}{floatflt, wrapfig} +\LWR@checkloadnever{picins}{floatflt, wrapfig, wrapfig2} \LWR@checkloadnever{rplain}{fancyhdr} \LWR@checkloadnever{si}{siunitx} \LWR@checkloadnever{sistyle}{siunitx} @@ -13187,7 +13254,12 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{arraycols}{} \LWR@checkloadnever{bidi}{} \LWR@checkloadnever{cals}{} -\LWR@checkloadnever{cellspace}{} +% \end{macrocode} +% \changes{v0.903}{2022/01/06}{Alternative for \pkg{cellspace}.} +% \begin{macrocode} +\LWR@checkloadnever{cellspace}{tabls} +% \end{macrocode} +% \begin{macrocode} \LWR@checkloadnever{cgloss4e}{} \LWR@checkloadnever{collcell}{} \LWR@checkloadnever{colophon}{} @@ -13285,7 +13357,7 @@ This boolean may be tested by the user for later use. % % The older \pkg{CJK} and \pkg{CJKutf8} only work with \pkg{xeCJK}: % \begin{macrocode} -\@ifpackageloaded{xeCJK}{}{ +\IfPackageLoadedTF{xeCJK}{}{ \LWR@checkloadnever{CJK}{ctex, xeCJK} \LWR@checkloadnever{CJKutf8}{ctex, xeCJK} } @@ -13764,6 +13836,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{shadow} \LWR@loadafter{shapepar} \LWR@notmemoirloadafter{showidx} +\LWR@loadafter{showlabels} \LWR@loadafter{showkeys} \LWR@loadafter{showtags} \LWR@loadafter{shuffle} @@ -13881,6 +13954,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{widows-and-orphans} \LWR@loadafter{witharrows} \LWR@loadafter{wrapfig} +\LWR@loadafter{wrapfig2} \LWR@loadafter{xbmks} \LWR@loadafter{xcolor} \LWR@loadafter{xechangebar} @@ -13966,8 +14040,8 @@ This boolean may be tested by the user for later use. \newcommand*{\LWR@pdfencoding}{% \RequirePackage[T1]{fontenc} - \@ifpackageloaded{inputenc}{}{ - \@ifpackageloaded{inputenx}{}{ + \IfPackageLoadedTF{inputenc}{}{ + \IfPackageLoadedTF{inputenx}{}{ \RequirePackage[utf8]{inputenc} } } @@ -14093,7 +14167,7 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \ifxetexorluatex \AtBeginDocument{ - \@ifpackageloaded{kpfonts}{ + \IfPackageLoadedTF{kpfonts}{ \PackageError{lwarp} {% When using XeLaTeX or LuaLaTeX,\MessageBreak @@ -14173,7 +14247,7 @@ This boolean may be tested by the user for later use. % \end{macro} -% \subsection{Patching} +% \subsection{Patching macros} % \begin{macro}{\LWR@patcherror} \marg{packagename} \marg{macroname} % @@ -14193,6 +14267,35 @@ This boolean may be tested by the user for later use. % \end{macro} % % +% \subsection{Copying macros} +% +% \begin{macro}{\csNewCommandCopycs} \marg{dest csname} \marg{source csname} +% +% Given a cs-name for each, copies a macro to a new definition. +% +% \changes{v0.903}{2021/12/21}{Added.} +% \begin{macrocode} +\providecommand*{\csNewCommandCopycs}[2]{% + \expandafter\NewCommandCopy\csname#1\expandafter\endcsname% + \csname#2\endcsname% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NewEnvironmentCopy} \marg{dest} \marg{source} +% +% Copies an environment to a new definition. +% +% \changes{v0.903}{2021/12/21}{Added.} +% \begin{macrocode} +\providecommand*{\NewEnvironmentCopy}[2]{% + \csNewCommandCopycs{#1}{#2}% + \csNewCommandCopycs{end#1}{end#2}% +} +% \end{macrocode} +% \end{macro} +% +% % \subsection{Chinese text isolation} % % \begin{macro}{\LWR@isolate} \marg{text} @@ -14206,11 +14309,11 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \newcommand{\LWR@isolate}[1]{#1}% -\@ifpackageloaded{ctexpatch}{ +\IfPackageLoadedTF{ctexpatch}{ \renewcommand{\LWR@isolate}[1]{\null#1\null}% }{} -\@ifpackageloaded{xeCJK}{ +\IfPackageLoadedTF{xeCJK}{ \renewcommand{\LWR@isolate}[1]{\null#1\null}% }{} % \end{macrocode} @@ -15384,7 +15487,7 @@ This boolean may be tested by the user for later use. % \changes{v0.50}{2018/02/24}{Fix: Load \pkg{fontspec} if necessary.} % \begin{macrocode} \ifxetexorluatex -\@ifpackageloaded{fontspec}{}{ +\IfPackageLoadedTF{fontspec}{}{ \usepackage[no-math]{fontspec} } % \end{macrocode} @@ -15459,7 +15562,7 @@ This boolean may be tested by the user for later use. % \LaTeX{} dash and quote ligatures, which may fail on older browers % but at least won't corrupt written words. % \begin{macrocode} -\RequirePackage {microtype} +\RequirePackage{microtype} \microtypesetup{ protrusion=false, @@ -15560,7 +15663,7 @@ This boolean may be tested by the user for later use. % These will be replaced by \pkg{lwarp} \cs{AtBeginDocument} % with a very large page size to reduce \HTML\ tag overflow off the page. % \begin{macrocode} -\@ifpackageloaded{geometry} +\IfPackageLoadedTF{geometry} {}{ \RequirePackage[ reset, @@ -15763,18 +15866,8 @@ This boolean may be tested by the user for later use. % Used to emulate \cs{nameref}. % \begin{macrocode} \RequirePackage{gettitlestring} -% \end{macrocode} -% \DescribePackage{everyhook} -% -% \pkg{everyhook} is used to patch paragraph handling. -% -% \changes{v0.63}{2018/11/29}{\pkg{everyhook}: Fix for \pkg{bxjs*} classes.} -% \begin{macrocode} -\@ifundefined{bxjs@everypar}{}{\let\everypar\bxjs@everypar} - -\RequirePackage{everyhook} \end{warpHTML} % \end{macrocode} @@ -15804,7 +15897,7 @@ This boolean may be tested by the user for later use. \LetLtxMacro\LWR@orig@filec@ntents\filec@ntents - \@ifpackagelater{filecontents}{2011/10/08} + \IfPackageAtLeastTF{filecontents}{2011/10/08} { % \end{macrocode} % For a newer version of the \pkg{filecontents} package, simply @@ -16288,7 +16381,7 @@ This boolean may be tested by the user for later use. % if a package has already been loaded, it is loaded again with its original options. % \changes{v0.79}{2019/12/31}{Fix: \pkg{catoptions}.} % \begin{macrocode} - \@ifpackageloaded{#1}{% + \IfPackageLoadedTF{#1}{% \edef\LWR@tempone{\csuse{opt@#1.sty}}% \IfValueTF{#2}% {% @@ -16624,11 +16717,17 @@ This boolean may be tested by the user for later use. % \section{Defining print and \HTML\ versions of macros and environments} % \label{sec:definingprinthtml} -% \gindex{print>selecting print/HTML definitions} -% \gindex{HTML>selecting print/HTML definitions} +% \gindex{print>defining print \Slash HTML macros \Slash envs} +% \gindex{HTML>defining print \Slash HTML macros \Slash envs} +% \gindex{LWR@formatted=\cs{LWR@formatted} print \Slash HTML} +% \gindex{defining print \Slash HTML macros \Slash envs} % -% The following refers to defining objects inside \pkg{lwarp}, and is not -% for the user's document. +% \changes{v0.903}{2021/12/19}{Docs: Now using \cs{NewCommandCopy}, \pkg{xparse} OK.} +% +% The following refers to defining objects inside \pkg{lwarp}, +% and may also be of some use for package authors to adapt their +% packages for \pkg{lwarp}. +% The following is not for the user's document. % % Many macros and environments must be provided as both print and \HTML\ versions. % @@ -16648,97 +16747,51 @@ This boolean may be tested by the user for later use. % % \begin{description} % -% \item[For a preexisting macro, not defined with \pkg{xparse}:] An \HTML\ version +% \item[For a preexisting macro:] An \HTML\ version % is provided with a special name, inside a \env{warpHTML} environment, % then \cs{LWR@formatted} is used to redefine and patch various macros: % \needspace{5\baselineskip} % \begin{sourceverb} % \begin{warpHTML} -% \newcommand{\LWR@HTML@name}{...}% may also use xparse +% \newcommand{\LWR@HTML@name}{...} % % \LWR@formatted{name} % \end{warpHTML} % \end{sourceverb} -% |\LWR@formatted{name}| copies the original print version, +% |\LWR@formatted{name}| copies the original print version to a new +% name \cs{LWR@print@}, % then redefines \cs{name} to use either the print or \HTML\ version depending -% on which mode \pkg{lwarp} is using. \pkg{xparse} may be used to -% define the new \HTML\ version, even if the original did not use \pkg{xparse}. -% \pkg{expl3} syntax may be used as well. +% on which mode \pkg{lwarp} is using. -% \item[For a preexisiting environment, not defined with \pkg{xparse}:] The process +% \item[For a preexisiting environment:] The process % is similar. Note the use of \cs{LWR@formattedenv} instead of \cs{LWR@formatted}. % \needspace{5\baselineskip} % \begin{sourceverb} % \begin{warpHTML} -% \newenvironment{LWR@HTML@name}{...}% may also use xparse +% \newenvironment{LWR@HTML@name}{...}{..} % % \LWR@formattedenv{name} % \end{warpHTML} % \end{sourceverb} -% \item[If the original used \pkg{xparse}:] A copy must be made using a new name: -% \needspace{7\baselineskip} -% \begin{sourceverb} -% \begin{warpHTML} -% \NewDocumentCommand{\LWR@print@name}{..}{..}% copy the original -% -% \NewDocumentCommand{\LWR@HTML@name}{..}{..}% or use \newcommand -% -% \LWR@formatted{name} -% \end{warpHTML} -% \end{sourceverb} -% Similar for an environment, using \cs{LWR@formattedenv}. -% (\cs{LWR@formatted} and \cs{LWR@formattedenv} use \cs{LetLtxMacro} to -% copy the original print definiton, -% which may not work with macros and environments created by \pkg{xparse}, -% so the print version must be manually recreated in the \pkg{lwarp} source.) - -% \item[For a new macro or environment, not using \pkg{xparse} for the print version:] \ +% \item[For a new macro or environment:] The print version is defined inside +% \env{warpall}, so that it can also be seen and modified by during \HTML\ outut. % \needspace{9\baselineskip} % \begin{sourceverb} % \begin{warpall} -% \newcommand{\name}{...}% NOT xparse! +% \newcommand{\name}{...}% The print version. % \end{warpall} % % \begin{warpHTML} -% \newcommand{\LWR@HTML@name}{...}% may use xparse for HTML +% \newcommand{\LWR@HTML@name}{...} % % \LWR@formatted{name} % \end{warpHTML} % \end{sourceverb} -% Similar for an environment. -% The plain \cs{name} or environment \env{name} is used for the printed -% version, and is placed inside \env{warpall}. -% \pkg{xparse} may be used for the \cs{LWR@HTML@} version. -% \pkg{expl3} syntax may be used for the print and \HTML\ versions. -% -% \item [For a new macro or environment, using \pkg{xparse}:] -% It is possible to use \pkg{xparse} for an entirely new macro or environment -% by defining the \cs{LWR@print@} version with \pkg{xparse}, along with -% \cs{name} defined without \pkg{xparse} to refer directly to the \cs{LWR@print} -% version: -% \needspace{16\baselineskip} -% \begin{sourceverb} -% \begin{warpall} -% \NewDocumentCommand{\LWR@print@name}{...} {...}% -or- -% \NewDocumentEnvironment{\LWR@print@name}{...} {...} {...} -% -% % Simply a call to \LWR@print@name: -% \newcommand{\name}{\LWR@print@name}% -or- -% \newenvironment{name}{\LWR@print@name}{\endLWR@print@name} -% \end{warpall} -% -% \begin{warpHTML} -% \NewDocumentCommand{\LWR@HTML@name}{...} {...}% -or- -% \NewDocumentEnvironment{\LWR@HTML@name}{...} {...} {...} -% -% \LWR@formatted{name}% -or- -% \LWR@formattedenv{name} -% \end{warpHTML} -% \end{sourceverb} +% Similar for an environment, using \cs{formattedenv}. % % \end{description} -% + % In general, \cs{LWR@formatted} or \cs{LWR@formattedenv} are placed inside % a \env{warpHTML} environment, and while producing an \HTML\ document % they do the following: @@ -16755,16 +16808,16 @@ This boolean may be tested by the user for later use. % used, as well as any new definitions defined in \env{warpall} above. % \item When \pkg{lwarp} is generating \HTML\ output, \cs{LWR@formatting} is % set to ``|HTML|'', and \cs{name} is directed to \cs{LWR@HTML@}. +% For an environment, \cs{endname} is directed to \cs{endLWR@HTML@}. % \item When \pkg{lwarp} is generating \HTML\ output % but enters a \env{lateximage} environment, % or for some other reason needs to draw images using the original print % defintions, \cs{LWR@formatting} is changed to ``|print|'' and \cs{name} is % then redirected to \cs{LWR@print@}, which was the original \cs{name}. +% \item Since the new \cs{name} does not process any arguments, +% they are processed by \cs{LWR@print@name} or \cs{LWR@HTML@name}. % \end{itemize} % -% Since arguments are not handled by the new \cs{name}, any star and other arguments -% are processed by the print or \HTML\ version. -% % Expandable versions are also provided as well. % These usually are necessary for anything which could appear inside a \env{tabular}, % without which a ``|Misplaced \omit|'' error may occur. @@ -16861,12 +16914,12 @@ This boolean may be tested by the user for later use. % where is set by \cs{LWR@formatting}, and is |print| or |HTML|. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@formatted}[1]{% \LWR@formatted@checkname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% + \csNewCommandCopycs{LWR@print@#1}{#1}% }{}% \ifcsundef{#1}{% \expandafter\newrobustcmd\csname #1\endcsname{% @@ -16888,12 +16941,12 @@ This boolean may be tested by the user for later use. % An expandable version of \cs{LWR@formatted}. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@expandableformatted}[1]{% \LWR@formatted@checkname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% + \csNewCommandCopycs{LWR@print@#1}{#1}% }{}% \ifcsundef{#1}{% \expandafter\newcommand\csname #1\endcsname{% @@ -16917,14 +16970,13 @@ This boolean may be tested by the user for later use. % where is set by \cs{LWR@formatting}, and is |print| or |HTML|. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@formattedenv}[1]{% \LWR@formatted@checkname{#1}% \LWR@formatted@checkendname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% - \csletcs{endLWR@print@#1}{end#1}% + \NewEnvironmentCopy{LWR@print@#1}{#1}% }{}% \DeclareDocumentEnvironment{#1}{}% {% @@ -16943,14 +16995,13 @@ This boolean may be tested by the user for later use. % An expandable version of \env{LWR@formattedenv}. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@expandableformattedenv}[1]{% \LWR@formatted@checkname{#1}% \LWR@formatted@checkendname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% - \csletcs{endLWR@print@#1}{end#1}% + \NewEnvironmentCopy{LWR@print@#1}{#1}% }{}% \DeclareExpandableDocumentEnvironment{#1}{}% {% @@ -17236,7 +17287,7 @@ This boolean may be tested by the user for later use. \LetLtxMacro\LWR@orig@textquotedbl\LWR@orig@@textquotedbl \AtEndPreamble{ -\@ifpackageloaded{libertinus-otf}{ +\IfPackageLoadedTF{libertinus-otf}{ \renewcommand{\LWR@orig@textquotedbl}{\LWR@orig@@textquotedbl\kern-.15em} \LetLtxMacro\textquotedbl\LWR@orig@textquotedbl }{} @@ -17764,16 +17815,17 @@ This boolean may be tested by the user for later use. }{% dvips % \end{macrocode} % For \DVI\ \prog{latex} with \prog{dvips} and \prog{ps2pdf}: +% \changes{v0.903}{2021/10/04}{Allow transparency.} % \begin{macrocode} \def\LWR@tempprintlatexcmd{% \LWR@compilecmd{latex}{} \LWR@addcompilecmd{dvips}{} - \LWR@addcompilecmd{ps2pdf}{}.ps + \LWR@addcompilecmd{ps2pdf -dALLOWPSTRANSPARENCY}{}.ps } \def\LWR@tempHTMLlatexcmd{% \LWR@compilecmd{latex}{_html} \LWR@addcompilecmd{dvips}{_html} - \LWR@addcompilecmd{ps2pdf}{_html}.ps + \LWR@addcompilecmd{ps2pdf -dALLOWPSTRANSPARENCY}{_html}.ps } } } @@ -17785,12 +17837,12 @@ This boolean may be tested by the user for later use. % \changes{v0.63}{2018/11/25}{\pkg{ujarticle} and related: Compile options.} % \changes{v0.64}{2018/12/07}{\pkg{utarticle} and related: Added.} % \begin{macrocode} -\@ifclassloaded{ujarticle}{\LWR@compileuplatex}{} -\@ifclassloaded{ujbook}{\LWR@compileuplatex}{} -\@ifclassloaded{ujreport}{\LWR@compileuplatex}{} -\@ifclassloaded{utarticle}{\LWR@compileuplatex}{} -\@ifclassloaded{utbook}{\LWR@compileuplatex}{} -\@ifclassloaded{utreport}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujarticle}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujbook}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujreport}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utarticle}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utbook}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utreport}{\LWR@compileuplatex}{} % \end{macrocode} % Only make the setting permanent if the original was empty: % \changes{v0.61}{2018/09/20}{Added \optn{PrintLatexCmd} option.} @@ -17969,6 +18021,7 @@ This boolean may be tested by the user for later use. % \changes{v0.902}{2021/09/15}{\filenm{lwarp.css}: Centered \element{div} \attribute{author}.} % \changes{v0.902}{2021/09/15}{\filenm{lwarp.css}: Added \pkg{beamerarticle}.} % \changes{v0.902}{2021/09/28}{\filenm{lwarp.css}: Added \attribute{textnormal}.} +% \changes{v0.903}{2022/01/02}{\filenm{lwarp.css}: Improved pars in lists.} % % ^^A *lwarp.css % @@ -17978,7 +18031,7 @@ This boolean may be tested by the user for later use. \begin{filecontents*}[overwrite]{lwarp.css} /* CSS stylesheet for the LaTeX Lwarp package - Copyright 2016-2021 Brian Dunn — BD Tech Concepts LLC + Copyright 2016-2022 Brian Dunn — BD Tech Concepts LLC */ @@ -18490,7 +18543,7 @@ div.bodywithoutsidetoc main.bodycontainer { } section.textbody div.footnotes{ - margin: 3ex 2em .5ex 2em ; + margin: 1ex 2em 2ex 2em ; border-bottom: 2px solid silver ; } @@ -18527,6 +18580,8 @@ body dir, body menu { li { margin: 0ex 0em 1ex 0em; } +li.p { display: inline ; } + html { margin: 0; padding: 0; @@ -20807,6 +20862,7 @@ MathJax = { % \changes{v0.84}{2020/03/30}{\prog{lwarpmk}: \optn{clean} also removes \filenm{comment_*.cut}} % \changes{v0.89}{2020/08/29}{\prog{lwarpmk}: \optn{clean} also removes \filenm{*.bbl}} % \changes{v0.899}{2021/05/30}{\prog{lwarpmk}: Warn if \pkg{lwarp} package not detected.} +% \changes{v0.903}{2021/11/30}{\prog{lwarpmk}: Error if \prog{pdftotext} not available.} % % The following is only generated if the \optn{lwarpmk} option % was given to \pkg{lwarp}. @@ -20819,10 +20875,10 @@ MathJax = { \begin{filecontents*}[overwrite]{lwarpmk.lua} #!/usr/bin/env texlua --- Copyright 2016-2021 Brian Dunn +-- Copyright 2016-2022 Brian Dunn -printversion = "v0.902" +printversion = "v0.903" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -21219,8 +21275,15 @@ function pdftohtml () -- Convert to text: print ("lwarpmk: Converting " .. sourcename .."_html.pdf to " .. sourcename .. "_html.html") -os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " +err = os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html") +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: Ensure that the Poppler utilities are installed." ) + print ("lwarpmk: See the Lwarp manual: `Installing additional utilities'." ) + print ("lwarpmk: ===") + os.exit(1) +end -- Split the result into individual HTML files: splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") end @@ -22079,15 +22142,40 @@ end -- not --version % \begin{macro}{\LWR@setexparray} \marg{name} \marg{index} \marg{contents} % \changes{v0.66}{2018/12/31}{Fix with \cs{par}.} % \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} +\newbool{LWR@setexparray@doingparhooks} + \NewDocumentCommand{\LWR@setexparray}{m m m}{% - \let\LWR@temp@par\par% +% \end{macrocode} +% +% Temporarily disable paragraph handling during the assignment. +% This is not done in a group with global assignments because +% a table may be nested. +% \begin{macrocode} + \let\ifLWR@setexparray@doingparhooks\ifLWR@doingparhooks% + \setbool{LWR@doingparhooks}{false}% + \let\LWR@setexparray@par\par% \let\par\relax% - \edef\LWR@thisexparrayname{#1#2}% +% \end{macrocode} +% +% The name of the control sequence is the given name with the +% index appended. +% \begin{macrocode} + \xdef\LWR@thisexparrayname{#1#2}% +% \end{macrocode} +% +% Locally assign the value to the control sequence: +% \begin{macrocode} \ifstrempty{#3}% {\csdef{\LWR@thisexparrayname}{}}% {\csedef{\LWR@thisexparrayname}{#3}}% - \let\par\LWR@temp@par% +% \end{macrocode} +% +% Restore the paragraph handling: +% \begin{macrocode} + \let\ifLWR@doingparhooks\ifLWR@setexparray@doingparhooks% + \let\par\LWR@setexparray@par% } % \end{macrocode} % \end{macro} @@ -23012,6 +23100,7 @@ end -- not --version % \subsection{Hook while processing tags} % +% \DescribeHook[lwarp]{\cs{LWR@hook@processingtags}} % This is used to disable special text processing while processing \HTML\ tags. % Special processing includes that done by % \pkg{babel-french}, \pkg{luavina}, \pkg{xevlna}. @@ -23197,60 +23286,60 @@ end -- not --version % \changes{v0.84}{2020/04/22}{Nullified \env{minipage}, \cs{parbox} inside a span.} % \changes{v0.84}{2020/04/22}{Issue warnings inside a span.} % \changes{v0.896}{2021/03/05}{Issue \env{BlockClassWP} warning inside a span.} +% \changes{v0.903}{2021/12/17}{Par handling.} % % \begin{macrocode} \newcommand*{\LWR@nestspanitem}{% - \if@newlist\else{\LWR@htmltagc{br /}}\fi% + \if@newlist\else{ + \LWR@htmltagc{br /}% + \LWR@orignewline% + }\fi% \LWR@origitem% } \newenvironment*{LWR@nestspan} {% -\LWR@traceinfo{LWR@nestspan starting}% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{% - \LWR@traceinfo{LWR@nestspan: inside a lateximage}% -}% -{% not in a lateximage - \LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% - \addtocounter{LWR@spandepth}{1}% + \LWR@traceinfo{LWR@nestspan starting}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {% + \LWR@traceinfo{LWR@nestspan: inside a lateximage}% + }% + {% not in a lateximage + \LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% + \addtocounter{LWR@spandepth}{1}% % \end{macrocode} % Nullify several objects inside the span: % ^^A {\LWR@subhtmlelementclass{span}{inlineminipage}}% % ^^A {\LWR@htmltagc{/span}}% % \begin{macrocode} - \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}% - {\LWR@spanwarnformat{minipage or \protect\parbox}}% - {}% - \RenewDocumentEnvironment{BlockClass}{o m}% - {\LWR@spanwarnformat{multi-paragraph object}}% - {}% - \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% - {\LWR@spanwarnformat{multi-paragraph object}}% - {}% - \renewcommand{\BlockClassSingle}[2]{% - {\LWR@spanwarnformat{multi-paragraph object}}% - ##2% - }% - \renewcommand{\LWR@forcenewpage}{}% - \renewcommand{\LWR@liststart}{% - \LetLtxMacro\item\LWR@nestspanitem% - }% - \renewcommand{\LWR@listend}{\LWR@htmltagc{br /}\LWR@htmltagc{br /}}% - \renewenvironment{quote}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% - \renewenvironment{quotation}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% -}% not in a lateximage -\LWR@traceinfo{LWR@nestspan starting: done}% + \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}% + {\LWR@spanwarnformat{minipage or \protect\parbox}}% + {}% + \RenewDocumentEnvironment{BlockClass}{o m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% + \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% + \renewcommand{\BlockClassSingle}[2]{% + {\LWR@spanwarnformat{multi-paragraph object}}% + ##2% + }% + \renewcommand{\LWR@forcenewpage}{}% + \renewcommand{\LWR@liststart}{\LetLtxMacro\item\LWR@nestspanitem}% + \renewcommand{\LWR@listend}{\leavevmode}% + \renewenvironment{quote}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% + \renewenvironment{quotation}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% + }% not in a lateximage + \LWR@traceinfo{LWR@nestspan starting: done}% }% starting env {% ending env -\LWR@traceinfo{LWR@nestspan ending}% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{}% -{\addtocounter{LWR@spandepth}{-1}}% -\LWR@traceinfo{LWR@nestspan ending: done}% + \LWR@traceinfo{LWR@nestspan ending}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {\addtocounter{LWR@spandepth}{-1}}% + \LWR@traceinfo{LWR@nestspan ending: done}% } - -\AfterEndEnvironment{LWR@nestspan}{\global\let\par\LWR@closeparagraph} % \end{macrocode} % \end{environment} @@ -23265,12 +23354,12 @@ end -- not --version % % \begin{macrocode} \NewDocumentCommand{\LWR@htmlspan}{m +m}{% -\LWR@ensuredoingapar% -\LWR@htmltagc{#1}% -\begin{LWR@nestspan}% -#2% -\LWR@htmltagc{/#1}% -\end{LWR@nestspan}% + \LWR@ensuredoingapar% + \LWR@htmltagc{#1}% + \begin{LWR@nestspan}% + #2% + \LWR@htmltagc{/#1}% + \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} @@ -23303,9 +23392,7 @@ end -- not --version % Print an \HTML\ tag: \textless{}tag\textgreater{} % \begin{macrocode} \newcommand*{\LWR@htmltag}[1]{% -% \LWR@traceinfo{LWR@htmltagb !\detokenize{#1}!}% -\LWR@htmltagc{#1}% -% \LWR@traceinfo{LWR@htmltagb: done}% + \LWR@htmltagc{#1}% } % \end{macrocode} % \end{macro} @@ -23321,25 +23408,21 @@ end -- not --version % \changes{v0.85}{2020/04/29}{Fix: Added print macros for \pkg{fontspec}.} % \begin{macrocode} \newcommand*{\LWR@htmlopencomment}{% -{% % \LWR@traceinfo{LWR@htmlopencomment}% -\begingroup% -\LWR@hook@processingtags% -\ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% -\LWR@print@mbox{\LWR@origtextless{}!-\/-}% -\endgroup% -}% + \begingroup% + \LWR@hook@processingtags% + \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% + \LWR@print@mbox{\LWR@origtextless{}!-\/-}% + \endgroup% } \newcommand*{\LWR@htmlclosecomment}{% -{% % \LWR@traceinfo{LWR@htmlclosecomment}% -\begingroup% -\LWR@hook@processingtags% -\ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% -\LWR@print@mbox{-\/-\LWR@origtextgreater}% -\endgroup% -}% + \begingroup% + \LWR@hook@processingtags% + \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% + \LWR@print@mbox{-\/-\LWR@origtextgreater}% + \endgroup% } % \end{macrocode} % \end{macro} @@ -23352,16 +23435,16 @@ end -- not --version % \changes{v0.893}{2020/10/16}{Disabled in math mode.} % \begin{macrocode} \newcommand{\LWR@htmlcomment}[1]{% -\ifmmode% -\else% - \LWR@htmlopencomment{}% - {% - \LWR@print@normalfont% - \LWR@origttfamily% break ligatures - #1% - }% - \LWR@htmlclosecomment{}% -\fi% + \ifmmode% + \else% + \LWR@htmlopencomment{}% + {% + \LWR@print@normalfont% + \LWR@origttfamily% break ligatures + #1% + }% + \LWR@htmlclosecomment{}% + \fi% } % \end{macrocode} % \end{macro} @@ -23370,16 +23453,16 @@ end -- not --version % \begin{macro}{\LWR@htmlblockcomment} \marg{comment} % \begin{macrocode} \newcommand{\LWR@htmlblockcomment}[1] -{\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars} + {\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlblocktag} \marg{tag} print a stand-alone \HTML\ tag % \begin{macrocode} \newcommand*{\LWR@htmlblocktag}[1]{% -\LWR@stoppars% -\LWR@htmltag{#1}% -\LWR@startpars% + \LWR@stoppars% + \LWR@htmltag{#1}% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -23408,24 +23491,24 @@ end -- not --version % % \begin{macrocode} \NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} D(){} m}{% -\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% -\ifblank{#2}% -{% empty style - \LWR@htmltag{% - #1% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces - \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces + \LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% + \ifblank{#2}% + {% empty style + \LWR@htmltag{% + #1% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces + \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces + }% }% -}% -{% non-empty style - \LWR@htmltag{% - #1\LWR@indentHTML% - \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% - \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% - style=\textquotedbl#2\textquotedbl\LWR@orignewline% + {% non-empty style + \LWR@htmltag{% + #1\LWR@indentHTML% + \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% + style=\textquotedbl#2\textquotedbl\LWR@orignewline% + }% }% -}% -\LWR@traceinfo{LWR@subhtmlelementclass done}% + \LWR@traceinfo{LWR@subhtmlelementclass done}% } % \end{macrocode} % \end{macro} @@ -23497,12 +23580,12 @@ end -- not --version % \changes{v0.73}{2019/06/26}{Vertical space.} % \begin{macrocode} \NewDocumentCommand{\LWR@htmlelementclassline}{m o m +m}{% -\LWR@stoppars -\LWR@forceemptyline% -\LWR@subhtmlelementclass{#1}[#2]{#3}% -#4% -\LWR@htmltag{/#1} -\LWR@startpars + \LWR@stoppars + \LWR@forceemptyline% + \LWR@subhtmlelementclass{#1}[#2]{#3}% + #4% + \LWR@htmltag{/#1} + \LWR@startpars } % \end{macrocode} % \end{macro} @@ -23516,7 +23599,7 @@ end -- not --version % \begin{macro}{\LWR@htmlelement} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelement}[1]{% -\LWR@htmlblocktag{#1} + \LWR@htmlblocktag{#1} } % \end{macrocode} % \end{macro} @@ -23524,9 +23607,9 @@ end -- not --version % \begin{macro}{\LWR@htmlelementend} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelementend}[1]{% -\LWR@stoppars -\LWR@htmltag{/#1} -\LWR@startpars + \LWR@stoppars + \LWR@htmltag{/#1} + \LWR@startpars } \end{warpHTML} @@ -23558,12 +23641,13 @@ end -- not --version % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentEnvironment{BlockClass}{o D(){} m}{}{} -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{environment} % @@ -23571,8 +23655,6 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@BlockClass}{o D(){} m}{}{}% - \NewDocumentEnvironment{LWR@HTML@BlockClass}{o D(){} m}% {\LWR@htmldivclass[#1](#2){#3}}% {\LWR@htmldivclassend{#3}} @@ -23623,30 +23705,29 @@ end -- not --version % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.62}{2018/10/24}{Added optional word-processing style. Replaces \cs{LWR@HTMLtextstyle}.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentCommand{\InlineClass}{D{(}{)}{} o m +m}{#4}% -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{macro} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentCommand{\LWR@print@InlineClass}{D{(}{)}{} o m +m}{#4}% - \NewDocumentCommand{\LWR@HTML@InlineClass}{D{(}{)}{} o m +m}{% -\LWR@traceinfo{LWR@HTML@InlineClass #3}% -\ifbool{FormatWP}{% - \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% - \LWR@htmlspanclass[#1]{#3}{#4}% -}{% - \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% - \LWR@htmlspanclass[#2]{#3}{#4}% -}% -\LWR@traceinfo{LWR@HTML@InlineClass: done}% + \LWR@traceinfo{LWR@HTML@InlineClass #3}% + \ifbool{FormatWP}{% + \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% + \LWR@htmlspanclass[#1]{#3}{#4}% + }{% + \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% + \LWR@htmlspanclass[#2]{#3}{#4}% + }% + \LWR@traceinfo{LWR@HTML@InlineClass: done}% } \LWR@formatted{InlineClass} @@ -23667,48 +23748,47 @@ end -- not --version % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}{}{} -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{environment} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m D(){} m}{}{}% - \NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m D(){} m}% -{% -\LWR@stoppars% -\ifbool{FormatWP}% -{% - \addtocounter{LWR@thisautoidWP}{1}% + {% + \LWR@stoppars% + \ifbool{FormatWP}% + {% + \addtocounter{LWR@thisautoidWP}{1}% % \end{macrocode} % \changes{v0.65}{2018/12/21}{Fix space between class and id.} % \begin{macrocode} - \LWR@htmltag{% - div class=\textquotedbl#4\textquotedbl\ % space - id=\textquotedbl% - \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% - \textquotedbl% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% - \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% - }% -}% FormatWP -{% not FormatWP - \LWR@htmltag{% - div class=\textquotedbl#4\textquotedbl% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% - \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% - }% -}% not FormatWP -\LWR@startpars% -} -{\LWR@htmldivclassend{#4}} + \LWR@htmltag{% + div class=\textquotedbl#4\textquotedbl\ % space + id=\textquotedbl% + \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% + \textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% + \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% + }% + }% FormatWP + {% not FormatWP + \LWR@htmltag{% + div class=\textquotedbl#4\textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% + \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% + }% + }% not FormatWP + \LWR@startpars% + } + {\LWR@htmldivclassend{#4}} \LWR@formattedenv{LWR@BlockClassWP} \end{warpHTML} @@ -23775,14 +23855,16 @@ end -- not --version % Paragraph tags are or are not allowed depending on many conditions. % \Cref{sec:parstartstop} has high-level commands which allow % paragraph-tag generation to start/stop. -% Even when allowed (\cs{LWR@doingstartpars}), +% Even when allowed (\bool{LWR@doingstartpars}), % tags are not generated until a \LaTeX{} paragraph -% is being used (\cs{LWR@doingapar}). -% |LWR@lateximagedepth| is used to prevent nesting tags inside -% a |lateximage|. -% |LWR@spandepth| is used to prevent nesting paragraph tags inside +% is being used (\bool{LWR@doingapar}). +% \ctr{LWR@lateximagedepth} is used to prevent nesting tags inside +% a \env{lateximage}. +% \ctr{LWR@spandepth} is used to prevent nesting paragraph tags inside % a paragraph, which became important inside \cs{fbox} commands and other spans. - +% +% The \LaTeX\ paragraph hooks are used to manage tag creation. +% % \codehtml % \begin{macrocode} \begin{warpHTML} @@ -23797,6 +23879,31 @@ end -- not --version % \end{macrocode} +% \DescribeBoolean{LWR@doingparhooks} +% Tells whether the \pkg{lwarp} paragraph hooks are to be active. +% \begin{macrocode} +\newbool{LWR@doingparhooks} +\boolfalse{LWR@doingparhooks} +% \end{macrocode} + +% \DescribeBoolean{LWR@in@multirow@par} +% Tells whether to generate break instead of paragraph tags inside a \cs{multirow}. +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} +\newbool{LWR@in@multirow@par} +\boolfalse{LWR@in@multirow@par} +% \end{macrocode} + + +% \DescribeBoolean{LWR@starting@fancybox} +% Suppresses \element{br} if beginning a \pkg{fancybox} environment. +% \changes{v0.903}{2022/01/29}{Par handling.} +% \begin{macrocode} +\newbool{LWR@starting@fancybox} +\boolfalse{LWR@starting@fancybox} +% \end{macrocode} + + % \DescribeBoolean{LWR@doingstartpars} % Tells whether paragraphs may be generated. % \begin{macrocode} @@ -23843,17 +23950,20 @@ end -- not --version % % See if paragraph handling is enabled: % \begin{macrocode} -\ifbool{LWR@doingstartpars}% -{% handling pars + \ifboolexpr{ + bool{LWR@doingparhooks} and + bool{LWR@doingstartpars} + }% + {% handling pars % \end{macrocode} % % See if have already started a \env{lateximage} or a \element{span}. % If so, do not generate nested paragraph tags. % \begin{macrocode} - \ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} - }% nested par tags? + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% nested par tags? % \end{macrocode} % % If so: Do nothing if already started a \env{lateximage} page. @@ -23861,14 +23971,14 @@ end -- not --version % Also do nothing if already inside a \element{span}. Do not nest paragraph tags % inside a \element{span}. % \begin{macrocode} - {}% no nested par tags + {}% no nested par tags % \end{macrocode} % % Else: No \env{lateximage} or \element{span} has been started yet, % so it's OK to generate paragraph tags. % \begin{macrocode} - {% yes nest par tags - \ifbool{LWR@doingapar}{}{% + {% yes nest par tags + \ifbool{LWR@doingapar}{}{% % \end{macrocode} % % If \pkg{parnotes} is used, paragraph notes are inserted @@ -23876,35 +23986,30 @@ end -- not --version % \changes{v0.56}{2018/05/09}{Added support for \pkg{parnotes}.} % \changes{v0.902}{2021/09/20}{Improved \pkg{parnotes}.} % \begin{macrocode} - \PN@parnotes@auto% + \PN@parnotes@auto% % \end{macrocode} % % Set flag before creating the tag, so that the tag itself does not trigger % a new paragraph: % \changes{v0.902}{2021/09/20}{Improved par tags.} % \begin{macrocode} - \global\booltrue{LWR@doingapar}% + \global\booltrue{LWR@doingapar}% % \end{macrocode} % % The opening paragraph tag. % Do not create tag if doing \pkg{algorithm2e} handling instead: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} - \ifbool{LWR@algocf@dopars}{}{% - \LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline% + \ifbool{LWR@algocf@dopars}{}{% + \ifbool{LWR@in@multirow@par}% + {}% + {\LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline}% + }% }% - }% -% \end{macrocode} -% -% At the endof each paragraph, -% generate closing tag and do regular |/par| stuff. -% (Attempting to use the \pkg{everyhook} |cr| hook -% for \cs{LWR@closeparagraph} does not work well.) -% \begin{macrocode} - \let\par\LWR@closeparagraph% - }% end of yes nest par tags -}% end of handling pars -{}% not handling pars + }% end of yes nest par tags + }% end of handling pars + {}% not handling pars } \let\LWR@ensuredoingapar\LWR@openparagraph @@ -23919,17 +24024,18 @@ end -- not --version % and not in tabular metadata. Factored from \cs{LWR@closeparagraph}. % % \changes{v0.66}{2019/01/01}{Factored.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@closeparagraph@br} {% \ifboolexpr{ test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} and test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} and - not bool {LWR@intabularmetadata} + not bool {LWR@starting@fancybox} and + not bool {LWR@intabularmetadata} or + bool {LWR@in@multirow@par} }% - {% - \unskip\LWR@htmltagc{br /}% - }% + {\unskip\LWR@htmltagc{br /}}% {}% } % \end{macrocode} @@ -23948,36 +24054,39 @@ end -- not --version % % See if paragraph handling is enabled: % \begin{macrocode} -\ifbool{LWR@doingapar}% + \ifbool{LWR@doingparhooks}{% + \ifbool{LWR@doingapar}% % \end{macrocode} % % If currently in paragraph mode: % \begin{macrocode} -{% handling pars + {% handling pars % \end{macrocode} % % See if already started a \env{lateximage} or a \element{span}: +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} - \ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} - }% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} or + bool{LWR@in@multirow@par} + }% % \end{macrocode} % % Add a parbreak if in a span, not in a lateximage, % and not in table metadata. % \begin{macrocode} - {% no nested par tags - \LWR@closeparagraph@br% - }% no nested par tags + {% no nested par tags + \LWR@closeparagraph@br% + }% no nested par tags % \end{macrocode} % % If have not already started a \env{lateximage} or a \element{span}: % \begin{macrocode} - {% yes nest par tags + {% yes nest par tags % \end{macrocode} % -% Print a closing tag and some extra vertical space. +% Print a closing tag. % % (The fill seems to be required to force the \pkg{caption} % package to create flush left caption text in the \HTML.) @@ -23985,20 +24094,20 @@ end -- not --version % \changes{v0.70}{2019/03/25}{Reduced underfull \cs{hbox} warnings.} % \changes{v0.71}{2019/04/08}{Flush left captions.} % \begin{macrocode} - \@hspacer{\fill}% \hspace*{\fill} - \leavevmode\LWR@orignewline% - \LWR@htmltagc{/\LWR@tagregularparagraph}% + \@hspacer{\fill}% \hspace*{\fill} + \leavevmode\LWR@orignewline% + \LWR@htmltagc{/\LWR@tagregularparagraph}% % \end{macrocode} % % No longer doing a paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% keep + \global\boolfalse{LWR@doingapar}% % \end{macrocode} % % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \begin{macrocode} - \global\boolfalse{LWR@minipagethispar}% + \global\boolfalse{LWR@minipagethispar}% % \end{macrocode} % % If \pkg{parnotes} is used, paragraph notes are inserted @@ -24006,53 +24115,71 @@ end -- not --version % \changes{v0.56}{2018/05/09}{Added support for \pkg{parnotes}.} % \changes{v0.902}{2021/09/20}{Improved \pkg{parnotes}.} % \begin{macrocode} - \PN@parnotes@auto% + \PN@parnotes@auto% % \end{macrocode} % -% After creating par notes, not yet started a new paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% - }% end of yes nest par tags -}% end of handling pars + }% end of yes nest par tags + }% LWR@doingapar: end of handling pars % \end{macrocode} % % Add a parbreak if in a span, not in a lateximage, % and not in table metadata. % \changes{v0.66}{2019/01/01}{Fix: Combined span, \env{tabular}, and \env{lateximage}.} % \begin{macrocode} -{% not handling pars - \LWR@closeparagraph@br% -}% not handling pars + {% not LWR@doingapar: not handling pars + \LWR@closeparagraph@br% + }% not handling pars % \end{macrocode} % % In most cases, finish with a \LaTeX\ \cs{par}, but in the case -% of paragraphs between lines in a tabular fetch the next token instead: +% of paragraphs between lines in a tabular fetch the next token instead. +% Required for \cs{multicolumn}. % \changes{v0.46}{2018/01/19}{Fix: Tabular empty lines.} % \begin{macrocode} -\ifboolexpr{% - not bool {LWR@doingapar} and - test {\ifnumcomp{\value{LWR@tabulardepth}}{>}{0}} and - test { - \ifnumcomp{\value{LWR@tabulardepth}}{=}{\value{LWR@tabularpardepth}} - } and - bool {LWR@intabularmetadata} and - not bool {LWR@tableparcell} and - test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} -}% -{% - \LWR@getmynexttoken% -}{% - \LWR@origpar% -}% + \ifboolexpr{% + not bool {LWR@doingapar} and + test {\ifnumcomp{\value{LWR@tabulardepth}}{>}{0}} and + test { + \ifnumcomp{\value{LWR@tabulardepth}}{=}{\value{LWR@tabularpardepth}} + } and + bool {LWR@intabularmetadata} and + not bool {LWR@tableparcell} and + test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} + }% + {\LWR@getmynexttoken}% + {}% + }% LWR@doingparhooks + {}% not LWR@doingparhooks +% Do not place anything here, due to the above \LWR@getmynexttoken. } % \end{macrocode} % \end{macro} + +% \subsection{Paragraph Hooks} +% +% \changes{v0.903}{2021/12/17}{Par handling.} +% +% \DescribeHook[LaTeX]{para/begin} +% \begin{macrocode} +\AddToHook{para/begin}[lwarp]{\LWR@openparagraph} +% \end{macrocode} +% +% \DescribeHook[LaTeX]{para/end} +% \begin{macrocode} +\AddToHook{para/end}[lwarp]{\LWR@closeparagraph} +% \end{macrocode} + + % \begin{macrocode} \end{warpHTML} % \end{macrocode} + + + % \section{Paragraph start/stop handling} % \label{sec:parstartstop} % These commands allow/disallow the generation of \HTML\ @@ -24061,8 +24188,8 @@ end -- not --version % \Cref{sec:parhanding} has the commands which actually generate % the tags. % -% The |everyhook| package is used to generate the opening -% paragraph tags. The closing tags are generated by \cs{par}. +% The \LaTeX\ paragraph hooks are used to generate the opening and closing +% paragraph tags. % \codehtml % \begin{macrocode} @@ -24074,62 +24201,49 @@ end -- not --version % Begin handling \HTML\ paragraphs. % This allows an \HTML\ paragraph to start, but one has not yet begun. % \changes{v0.84}{2020/04/14}{Ignore if in \env{lateximage}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@startpars}% {% -% \LWR@traceinfo{LWR@startpars}% % \end{macrocode} % % Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} -}% -{}% -{% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% + {}% nesting + {% not nesting % \end{macrocode} % +% The \LaTeX\ paragraph hook controls tag generation for +% the start and end of paragraphs. +% % See if currently handling \HTML\ paragraphs: % \begin{macrocode} - \ifbool{LWR@doingstartpars}% + \ifboolexpr {bool{LWR@doingparhooks} and bool{LWR@doingstartpars}}% % \end{macrocode} % % If already in paragraph mode, do nothing. % \begin{macrocode} - {}% + {}% % \end{macrocode} % % If not currently in paragraph mode: % \begin{macrocode} - {% -% \end{macrocode} -% -% At the start of each paragraph, generate an opening tag: -% \gindex{par=\cs{par}>hooks} -% \changes{v0.902}{2021/09/24}{Cleared hook before adding.} -% \begin{macrocode} - \ClearPreHook{par}% - \PushPreHook{par}{\LWR@openparagraph}% -% \end{macrocode} -% -% At the end of each paragraph, generate closing tag then do regular |/par| actions: -% \begin{macrocode} - \let\par\LWR@closeparagraph - - }% an intentionally blank line + {\par}% % \end{macrocode} % % Are now handling paragraphs, but have not yet actually started one: % \begin{macrocode} - \global\setbool{LWR@doingstartpars}{true}% + \global\booltrue{LWR@doingstartpars}% % \end{macrocode} % % No \element{par} tag yet to undo: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% -}% nestspan -% \LWR@traceinfo{LWR@startpars: done}% + \global\boolfalse{LWR@doingapar}% + }% not nesting } % \end{macrocode} % \end{macro} @@ -24141,6 +24255,7 @@ end -- not --version % % \changes{v0.36}{2017/08/15}{Extra \protect\HTML\ source space after paragraphs.} % \changes{v0.84}{2020/04/14}{Ignore if in \env{lateximage}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@stoppars}% {% @@ -24148,74 +24263,59 @@ end -- not --version % % Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} -}% -{}% -{% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% + {}% nesting + {% not nesting % \end{macrocode} % % See if currently handling \HTML\ paragraphs: % \begin{macrocode} - \ifbool{LWR@doingapar}% + \ifboolexpr{bool{LWR@doingparhooks} and bool{LWR@doingapar}}% % \end{macrocode} % % if currently in an \HTML\ paragraph: % \begin{macrocode} - {% + {% % \end{macrocode} % % Print a closing tag: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \begin{macrocode} - \leavevmode\LWR@orignewline% - \LWR@htmltagc{/\LWR@tagregularparagraph}% - \LWR@orignewline% + \leavevmode\LWR@orignewline% + \LWR@htmltagc{/\LWR@tagregularparagraph}% + \LWR@orignewline% % \end{macrocode} % % No longer have an open \HTML\ paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% + \global\boolfalse{LWR@doingapar}% % \end{macrocode} % % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \changes{v0.71}{2019/04/08}{Reduced underfull \cs{hbox} warnings.} % \begin{macrocode} - \global\boolfalse{LWR@minipagethispar} - }% + \global\boolfalse{LWR@minipagethispar}% + }% % \end{macrocode} % % If was not in an \HTML\ paragraph: % \begin{macrocode} - {}% -% \end{macrocode} -% -% See if currently allowing \HTML\ paragraphs: -% \begin{macrocode} - \ifbool{LWR@doingstartpars}% -% \end{macrocode} -% -% If so: clear the |par| hook to no longer catch paragraphs: -% \begin{macrocode} - {\ClearPreHook{par}}% -% \end{macrocode} -% -% Else: Do nothing: -% \begin{macrocode} - {}% + {}% % \end{macrocode} % % No longer in paragraph mode: % \begin{macrocode} - \global\setbool{LWR@doingstartpars}{false}% + \global\setbool{LWR@doingstartpars}{false}% % \end{macrocode} % % No \element{p} tag to undo: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% -}% nestspan + \global\boolfalse{LWR@doingapar}% + }% not nesting } % \end{macrocode} % \end{macro} @@ -24352,8 +24452,8 @@ end -- not --version % % \begin{macrocode} \newcommand*{\CSSFilename}[1]{% -\renewcommand*{\LWR@currentcss}{#1}% -\@onelevel@sanitize\LWR@currentcss% + \renewcommand*{\LWR@currentcss}{#1}% + \@onelevel@sanitize\LWR@currentcss% } \end{warpHTML} @@ -24930,6 +25030,18 @@ end -- not --version % \end{macro} % +% \begin{macro}{\LWR@nullifyfootnotes} +% +% Cancels footnotes, such as inside an \HTML\ comment or a \cs{nameref}. +% \changes{v0.903}{2021/12/28}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@nullifyfootnotes}{% + \renewcommand{\footnote}[2][]{}% + \renewcommand{\footnotemark}[1][]{}% +} +% \end{macrocode} +% \end{macro} + % \begin{macrocode} \end{warpHTML} @@ -24957,9 +25069,10 @@ end -- not --version \renewcommand{\marginpar}[2][]{% \ifbool{FormatWP}% {% -\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% -#2 -\end{LWR@BlockClassWP}% + \begin{LWR@BlockClassWP}% + {width:2in; float:right; margin:10pt}{}(note){marginblock}% + #2 + \end{LWR@BlockClassWP}% }% {% \LWR@htmlspanclass(note){marginpar}{#2}% @@ -24982,18 +25095,22 @@ end -- not --version % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand{\marginparBlock}[2][]{% -\LWR@stoppars% -\ifbool{FormatWP}% -{% - \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% - #2 - \end{LWR@BlockClassWP} -}{% - \begin{BlockClass}[width:2in; float:right; margin:10pt](note){marginparblock}% - #2 - \end{BlockClass} -}% -\LWR@startpars% + \LWR@stoppars% + \ifbool{FormatWP}% + {% + \begin{LWR@BlockClassWP}% + {width:2in; float:right; margin:10pt}{}% + (note){marginblock}% + #2 + \end{LWR@BlockClassWP} + }% + {% + \begin{BlockClass}[width:2in; float:right; margin:10pt]% + (note){marginparblock}% + #2 + \end{BlockClass} + }% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -25605,30 +25722,33 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@HTMLsanitize} \marg{text} +% \begin{macro}{\LWR@HTMLsanitizedetokenized} \marg{detokenized text} % -% Prints the sanitized text. +% Prints the sanitized text, already detokenized. % +% \changes{v0.903}{2021/12/17}{Added.} % \begin{macrocode} -\newrobustcmd{\LWR@HTMLsanitize}[1]{% +\newrobustcmd{\LWR@HTMLsanitizedetokenized}[1]{% + \LWR@traceinfo{LWR@HTMLsanitizedetokenized !#1!}% % \end{macrocode} % Cancel French \pkg{babel} character handling, % and fully expand the strings: % \begin{macrocode} \begingroup% \LWR@hook@processingtags% - \edef\LWR@strresult{\detokenize{#1}}% + \edef\LWR@strresult{#1}% \LWR@subHTMLsanitize% \LWR@strresult% \endgroup% + \LWR@traceinfo{LWR@HTMLsanitize done}% } % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@HTMLsanitizeexpand} \marg{text} +% \begin{macro}{\LWR@HTMLsanitizeexpanded} \marg{text}% % -% This version expands the argument before sanitizing it. +% This version must be given the detokenized and expanded text. % This is only used for adding math to \MathJax\ expressions or % \env{lateximage} \attribute{alt} tags. % @@ -25636,7 +25756,6 @@ end -- not --version % \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} % ^^A \changes{v0.79}{2020/01/27}{Fix: \cs{\&}.} % \changes{v0.89}{2020/08/08}{Fix: Nested \MathJax\ environments.} -% ^^A *88* % \begin{macrocode} \edef\LWR@beginspaceleftbrace{begin \LWRleftbrace} \edef\LWR@beginspaceleftbrace{\detokenize\expandafter{\LWR@beginspaceleftbrace}} @@ -25648,7 +25767,7 @@ end -- not --version \edef\LWR@endrightbrace{end\LWRrightbrace} \edef\LWR@endrightbrace{\detokenize\expandafter{\LWR@endrightbrace}} -\newrobustcmd{\LWR@HTMLsanitizeexpand}[1]{% +\newrobustcmd{\LWR@HTMLsanitizeexpanded}[1]{% % \end{macrocode} % Cancel French \pkg{babel} character handling, % and fully expand the strings: @@ -25656,11 +25775,10 @@ end -- not --version \begingroup% \LWR@hook@processingtags% % \end{macrocode} -% The difference between this and \cs{LWR@HTMLsanitize} (without ``expand'') -% is the following \cs{expandafter}: % \begin{macrocode} - \edef\LWR@strresult{\detokenize\expandafter{#1}}% + \edef\LWR@strresult{#1}% % \end{macrocode} +% % The math expression may includes spaces between tokens, % but \MathJax\ does not want a space between \cs{begin} or \cs{end} % and the following brace. @@ -25734,7 +25852,7 @@ end -- not --version \StrLen{\detokenize{#1}}[\LWR@tempone]% \ifnumgreater{\LWR@tempone}{350}{% \AtEndDocument{% - \PackageWarningNoLine{lwarp}{% + \PackageNoteNoLine{lwarp}{% To ensure faster MathJax compilation, place each\MessageBreak custom macro in its own \protect\CustomizeMathJax.\MessageBreak See the Lwarp documentation regarding customizing\MessageBreak @@ -26714,19 +26832,31 @@ end -- not --version % \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Limited \HTML\ comment if starred.} % \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Use short \TOC\ entry % for HTMLDebug comments.} +% \changes{v0.903}{2021/12/28}{Add: Sectioning \HTML\ comment divider.} +% \changes{v0.903}{2021/12/28}{Fix: Nullfiy footnotes in \HTML\ comment.} % \begin{macrocode} -\ifbool{HTMLDebugComments}{% - \begingroup% - \LWR@nullfonts% - \IfBooleanTF{#1}% starred - {\LWR@htmlcomment{Opening #4*}}% +\begingroup% +\LWR@nullfonts% +\LWR@nullifyfootnotes% +\LWR@htmlcomment{................................}% +\LWR@orignewline% +\ifbool{HTMLDebugComments}% {% - \IfNoValueTF{#2}% short TOC - {\LWR@htmlcomment{Opening #4 ``#3''}}% - {\LWR@htmlcomment{Opening #4 ``#2''}}% - }\LWR@orignewline% - \endgroup% -}{} + \IfBooleanTF{#1}% starred + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4* ``#3''}}% + {\LWR@htmlcomment{Opening #4* ``#2''}}% + }% + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4 ``#3''}}% + {\LWR@htmlcomment{Opening #4 ``#2''}}% + }% + \LWR@orignewline% + }% + {}% +\endgroup% % \end{macrocode} % % For inline sections paragraph and subparagraph, start a new paragraph now: @@ -27286,10 +27416,14 @@ end -- not --version % \changes{v0.84}{2020/04/12}{Improved \HTML\ title.} % \begin{macrocode} \StrSubstitute{\theHTMLSection}{\protect}{\detokenize{-}}[\theHTMLSection]% -\StrSubstitute{\theHTMLSection}{\detokenize{-----}}{\detokenize{-}}[\theHTMLSection]% -\StrSubstitute{\theHTMLSection}{\detokenize{----}}{\detokenize{-}}[\theHTMLSection]% -\StrSubstitute{\theHTMLSection}{\detokenize{---}}{\detokenize{-}}[\theHTMLSection]% -\StrSubstitute{\theHTMLSection}{\detokenize{--}}{\detokenize{-}}[\theHTMLSection]% +\StrSubstitute{\theHTMLSection}% + {\detokenize{-----}}{\detokenize{-}}[\theHTMLSection]% +\StrSubstitute{\theHTMLSection}% + {\detokenize{----}}{\detokenize{-}}[\theHTMLSection]% +\StrSubstitute{\theHTMLSection}% + {\detokenize{---}}{\detokenize{-}}[\theHTMLSection]% +\StrSubstitute{\theHTMLSection}% + {\detokenize{--}}{\detokenize{-}}[\theHTMLSection]% % \end{macrocode} % % If starts with a dash, remove the leading dash: @@ -27574,9 +27708,18 @@ end -- not --version % % Not yet started any paragraph handling: % \begin{macrocode} +\global\booltrue{LWR@doingparhooks} \global\boolfalse{LWR@doingapar} \global\boolfalse{LWR@doingstartpars} % \end{macrocode} +% +% \cs{color@endgroup}'s \cs{endgraf} was conflicting with \pkg{lwarp}'s +% paragraph handling. +% \changes{v0.903}{2021/12/13}{Par handling.} +% \begin{macrocode} +\let\color@endgroup\endgroup +% \end{macrocode} +% % Document and page settings: % \changes{v0.45}{2017/12/08}{Fix: Lateximages on incorrect pages with \brand{Mathjax}.} % \begin{macrocode} @@ -27804,13 +27947,15 @@ end -- not --version % \end{macro} +% \DescribeHook[LaTeX]{enddocument/info} Used to close the \filenm{*-images.txt} file. % \begin{macro}{\enddocument} % If labels have not changed, mark successful completion % of the \filenm{lateximages.txt} file. % Executed as everything is being shut down. % -% For the newer kernel hooks, see \cmds{texdoc lthooks-doc} and \cmds{texdoc ltshipout-doc}. +% For the newer kernel hooks, see \cmds{texdoc lthooks-doc} +% and \cmds{texdoc ltshipout-doc}. % \changes{v0.70}{2019/03/26}{If labels changed, require recompile before making limages.} % \changes{v0.89}{2020/07/28}{Adapt to \LaTeX\ core changes.} % \begin{macrocode} @@ -27876,6 +28021,10 @@ end -- not --version % % See \cmds{texdoc lthooks-doc} and \cmds{textdoc ltshipout-doc}. % +% \DescribeHook[LaTeX]{shipoout/background} Nullified. +% +% \DescribeHook[LaTeX]{shipoout/foreground} Nullified. +% % \changes{v0.89}{2020/07/28}{Foreground/background hooks: Adapt to \LaTeX\ core changes.} % \begin{macrocode} \ifdef{\RemoveFromHook}{ @@ -28078,7 +28227,7 @@ end -- not --version } \AtBeginDocument{ -\@ifpackageloaded{titling}{ +\IfPackageLoadedTF{titling}{ \AtBeginEnvironment{titlingpage}{ \renewrobustcmd{\affiliation}[1]{\\ \textsc{\small#1}} } @@ -28297,7 +28446,7 @@ end -- not --version % % % \begin{macrocode} -\@ifclassloaded{memoir} +\IfClassLoadedTF{memoir} { \newcommand{\LWR@setfootnoteseries}{% \renewcommand\thefootnote{\@arabic\c@footnote}% @@ -28562,7 +28711,7 @@ end -- not --version % % \begin{macrocode} \newcommand*{\AddSubtitlePublished}{% -\@ifpackageloaded{titling}{% yes titling package +\IfPackageLoadedTF{titling}{% yes titling package \newcommand{\@published}{}% \newcommand{\published}[1]{\gdef\@published{##1}}% \renewcommand*{\maketitlehooka}{\printpublished}% @@ -28999,6 +29148,7 @@ end -- not --version % % \changes{v0.20}{2016/12/24}{Added.} % \changes{v0.84}{2020/04/16}{Added print mode.} +% \changes{v0.903}{2022/01/02}{Added \env{verbatim*}.} % % \begin{macrocode} \AfterEndPreamble{ @@ -29018,6 +29168,22 @@ end -- not --version \LWR@afterendverbatim% }% } +% +\AtBeginEnvironment{verbatim*}{% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@forcenewpage% + \LWR@atbeginverbatim{verbatim}% + }% +} +\AfterEndEnvironment{verbatim*}{% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@afterendverbatim% + }% +} } % \end{macrocode} % \end{environment} @@ -29031,8 +29197,10 @@ end -- not --version % \changes{v0.52}{2018/03/27}{Fix to allow inside \env{lateximage}.} % \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.} % \changes{v0.84}{2020/04/17}{Restore spacing.} +% \changes{v0.903}{2021/12/20}{Converted to env.} % \begin{macrocode} -\newcommand*{\LWR@HTML@tabbing}{% +\newenvironment*{LWR@HTML@tabbing} +{% \LWR@forcenewpage% \LWR@atbeginverbatim{tabbing}% \let\enskip\LWR@origenskip% @@ -29044,14 +29212,12 @@ end -- not --version \let\negthinspace\LWR@orignegthinspace% \LWR@print@tabbing% } - -\newcommand*{\LWR@HTML@endtabbing}{% - \LWR@print@endtabbing% +{% + \endLWR@print@tabbing% \LWR@afterendverbatim% } -\LWR@formatted{tabbing} -\LWR@formatted{endtabbing} +\LWR@formattedenv{tabbing} % \end{macrocode} % % \end{environment} @@ -29260,11 +29426,9 @@ end -- not --version \else % \if@inlabel % \indent - \par % \fi \ifhmode % \unskip\unskip - \par \fi \if@newlist \if@nobreak @@ -29361,12 +29525,15 @@ end -- not --version % leave room for the label while inside a list during paragraph construction. % % \changes{v0.44}{2017/11/15}{Added \env{list} and \env{trivlist}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@listitem}{% \LWR@stoppars% \LWR@startnewdepth{listitem}% \LWR@htmltag{li}% + \LWR@orignewline% \LWR@startpars% + \LWR@ensuredoingapar% \LWR@origitem% } % \end{macrocode} @@ -29432,12 +29599,15 @@ end -- not --version % % See \cs{LWR@openparagraph} where extra \cs{hspace} is used to % leave room for the label while inside a list during paragraph construction. +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@itemizeitem}{% \LWR@stoppars% \LWR@startnewdepth{listitem}% \LWR@htmltag{li}% + \LWR@orignewline% \LWR@startpars% + \LWR@ensuredoingapar% \LWR@origitem% } % \end{macrocode} @@ -29654,13 +29824,17 @@ end -- not --version % \end{macrocode} % \end{macro} -% \cs{futurelet} copies the next token then executes a function to analyze it. - -% \cs{LWR@futurenonspacelet} does the same, but ignores intervening white space - -% Based on the \pkg{booktabs} style: % \begin{macro}{\LWR@futurenonspacelet} +% +% \cs{futurelet} copies the next token then executes a function to analyze it. +% +% \cs{LWR@futurenonspacelet} does the same, but ignores intervening spaces +% and paragraphs. +% +% Based on the \pkg{booktabs} style: +% +% \changes{v0.903}{2021/10/13}{Now ignores \cs{par}.} % \begin{macrocode} \def\LWR@futurenonspacelet#1{\def\LWR@cs{#1}% \afterassignment\LWR@fnslone\let\nexttoken= } @@ -29668,19 +29842,30 @@ end -- not --version \def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo} \def\LWR@fnsltwo{% -\expandafter\ifx\LWR@cs\@sptoken\let\next=\LWR@fnslthree% -\else\let\next=\nexttoken\fi\next} + \expandafter\ifx\LWR@cs\@sptoken% + \let\next=\LWR@fnslthree% + \else% + \expandafter\ifx\LWR@cs\par% + \let\next=\LWR@fnslthree% + \else% + \let\next=\nexttoken% + \fi% + \fi\next} \def\LWR@fnslthree{\afterassignment\LWR@fnslone\let\next= } % \end{macrocode} % \end{macro} + % \begin{macro}{\LWR@getmynexttoken} % Looks ahead and copies the next token into \cs{LWR@mynexttoken}. % \begin{macrocode} \newcommand*{\LWR@getmynexttoken}{% \LWR@traceinfo{LWR@getmynexttoken}% -% nothing must follow this next line +% \end{macrocode} +% +% Nothing must follow this next line:\watchout +% \begin{macrocode} \LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag } % \end{macrocode} @@ -31776,11 +31961,10 @@ end -- not --version % left to right columns. % % \begin{macrocode} -\NewDocumentCommand{\LWR@docdashline} - {>{\SplitArgument{1}{-}}m}% - {% - \LWR@subcdashline#1% - } +\NewDocumentCommand{\LWR@docdashline}{>{\SplitArgument{1}{-}}m}% +{% + \LWR@subcdashline#1% +} % \end{macrocode} % \end{macro} @@ -31831,7 +32015,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@subaddcmidruletrim}[2]{% \setlength{\LWR@templengthone}{% - \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% + \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% }% \ifdimcomp{\LWR@templengthone}{>}{0pt}% {% @@ -32995,13 +33179,13 @@ end -- not --version {% \@xmultirow defined, so some version of multirow was loaded % \end{macrocode} % -% |\@ifpackageloaded{multirow}| determines if v2.0 or later of +% |\IfPackageLoadedTF{multirow}| determines if v2.0 or later of % \pkg{multirow} was used, which included the \cs{ProvidesPackage} macro. % % The print version: % \begin{macrocode} -\@ifpackageloaded{multirow}{% v2.0 or newer -\@ifpackagelater{multirow}{2016/09/01}% 2016/09/27 for v2.0 +\IfPackageLoadedTF{multirow}{% v2.0 or newer +\IfPackageAtLeastTF{multirow}{2016/09/01}% 2016/09/27 for v2.0 {% v2.0+: \DeclareExpandableDocumentCommand{\LWR@print@multicolumnrow}% {+m +m +O{c} +m +O{0} +m +O{0pt} +m}% @@ -33015,7 +33199,7 @@ end -- not --version }% packageloaded{multirow} % \end{macrocode} % -% If not |\@ifpackageloaded{multirow}| but \cs{@xmultirow} is defined, +% If not |\IfPackageLoadedTF{multirow}| but \cs{@xmultirow} is defined, % then this must be v1.6 or earlier, which did not |\ProvidesPackage{multirow}|, % and did not have the \optn{vposn} option. % @@ -33166,23 +33350,28 @@ end -- not --version {% \LWR@traceinfo{LWR@tabledatacolumntag}% % \end{macrocode} +% % \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for % \begin{macrocode} % \end{macrocode} +% % If not any of the below, start a new table cell: % \begin{macrocode} \global\let\LWR@mynextaction\LWR@tabledatasinglecolumntag% % \end{macrocode} +% % If exiting the tabular: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\end}% {\booltrue{LWR@exitingtabular}}{}% % \end{macrocode} +% % \env{longtable} can have a caption in a cell % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\caption}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % Look for other things which would not start a table cell: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\multicolumn}% @@ -33194,11 +33383,13 @@ end -- not --version \ifdefequal{\LWR@mynexttoken}{\noalign}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % If an \cs{mrowcell}, this is a cell to be skipped over: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\mrowcell}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % If an \cs{mcolrowcell}, this is a cell to be skipped over: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\mcolrowcell}% @@ -33298,11 +33489,14 @@ end -- not --version \ifdefequal{\LWR@mynexttoken}{\lasthdashline}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % Ignore an empty line between rows: % \changes{v0.45}{2017/12/06}{Fix: Empty line between rows.} % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\par}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + {% + \global\let\LWR@mynextaction\LWR@donothing% + }{}% % \end{macrocode} % % No action for an \cs{end} token. @@ -33312,9 +33506,8 @@ end -- not --version % % Start the new table cell if was not any of the above: % \begin{macrocode} - \LWR@traceinfo{LWR@tabledatacolumntag: about to do mynext}% + \LWR@traceinfo{LWR@tabledatacolumntag: done, about to do LWR@mynextaction}% \LWR@mynextaction% - \LWR@traceinfo{LWR@tabledatacolumntag: done}% } % \end{macrocode} % \end{macro} @@ -33423,7 +33616,7 @@ end -- not --version % \begin{macrocode} \AtBeginDocument{ -\@ifpackageloaded{lwarp-tabls} +\IfPackageLoadedTF{lwarp-tabls} { \newcommand*{\LWR@HTMLhline}[1][]{% \ifbool{FormatWP}% @@ -33563,16 +33756,28 @@ end -- not --version \boolfalse{LWR@foundmrowcell}% % \end{macrocode} % -% +% In case of nesting: % \begin{macrocode} \renewcommand*{\LWR@multicoltext}{}% + \booltrue{LWR@intabularmetadata}% +% \end{macrocode} +% +% New \PDF\ page, unless in a \cs{multirow}: +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} + \ifbool{LWR@in@multirow@par}% + {\leavevmode\LWR@orignewline}% + {\LWR@forcenewpage}% +% \end{macrocode} +% +% In case of nesting, locally no longer in a \cs{multirow}: +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} + \boolfalse{LWR@in@multirow@par}% % \end{macrocode} % % Create the |table| tag: % \begin{macrocode} - \booltrue{LWR@intabularmetadata}% - \LWR@traceinfo{LWR@@tabular: About to LWR@forecenewpage.}% - \LWR@forcenewpage \LWR@htmlblocktag{table}% % \end{macrocode} % Parse the table columns: @@ -34018,12 +34223,11 @@ end -- not --version % \begin{macro}{\LWR@nameref} \marg{label} % Returns the section name for this label: % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} -% \changes{v0.902}{2021/09/24}{Disable footnotes in \cs{nameref}.} +% \changes{v0.902}{2021/09/24}{Nullify footnotes in \cs{nameref}.} % \begin{macrocode} \newcommand*{\LWR@nameref}[1]{% \begingroup% - \renewcommand{\footnote}[2][]{}% - \renewcommand{\footnotemark}[1][]{}% + \LWR@nullifyfootnotes% \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@firstoffive{#1}% \endgroup% } @@ -34369,7 +34573,8 @@ end -- not --version % \end{macrocode} % \end{macro} -% \begin{macro}{\ref} * \marg{label} \quad +% \begin{macro}{\ref} * \marg{label} +% % \cs{ref} is redefined to \cs{LWR@HTML@ref}, % except inside the text part of a \cs{hyperref}, % where it is redefined to \cs{LWR@ref@ignorestar}. @@ -34400,16 +34605,76 @@ end -- not --version % \end{macrocode} % % -% \begin{macro}{\LWR@refwithsection} +% \begin{macro}{\LWR@refwithsection} * \marg{label} +% +% Creates a reference, using the section number as the text. +% Used for back references. +% % \changes{v0.896}{2021/04/21}{Added.} +% \changes{v0.903}{2021/12/13}{Fixed: Ref undefined or w/o label.} % \begin{macrocode} \NewDocumentCommand{\LWR@refwithsection}{s m}{% \LWR@traceinfo{LWR@refwithsection !#2!}% +% \end{macrocode} +% +% If starred, just use the text without a hyperlink: +% \begin{macrocode} \IfBooleanTF{#1}% {\LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}}% {% +% \end{macrocode} +% +% Open the reference: +% \begin{macrocode} \LWR@startref{#2}% - \LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}% +% \end{macrocode} +% +% Add the text of the link. +% +% Check for and handle an undefined reference: +% \begin{macrocode} + \edef\@tempa{\LWR@currentautosecpageref{#2}}% + \ifdefstring{\@tempa}{??}% + {??}% +% \end{macrocode} +% +% For a defined reference: +% \begin{macrocode} + {% +% \end{macrocode} +% +% Set \cs{@tempa} to \cs{r@