diff options
Diffstat (limited to 'macros')
60 files changed, 1873 insertions, 702 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index a0727bfa7d..93ca70813e 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}{2024/01/06}{2024C} +\ProvidesExplClass{easybook}{2024/01/07}{2024D} {Easily typesetting Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -223,12 +223,12 @@ \cs_generate_variant:Nn \eb_put_newtxmath:n { V } \str_case:VnF \l__eb_mathfont_value_tl { - { times } { \LoadPackage{newtxmath+bm} } + { times } { \RequirePackage{newtxmath,bm} } { none } { } } { \eb_put_newtxmath:V \l__eb_mathfont_value_tl - \LoadPackage{newtxmath+bm} + \RequirePackage{newtxmath,bm} } \ctex_set:n @@ -302,7 +302,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2024/01/06}{2024C} +\ProvidesExplPackage{easybase}{2024/01/07}{2024D} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -362,7 +362,7 @@ } \cs_new_protected:Npn \eb_if_package_loaded:nnF #1#2#3 { - \@ifpackageloaded{#1} + \IfPackageLoadedTF{#1} { \tl_if_blank:nTF {#2} { \msg_warning:nnn { easybase } { package-repeat-load-ii } {#1} } @@ -433,11 +433,11 @@ \PassOptionsToPackage{many}{tcolorbox} \ProcessKeysOptions{easybase} \PassOptionsToPackage{\g__eb_ctex_options_clist}{ctex} -\@ifclassloaded{ctexbook}{} +\IfClassLoadedTF{ctexbook}{} { - \@ifclassloaded{ctexart}{} + \IfClassLoadedTF{ctexart}{} { - \@ifclassloaded{ctexrep}{} + \IfClassLoadedTF{ctexrep}{} {\RequirePackage[heading]{ctex}} } } @@ -930,7 +930,7 @@ { \bool_if:NT \l__eb_fnpara_bottom_bool { - \@ifpackageloaded{footmisc} + \IfPackageLoadedTF{footmisc} {\msg_warning:nn { easybase } { bottom-not-compatible }} { \cs_set:Npn \@makecol @@ -1702,7 +1702,7 @@ }, caption-every .initial:n = \sffamily\small, footnote .tl_set:N = \l__eb_subfont_footnote_tl, - marginpar .tl_set:N = \l__eb_subfont_marginpar_tl, + marginpar .tl_set:N = \marginfont, marginpar .initial:n = \footnotesize, unknown .code:n = \eb_msg_deprecated_option:n { subfont } } @@ -1757,7 +1757,6 @@ unknown .code:n = \eb_msg_deprecated_option:n { spread } } -\tl_gset:Nn \marginfont { \l__eb_subfont_marginpar_tl } \eb_seq_map_inline:nn { table,figure,listing } { @@ -1927,7 +1926,7 @@ } \bool_if:NT \l__eb_theorem_support_bool { - \LoadPackage{amsthm+thmtools} + \RequirePackage{amsthm,thmtools} \eb_package_date_check:nn { thmtools } { 2020/08/01 } \cs_set_eq:NN \eb@declaretheorem@save \declaretheorem \cs_set_eq:NN \eb@declaretheoremsyle@save \declaretheoremstyle @@ -2029,7 +2028,7 @@ \cs_new_protected:Npn \eb_bibtex_natbib_set: { - \LoadPackage[sort&compress]{natbib} + \RequirePackage[sort&compress]{natbib} \str_case:VnTF \l__eb_bib_both_style_tl { { numerical } @@ -2084,7 +2083,7 @@ { \eb_put_biblatex:n { style = \l__eb_bib_both_style_tl } } \tl_if_blank:VF \l__eb_bib_cite_style_tl { \eb_put_biblatex:n { citestyle = \l__eb_bib_cite_style_tl } } - \LoadPackage[backend = biber]{biblatex} + \RequirePackage[backend = biber]{biblatex} \clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource \tl_gset:Nn \blx@default@theheading { bibintoc } \defbibheading{bibintoc}[\bibname]{\eb_biber_toc_title:n {##1}} @@ -2268,7 +2267,7 @@ } \ctex_at_end_preamble:n { - \LoadPackage{hyperref} + \RequirePackage{hyperref} \urlstyle{same} \eb_allow_url_break: \eb_put_hyperref:n @@ -2286,7 +2285,7 @@ { \AfterPreamble{\eb@labelformat@save{#1}{#2}} } \AtBeginDocument { - \@ifpackageloaded{cleveref}{} + \IfPackageLoadedTF{cleveref}{} { \labelformat{part}{\CTEXthepart} \labelformat{chapter}{\CTEXthechapter} @@ -2328,7 +2327,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/01/06}{2024C} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/01/07}{2024D} {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 Binary files differindex a163c9956c..4b1e8049c7 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index ed546c4946..e7fc2d4d8a 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -23,8 +23,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v2024C, - date = 2024/01/06, + version = v2024D, + date = 2024/01/07, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -234,12 +234,11 @@ cell{1}{3,4} = PaleTurquoise, cell{2}{5} = PaleTurquoise, cell{3}{2,4} = PaleTurquoise, - cell{5}{1} = PaleTurquoise, + cell{5}{1} = GreenYellow, cell{1}{2} = GreenYellow, - cell{3}{1,4} = GreenYellow, - cell{5}{2} = GreenYellow + cell{3}{1,4} = GreenYellow }{ - amsthm & bicaption & ctexbook & caption & chemformula \\ + amsthm & bicaption & ctex & caption & chemformula \\ enumitem & etoolbox & fancyhdr & geometry & hyperref \\ imakeidx & listings & marginnote & mathtools & multicol \\ pifont & pdfpages & siunitx & spbmark & thmtools \\ @@ -674,7 +673,7 @@ \command*{markboth}[\marg{左页标题标记}\marg{右页标题标记}]\default{} \command*{markright}[\marg{右页标题标记}]\default{} \command{markdouble}[\marg{双页标题标记}] - 这三个命令用于手动设置当前页标题标记,一般紧随标题命令,特殊情况下可以使用它们得到需要的页眉页脚内容。上述标记命令内容的选项便是基于这三个命令。其中 \cs{markdouble} 根据是否是双面打印设置相应标记。如果是单面打印,则 \meta{左页标题标记} 无效。 + 这三个命令用于手动设置当前页标题标记,特殊情况下可以使用它们定义与标题不同的页眉页脚标记。上述标记命令内容的选项便是基于这三个命令。其中 \cs{markdouble} 根据是否是双面打印设置相应标记。如果是单面打印,则 \meta{左页标题标记} 无效。 \end{commands} \begin{commands} @@ -832,7 +831,7 @@ \command{contentsuse}[\marg{条目名}\marg{扩展名}] 激活名称为 \meta{条目名} 的浮动环境目录定制功能,它使用的目录文件后缀为 \meta{扩展名}。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。 \command{DeclareFloatList}[\marg{条目名}\marg{扩展名}]\newtag% - 声明一个浮动环境题注的目录命令 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}},并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,推荐搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有符号 \textcolor{red}{\ding{73}} 表示在声明后可用。下面举一个声明算法目录的例子: + 声明一个浮动环境题注的目录命令 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}},并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,推荐搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有红色符号 \textcolor{red}{\ding{73}}(仍包含黑色符号选项的性质)表示在声明后可用。下面举一个声明算法环境和题注目录的例子: \begin{ctexexam} \usepackage{newfloat} \DeclareFloatingEnvironment[ @@ -1204,7 +1203,7 @@ \command{labelformat}[\marg{计数器}\marg{标签引用格式}] 标签格式命令 \cs{labelformat} 可以设置标签引用格式。\meta{标签引用格式} 中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。也可以使用 \pkg*{cleveref} 宏包提供更强大的标签功能。 \command{AtEndPreamble}[\marg{钩子代码}] - 导言区末尾的钩子命令。为了保证兼容性 \pkg*{hyperref} 宏包被设计在导言区末尾载入,一些情况下需要合适的钩子在 \pkg*{hyperref} 后方执行 \meta{钩子代码},例如载入 \pkg*{cleveref} 宏包。 + 导言区末尾的钩子命令。为了保证兼容性 \pkg*{hyperref} 宏包被设计在导言区末尾载入,一些情况下需要钩子命令在 \pkg*{hyperref} 宏包后方执行 \meta{钩子代码},例如载入 \pkg*{cleveref} 宏包。 \begin{ctexexam} \labelformat{chapter}{第#1章} \labelformat{chapter}{第\thechapter 章} @@ -1336,7 +1335,7 @@ \shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。} \shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。} \shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs*{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。} - \shortversion{v = 2024C,date = 2024/01/06,changes = 核对依赖宏包的更新改动,优化使用手册的内容细节。} + \shortversion{v = 2024D,date = 2024/01/07,changes = 核对依赖宏包的更新改动,优化使用手册的内容细节。} \end{changelog} \nocite{*} diff --git a/macros/latex/contrib/exsol/example-exercisebook.pdf b/macros/latex/contrib/exsol/example-exercisebook.pdf Binary files differnew file mode 100644 index 0000000000..e332ad06a3 --- /dev/null +++ b/macros/latex/contrib/exsol/example-exercisebook.pdf diff --git a/macros/latex/contrib/exsol/example-external.pdf b/macros/latex/contrib/exsol/example-external.pdf Binary files differnew file mode 100644 index 0000000000..767df3f446 --- /dev/null +++ b/macros/latex/contrib/exsol/example-external.pdf diff --git a/macros/latex/contrib/exsol/example-formulacollection.pdf b/macros/latex/contrib/exsol/example-formulacollection.pdf Binary files differindex 75730d35d5..965a4e2b3f 100644 --- a/macros/latex/contrib/exsol/example-formulacollection.pdf +++ b/macros/latex/contrib/exsol/example-formulacollection.pdf diff --git a/macros/latex/contrib/exsol/example-inline.pdf b/macros/latex/contrib/exsol/example-inline.pdf Binary files differnew file mode 100644 index 0000000000..1ea5fda2cb --- /dev/null +++ b/macros/latex/contrib/exsol/example-inline.pdf diff --git a/macros/latex/contrib/exsol/example-local.pdf b/macros/latex/contrib/exsol/example-local.pdf Binary files differindex ddb51bed26..009b07f672 100644 --- a/macros/latex/contrib/exsol/example-local.pdf +++ b/macros/latex/contrib/exsol/example-local.pdf diff --git a/macros/latex/contrib/exsol/example-solutionbook.pdf b/macros/latex/contrib/exsol/example-solutionbook.pdf Binary files differindex 58e8f1172d..6b4758989a 100644 --- a/macros/latex/contrib/exsol/example-solutionbook.pdf +++ b/macros/latex/contrib/exsol/example-solutionbook.pdf diff --git a/macros/latex/contrib/exsol/example.pdf b/macros/latex/contrib/exsol/example.pdf Binary files differindex c19b69c848..47225cc0b2 100644 --- a/macros/latex/contrib/exsol/example.pdf +++ b/macros/latex/contrib/exsol/example.pdf diff --git a/macros/latex/contrib/exsol/exsol.dtx b/macros/latex/contrib/exsol/exsol.dtx index abe450d0c7..7c2692e2fe 100644 --- a/macros/latex/contrib/exsol/exsol.dtx +++ b/macros/latex/contrib/exsol/exsol.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.be> +% Copyright (C) 2019 by Walter Daems <walter.daems@uantwerpen.be> % % This work may be distributed and/or modified under the conditions of % the LaTeX Project Public License, either version 1.3 of this license @@ -30,11 +30,12 @@ %<package|driver>\NeedsTeXFormat{LaTeX2e} %<driver>\ProvidesFile{exsol.dtx} %<package>\ProvidesPackage{exsol} -%<package|driver> [2018/10/23 v1.4 ExSol - Exercises and Solutions package (DMW)] +%<package|driver> [2024/01/07 v1.6 ExSol - Exercises and Solutions package (DMW)] %<*driver> \documentclass[10pt,a4paper]{ltxdoc} \usepackage[english]{babel} \usepackage[exercisesfontsize=small]{exsol} +\usepackage{booktabs} \usepackage{metalogo} \EnableCrossrefs \CodelineIndex @@ -48,8 +49,8 @@ \RecordChanges \newcommand{\exsol}{\textsc{ExSol}} \StopEventually{\PrintChanges\PrintIndex} -\def\fileversion{1.4} -\def\filedate{2018/10/23} +\def\fileversion{1.6} +\def\filedate{2024/01/07} \begin{document} \DocInput{exsol.dtx} \end{document} @@ -100,6 +101,9 @@ % \changes{v1.3}{2016/08/09}{\@ Correction of spacings and counters} % \changes{v1.4}{2018/10/23}{\@ Allowed for adding exerciseseries label in % solutionseries using option 'usesolutionserieslabels'} +% \changes{v1.5}{2019/01/02}{\@ Added inline and external mode} +% \changes{v1.6}{2024/01/07}{\@ Added check to see if babel was +% loaded, and issue appropriate error} % % \DoNotIndex{\newcommand,\newenvironment} % \setlength{\parindent}{0em} @@ -134,10 +138,31 @@ % into a simple document harness, such that when running \LaTeX{} on % the latter, you can generate a nice solution book. % +% In \emph{external mode} both the exercises and the solutions are +% written to secondary files that can be included in a simple document +% harness, such that when running \LaTeX{} on these, you can generate +% an exercise as well as a solution book. +% % In \emph{local mode} (invoked by specifying the package option 'local'), % this corresponds to inserting the saved solutions in the current % document at a later stage in the text. -% +% +% In \emph{inline mode} (invoked by specifying the package option +% 'inline'), the solutions are inserted 'on the spot'. +% +% This has been conveniently summarized in the table below: +% \begin{center} +% \begin{tabular}{ccc} +% \toprule +% \bf mode & \bf exercises & \bf solutions\\ +% \midrule +% global & on the spot & in separate document\\ +% external & in separate document & in separate document\\ +% local & on the spot & later in the same document\\ +% inline & on the spot & on the spot \\ +% \bottomrule +% \end{tabular} +% \end{center} % \subsection{Why use \exsol{}?} % \begin{itemize} % \item It allows to keep the \LaTeX{} source of your exercises and their @@ -203,9 +228,16 @@ % \subsubsection{Loading the package} % The macro package exsol can be loaded with: % \begin{verbatim} +% \usepackage{babel} % \usepackage{exsol} % \end{verbatim} % +% Note before we start that you need to load the babel package before +% you load the exsol package! This is to allow you to load the +% appropriate languages for your text. +% +% OK, now let's get started. +% % Your first choice to make is where you want your solutions to % appear. The primary objective of the exsol package was 'global % mode', i.e. separating your solutions from the exercises, @@ -218,7 +250,11 @@ % Gathering exercises in (numbered) series and 'loading' them locally % in your text, allows for simplifying the % individual exercise numbers (omitting their prefix containing, -% chapter number, section number, subsection number a.s.o.). +% chapter number, section number, subsection number a.s.o.). +% +% A third mode of operation is 'inline mode', in which the +% solution is inserted in the main text 'on the spot'. You can trigger +% this, by specifying the package option 'inline'. % % \subsubsection{Global mode - flat grouping exercises} % Adding exercises together with their solutions in your document is @@ -259,8 +295,7 @@ % series (e.g. according to their degree of difficulty). This can be % done by using the |exerciseseries| environment instead of the % |exercises| environment. -% This environment takes and also takes a -% mandatory label argument. +% This environment takes and also takes a mandatory label argument. % In addition it takes two optional arguments: % \begin{itemize} % \item |columns| to specify the amount of clumns @@ -311,7 +346,8 @@ % \end{exerciseseries} % \end{verbatim} % -% +% As an alternative, you can specify the 'inine' option to include +% the solutions on the spot where you specified them. % % \subsection{Examples} % @@ -319,7 +355,8 @@ % \label{examplesglobal} % Below, you can find an example of a file that contains a number of % exercises and solutions, with the goal to generate a separate -% solution book. +% solution book. Note that referencing exercises works just as you +% would expect it. % % \begin{Verbatim}[fontsize=\footnotesize] %<*example> @@ -356,9 +393,14 @@ equations. \end{equation} \end{informulacollection} +To make sure you master calculating the roots of second-order +equation, please solve exercise \ref{ex:1}. + + \begin{exercises}[columns = 2] \begin{exercise} + \label{ex:1} Solve the following equation for $x \in C$, with $C$ the set of complex numbers: \begin{equation} @@ -396,6 +438,7 @@ equations. The proposed values $x = x_1, x_2$ are solutions to the given equation. \end{solution} \begin{exercise} + \label{ex:2} Consider a 2-dimensional vector space equipped with a Euclidean distance function. Given a right-angled triangle, with the sides $A$ and $B$ adjacent to the right angle having lengths, $3$ and @@ -417,7 +460,8 @@ equations. Therefore, the length of the hypotenuse equals $5$. \end{solution} \end{exercises} -And now, we can come to conclusion. + +And now, we can come to the conclusion. \section{Conclusion} Solving second-order polynomial equations is very easy. \end{document} @@ -428,17 +472,140 @@ Solving second-order polynomial equations is very easy. % |example.pdf|. As you can see, the formulacollection entry and the % exercise appear. There's no trace of the solution. % -% When running \LaTeX{} on your document (e.g., the file example.tex -% as part of the exsol package, as a side effect files with the -% extension |.sol.tex| and |.fc.tex| have been written -% to disk (in our case, the files |example.sol.tex| and -% |example.fc.tex|), containing all solutions and entries for -% the formula collection in sequence. -% -% Generating a solution book is as simple as including the solution -% file into a simple \LaTeX{} harness, that allows you giving it a -% proper title page and to add other bells and whistles. -% This can be seen below: +% The solution can be recovered by including the |example.sol.tex| +% file in an appropriate harness. This is explained in +% section~\ref{harnesses}. +% +% \subsubsection{external mode} +% \label{examplesexternal} +% Below, you can find an example of a file that contains a number of +% exercises and solutions, with the goal to generate a separate +% exercise and solution book. +% +% \begin{Verbatim}[fontsize=\footnotesize] +%<*example-external> +\documentclass[a4paper,10pt]{article} + +\usepackage{a4wide} +\usepackage[english]{babel} +\usepackage[external]{exsol} + +\title{External example, from the \textsf{ExSol} package} +\author{Walter Daems} +\setlength{\parindent}{0em} +\begin{document} +\maketitle + +\section{Introduction} + +In this text we explain how to solve second-order polynomial +equations. + +\section{Solving second-order polynomial equations} + +\begin{informulacollectiononly} +\section*{Solving second-order polynomial equations} +\end{informulacollectiononly} +\begin{informulacollection} + The roots of the following equation + \begin{equation} + a x^2 + bx + c = 0 + \end{equation} + can be determined as: + \begin{equation} + x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a} + \end{equation} +\end{informulacollection} + +\begin{exercises}[columns = 2] + + \begin{exercise} + Solve the following equation for $x \in C$, with $C$ the set of + complex numbers: + \begin{equation} + 5 x^2 -3 x = 5 + \end{equation} + \end{exercise} + \begin{solution} + Let's start by rearranging the equation, a bit: + \begin{eqnarray} + 5.7 x^2 - 3.1 x &=& 5.3\\ + 5.7 x^2 - 3.1 x -5.3 &=& 0 + \end{eqnarray} + The equation is now in the standard form: + \begin{equation} + a x^2 + b x + c = 0 + \end{equation} + For quadratic equations in the standard form, we know that two + solutions exist: + \begin{equation} + x_{1,2} = \frac{ -b \pm \sqrt{d}}{2a} + \end{equation} + with + \begin{equation} + d = b^2 - 4 a c + \end{equation} + If we apply this to our case, we obtain: + \begin{equation} + d = (-3.1)^2 - 4 \cdot 5.7 \cdot (-5.3) = 130.45 + \end{equation} + and + \begin{eqnarray} + x_1 &=& \frac{3.1 + \sqrt{130.45}}{11.4} = 1.27\\ + x_2 &=& \frac{3.1 - \sqrt{130.45}}{11.4} = -0.73 + \end{eqnarray} + The proposed values $x = x_1, x_2$ are solutions to the given equation. + \end{solution} + \begin{exercise} + Consider a 2-dimensional vector space equipped with a Euclidean + distance function. Given a right-angled triangle, with the sides + $A$ and $B$ adjacent to the right angle having lengths, $3$ and + $4$, calculate the length of the hypotenuse, labeled $C$. + \end{exercise} + \begin{solution} + This calls for application of Pythagoras' theorem, which + tells us: + \begin{equation} + \left\|A\right\|^2 + \left\|B\right\|^2 = \left\|C\right\|^2 + \end{equation} + and therefore: + \begin{eqnarray} + \left\|C\right\| + &=& \sqrt{\left\|A\right\|^2 + \left\|B\right\|^2}\\ + &=& \sqrt{3^2 + 4^2}\\ + &=& \sqrt{25} = 5 + \end{eqnarray} + Therefore, the length of the hypotenuse equals $5$. + \end{solution} +\end{exercises} +And now, we can come to conclusion. + +\section{Conclusion} +Solving second-order polynomial equations is very easy. +\end{document} +%</example-external> +%\end{Verbatim} +% +% The result in the original document, can be seen in the file +% |example-external.pdf|. As you can see, only the formulacollection +% entry appears. There's no trace of the exercises or the solutions. +% +% \subsubsection{Harnesses} +% \label{harnesses} +% +% When running \LaTeX{} on your document in global or external mode +% (e.g., the file example-external.tex as part of the exsol package, +% as a side effect files with the +% extension |.sol.tex|, |.exc.tex| and/or |.fc.tex| have been written +% to disk (in our case, the files |example-external.sol.tex|, +% |example-external.exc.tex| and |example-external.fc.tex|), +% containing all exercises, solutions and entries for the formula +% collection in sequence. +% +% Generating an exercises/solution book is as simple as including the +% exercise/solution file into a simple \LaTeX{} harness, that allows +% you giving it a proper title page and to add other bells and whistles. +% As an example, you can find a harness for a solution book below. % % \begin{Verbatim}[fontsize=\footnotesize] %<*examplesol> @@ -464,11 +631,8 @@ Solving second-order polynomial equations is very easy. %</examplesol> % \end{Verbatim} % -% Generating a formula collection is as simple as including the -% formula collectoin file into a simple \LaTeX{} harness, that allows -% you giving it a proper title page and to add other bells and -% whistles. -% This can be seen below: +% Similar harnesses can be used for the exercise book and the formula +% collection. % % \begin{Verbatim}[fontsize=\footnotesize] %<*examplefor> @@ -494,6 +658,31 @@ Solving second-order polynomial equations is very easy. %</examplefor> % \end{Verbatim} % +% \begin{Verbatim}[fontsize=\footnotesize] +%<*exampleexc> +\documentclass[a4paper,10pt]{article} + +\usepackage{a4wide} +\usepackage[english]{babel} +\usepackage{exsol} + +\setlength{\parindent}{0em} + +\title{Exercise book, specified in the example-external of the + \textsf{ExSol} package} +\author{Walter Daems} + +\begin{document} + +\maketitle + +\input{example-external.exc.tex} + +\end{document} +%</exampleexc> +% \end{Verbatim} +% +% % \subsubsection{Local mode} % % Below, you can find an example of a file that contains a number of @@ -596,6 +785,103 @@ Solving second-order polynomial equations is very easy. %</example-local> % \end{Verbatim} % +% +% \subsubsection{Inline mode} +% +% Below, you can find an example of a file that contains a number of +% exercises and solutions, with the goal to include the solutions on +% the spot. +% +% +% \begin{Verbatim}[fontsize=\footnotesize] +%<*example-inline> +\documentclass[11pt,a4paper]{article} + +\usepackage[german]{babel} +\usepackage[inline,usesolutionserieslabels]{exsol} +\usepackage{enumitem} + +\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt} +\setlength{\exsolexerciseleftmargin}{2em} +\setlength{\exsolexerciserightmargin}{1em} +\setlength{\exsolexerciseparindent}{0em} +\setlength{\exsolexerciselabelsep}{1ex} +\setlength{\exsolexerciselabelwidth}{30pt} +\setlength{\exsolexerciseitemindent}{0pt} +\setlength{\exsolexerciseparsep}{\parskip} + +\title{Local inline example, from the \textsf{ExSol} package} +\author{Philippe Marti} +\setlength{\parindent}{0em} +\begin{document} +\maketitle + +\section{Gleichungssysteme und Geraden} + +Ein bisschen Theorie\ldots + +\begin{exerciseseries}[solsubrule=\hrule]{Gleichungssysteme} + \begin{exercise} + Die Summe zweier Zahlen ist 17 und ihre Differenz 7. Bestimme die + beiden Zahlen! + \end{exercise} + \begin{solution} + 5 und 12 + \end{solution} + + \begin{exercise} + Die Differenz einer Zahl und dem Dreifachen einer zweiten Zahl ist + 14. Bestimme die beiden Zahlen, falls die zweite Zahl ein Zehntel + der ersten ist. + \end{exercise} + \begin{solution} + 20 und 2 + \end{solution} +\end{exerciseseries} +~\\ +Etwas mehr Theorie\ldots + +\begin{exerciseseries}{Geraden} + \begin{exercise} + Berechne den Schnittpunkt von \mbox{$y=3x+1$} und \mbox{$y=3x-7$}. + \end{exercise} + \begin{solution} + Es gibt keinen Schnittpunkt + \end{solution} + + \begin{exercise} + Die Familie Meier fordert Offerten f\"ur eine Heizungsreparatur + ein. Firma A berechnet f\"ur die Fahrtkosten Fr. 42.- und f\"ur + jede Arbeitsstunde 76.-. Bei der Firma B sind die Fahrtkosten + Fr. 35.- und jede Arbeitsstunde wird mit Fr. 80.- berechnet. + \begin{enumerate}[label=\alph*)] + \item Welche Kosten entstehen f\"ur beide Firmen, wenn ein Monteur + 3.5 Stunden + f\"ur die Arbeit benötigt? Welche Firma ist in diesem Fall + kostengünstiger? + + \item Wie lauten die Gleichungen derjenigen zwei linearen + Funktionen, die jeder Arbeitszeit $x$ (in Stunden) die + entstehenden Kosten $y$ (in Franken) zuordnet? + + \item Berechne, bei welcher Arbeitszeit die Kosten bei beiden + Firmen gleich sind. + \end{enumerate} + \end{exercise} + \begin{solution} + \begin{enumerate}[label=\alph*)] + \item Firma A: 308.- $|$ Firma B: 315.- + \item A: $y=76x+42$ $|$ B: $y=80x+35$ + \item Bei $1\frac{3}{4}$ Stunden + \end{enumerate} + \end{solution} +\end{exerciseseries} + +\end{document} +%</example-inline> +% \end{Verbatim} +% +% % \subsection{Fiddling with the spacing} % % The default spacing provided by the \textsf{ExSol} package should be @@ -699,6 +985,8 @@ Solving second-order polynomial equations is very easy. \RequirePackage{kvoptions} \RequirePackage{multicol} \RequirePackage{varwidth} +\@ifpackageloaded{babel}{\typeout{Good: you loaded babel first!}}{\PackageError{exsol}{You forgot to load the + babel package before exsol}{}} % \end{macrocode} % % \subsection{Package options} @@ -716,6 +1004,26 @@ Solving second-order polynomial equations is very easy. % \end{macrocode} % \end{macro} % +% \changes{v1.5}{2019/01/02}{Added option external} +% \begin{macro}{external} +% This boolean option (true, false) allows setting the mode of the +% package into external, i.e. that the both exercises and solutions +% will be written to separate files. +% \begin{macrocode} +\DeclareBoolOption[false]{external} +% \end{macrocode} +% \end{macro} +% +% \changes{v1.5}{2019/01/02}{Added option inline} +% \begin{macro}{inline} +% This boolean option (true, false) allows setting the mode of the +% package into inline, i.e. that the solutions will be included 'on +% the spot'. +% \begin{macrocode} +\DeclareBoolOption[false]{inline} +% \end{macrocode} +% \end{macro} +% % \changes{v1.2}{2016/05/05}{Added option nolabels} % \begin{macro}{nolabels} % This boolean option (true, false) allows suppressing the 'Exercise' @@ -845,8 +1153,14 @@ Solving second-order polynomial equations is very easy. \typeout{Writing solutions to solution file \jobname.sol.tex} \newwrite\solutionstream \immediate\openout\solutionstream=\jobname.sol.tex + \ifexsol@external + \typeout{Writing exercises to exercise file \jobname.exc.tex} + \newwrite\exercisestream + \immediate\openout\exercisestream=\jobname.exc.tex + \else \typeout{Using intermediate exercise file \jobname.exc.tex} \newwrite\exercisestream + \fi \typeout{Writing formulae to formula collection file \jobname.fc.tex} \newwrite\formulacollectionstream \immediate\openout\formulacollectionstream=\jobname.fc.tex @@ -953,7 +1267,9 @@ Solving second-order polynomial equations is very easy. \def\exercise{\FV@Environment{}{exercise}} \def\FVB@exercise{% \refstepcounter{exercise}% + \ifexsol@external\else \immediate\openout\exercisestream=\jobname.exc.tex + \fi \ifexsol@local % \immediate\write\solutionstream{} \else @@ -961,8 +1277,6 @@ Solving second-order polynomial equations is very easy. % \string\quad\string\newline} \fi \ifexsol@copyexercisesinsolutions - % WDSC tofix - % \typeout{Writing exercise to \jobname.sol.tex} \immediate\write\solutionstream{\string\begin{exsol@exercise}{\theexercise}} \fi \immediate\write\exercisestream{\string\begin{exsol@exercise}{\theexercise}} @@ -988,8 +1302,10 @@ Solving second-order polynomial equations is very easy. \ifexsol@copyexercisesinsolutions \immediate\write\solutionstream{\string\end{exsol@exercise}} \fi + \ifexsol@external\else \immediate\closeout\exercisestream \input{\jobname.exc.tex} + \fi } \DefineVerbatimEnvironment{exercise}{exercise}{} % \end{macrocode} @@ -1050,12 +1366,22 @@ Solving second-order polynomial equations is very easy. % \begin{macrocode} \def\solution{\FV@Environment{}{solution}} \def\FVB@solution{% - %\typeout{Writing solution to \jobname.sol.tex} + % \typeout{Writing solution to \jobname.sol.tex} + % WDSC \ifexsol@copyexercisesinsolutions - \immediate\write\solutionstream{\string\begin{exsol@solution}{}} + \immediate\write\solutionstream{\string\begin{exsol@solution}{}} \else - \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}} + \ifexsol@inline + \immediate\write\solutionstream{\string\begin{exsol@solution}{}} + \else + \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}} + \fi \fi + % \ifexsol@copyexercisesinsolutions + % \immediate\write\solutionstream{\string\begin{exsol@solution}{}} + % \else + % \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}} + % \fi \@bsphack \begingroup \FV@UseKeyValues @@ -1071,6 +1397,11 @@ Solving second-order polynomial equations is very easy. \def\FVE@solution{ \endgroup\@esphack \immediate\write\solutionstream{\string\end{exsol@solution}} + \ifexsol@inline + \immediate\closeout\solutionstream + \input{\jobname.sol.tex} + \immediate\openout\solutionstream=\jobname.sol.tex + \fi } \DefineVerbatimEnvironment{solution}{solution}{} % \end{macrocode} @@ -1163,13 +1494,17 @@ Solving second-order polynomial equations is very easy. \setkeys{exerciseseries}{#1}% \paragraph{\seriesname~\theexerciseseries:~#2}~\par \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{} + \ifexsol@inline\else \immediate\write\solutionstream{\string\begin\string{solutionseries\string}% \string[#1\string]\string{#2\string}\string{\theexerciseseries\string}} - } - { - \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax - \exsubrule\par + \fi +} +{ + \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax + \exsubrule\par + \ifexsol@inline\else \immediate\write\solutionstream{\string\end\string{solutionseries\string}} + \fi } % \end{macrocode} % \end{macro} @@ -1335,6 +1670,8 @@ Solving second-order polynomial equations is very easy. % \changes{v1.3}{2016/08/09}{Corrected counter in solutionstream} % \changes{v1.3}{2016/08/09}{Added macro to suppress chapter in % solution stream} +% \changes{v1.5}{2019/01/02}{Added writing the sectioning code to the +% exercise stream in external mode} % \begin{macrocode} \newif\ifnoexinchapter \noexinchapterfalse @@ -1349,6 +1686,10 @@ Solving second-order polynomial equations is very easy. \addtocounter{chapter}{-1} \immediate\write\solutionstream{\string\setcounter{chapter}{\arabic{chapter}}% \string\chapter{#1}}% + \ifexsol@external + \immediate\write\exercisestream{\string\setcounter{chapter}{\arabic{chapter}}% + \string\chapter{#1}}% + \fi \addtocounter{chapter}{1} \fi } @@ -1356,6 +1697,9 @@ Solving second-order polynomial equations is very easy. \let\exsol@@frontmatter\frontmatter \def\frontmatter{% \immediate\write\solutionstream{\string\frontmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\frontmatter}% + \fi% \exsol@@frontmatter } \fi @@ -1363,6 +1707,9 @@ Solving second-order polynomial equations is very easy. \let\exsol@@mainmatter\mainmatter \def\mainmatter{% \immediate\write\solutionstream{\string\mainmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\mainmatter}% + \fi% \exsol@@mainmatter } \fi @@ -1370,6 +1717,9 @@ Solving second-order polynomial equations is very easy. \let\exsol@@backmatter\backmatter \def\backmatter{% \immediate\write\solutionstream{\string\backmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\backmatter}% + \fi% \exsol@@backmatter } \fi @@ -1377,6 +1727,9 @@ Solving second-order polynomial equations is very easy. \let\exsol@@appendix\appendix \def\appendix{% \immediate\write\solutionstream{\string\appendix}% + \ifexsol@external% + \immediate\write\exercisestream{\string\appendix}% + \fi% \exsol@@appendix } \fi @@ -1403,6 +1756,9 @@ Solving second-order polynomial equations is very easy. \newcommand{\noexercisesinchapter} { \immediate\write\solutionstream{No exercises in this chapter} + \ifexsol@external% + \immediate\write\exercisestream{No exercises in this chapter}% + \fi% } % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/exsol/exsol.ins b/macros/latex/contrib/exsol/exsol.ins index 4a96cb05e0..f5967d7191 100644 --- a/macros/latex/contrib/exsol/exsol.ins +++ b/macros/latex/contrib/exsol/exsol.ins @@ -1,4 +1,4 @@ -%% Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.be> +%% Copyright (C) 2019 by Walter Daems <walter.daems@uantwerpen.be> %% %% This work may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -27,7 +27,7 @@ This is a generated file. -Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.org> +Copyright (C) 2019 by Walter Daems <walter.daems@uantwerpen.org> This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license @@ -46,7 +46,10 @@ and version 1.3 or later is part of all distributions of LaTeX version \generate{\file{example.tex}{\from{exsol.dtx}{example}}} \generate{\file{example-solutionbook.tex}{\from{exsol.dtx}{examplesol}}} \generate{\file{example-formulacollection.tex}{\from{exsol.dtx}{examplefor}}} +\generate{\file{example-exercisebook.tex}{\from{exsol.dtx}{exampleexc}}} \generate{\file{example-local.tex}{\from{exsol.dtx}{example-local}}} +\generate{\file{example-inline.tex}{\from{exsol.dtx}{example-inline}}} +\generate{\file{example-external.tex}{\from{exsol.dtx}{example-external}}} \obeyspaces diff --git a/macros/latex/contrib/exsol/exsol.pdf b/macros/latex/contrib/exsol/exsol.pdf Binary files differindex 0fd252d117..db7e94c546 100644 --- a/macros/latex/contrib/exsol/exsol.pdf +++ b/macros/latex/contrib/exsol/exsol.pdf diff --git a/macros/latex/contrib/exsol/manifest.txt b/macros/latex/contrib/exsol/manifest.txt index 988ba6170f..dd199abe58 100644 --- a/macros/latex/contrib/exsol/manifest.txt +++ b/macros/latex/contrib/exsol/manifest.txt @@ -1,13 +1,16 @@ -. +[ 4096] . [ 1644] README -[ 320] manifest.txt +[ 443] manifest.txt [ 403] LICENSE -[ 288497] exsol.pdf -[ 2325] exsol.ins -[ 48772] exsol.dtx -[ 102060] example-solutionbook.pdf -[ 101326] example.pdf -[ 95452] example-local.pdf -[ 86274] example-formulacollection.pdf +[ 227438] exsol.pdf +[ 2547] exsol.ins +[ 59594] exsol.dtx +[ 69744] example-solutionbook.pdf +[ 61820] example.pdf +[ 55624] example-local.pdf +[ 56960] example-inline.pdf +[ 55413] example-formulacollection.pdf +[ 58600] example-external.pdf +[ 48449] example-exercisebook.pdf -0 directories, 10 files +1 directory, 13 files diff --git a/macros/latex/contrib/isphysicalmath/README.md b/macros/latex/contrib/isphysicalmath/README.md index af03bf862f..f4b21a8e31 100644 --- a/macros/latex/contrib/isphysicalmath/README.md +++ b/macros/latex/contrib/isphysicalmath/README.md @@ -5,7 +5,7 @@ Author: Mario Fantini, <marfant7@gmail.com> License: LaTeX Project Public License lppl -Copyright (c) 2023 Mario Fantini +Copyright (c) 2024 Mario Fantini --- @@ -18,15 +18,15 @@ If you are interested in the form of math and physics, here comes `isphysicalmat as far as international scientific notation and formatting of formulas, quantities, numerical values, factors, dimensions, measurement units. -So, `isphysicalmath` package helps user to write mathematical and physical contents, - according to the scientific notation (international mainly), in an elegant way. +So, isphysicalmath` package helps user to write mathematical and physical contents, +according to the scientific notation (international mainly), in an elegant way. # Dependencies -`isphysicalmath` has not dependencies. +`isphysicalmath` has xstring package dependency. -Internally, it uses standard commands like: \textnormal, \hspace{}; however, +Internally, it uses standard commands like: \textnormal, \hspace{}, \,; however, it performs its activity in complex math environment too. @@ -54,6 +54,8 @@ The documentation is `isphysicalmath-doc.pdf` mainly. It contains: - option 'comma' + - command 'comma' + - isphysicalmath url - Copyright @@ -61,22 +63,6 @@ The documentation is `isphysicalmath-doc.pdf` mainly. It contains: - Change History -# Build isphysicalmath.sty -``` -cd isphysicalmath -latex isphysicalmath.ins -``` - -# Build the documentation - -``` -cd isphysicalmath -latex isphysicalmath.dtx -makeindex -s gglo.ist -o isphysicalmath.gls isphysicalmath.glo -latex isphysicalmath.dtx -dvipdf isphysicalmath.dvi -``` - # Credits Thanks to all TeX/LaTeX contributors, in particular to Scott Pakin @@ -86,12 +72,16 @@ and services. # URL -Package home URL: https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath +Package home URL: + +https://ctan.org/pkg/isphysicalmath + +https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath # License -Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license @@ -111,3 +101,14 @@ This work consists of the files isphysicalmath.dtx and isphysicalmath.ins and the derived file isphysicalmath.sty. +# Change History + +- v1.0.0 + +2023.09.18 First version. + + +- v1.1.0 + +2024.01.03 improvements have been brought, see isphysicalmath-doc.pdf. + diff --git a/macros/latex/contrib/isphysicalmath/isphysicalmath-doc.pdf b/macros/latex/contrib/isphysicalmath/isphysicalmath-doc.pdf Binary files differindex d69e59aec5..ef449a6d1d 100644 --- a/macros/latex/contrib/isphysicalmath/isphysicalmath-doc.pdf +++ b/macros/latex/contrib/isphysicalmath/isphysicalmath-doc.pdf diff --git a/macros/latex/contrib/isphysicalmath/isphysicalmath.dtx b/macros/latex/contrib/isphysicalmath/isphysicalmath.dtx index a95d88e661..48dad58b76 100644 --- a/macros/latex/contrib/isphysicalmath/isphysicalmath.dtx +++ b/macros/latex/contrib/isphysicalmath/isphysicalmath.dtx @@ -29,31 +29,156 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] %<package>\ProvidesPackage{isphysicalmath} %<*package> -[2023/09/18 v1.0.0 .dtx isphysicalmath file] +[2024/01/03 v1.1.0 .dtx isphysicalmath file] %</package> -%<package>% option [dc]: changes dots in commas. +%<package>\RequirePackage{xstring} +%<package>% +%<package>% Notation section: +%<package>% option [dc]: changes dots in commas (\ispmc), or commas in dots (\ispmrc). %<package>\DeclareOption{dc}{ -%<package>\def\ispmdc#1.#2{{#1,#2}} +%<package>\def\ispmc#1.#2{{#1,#2}} +%<package>\def\ispmrc#1,#2{{#1.#2}} %<package>} -%<package>% option [comma]: scientific international notation for thousands. +%<package>% +%<package>% option [comma]: scientific international notation for thousands and their multiples. %<package>\DeclareOption{comma}{ -%<package> \def\ispmnovem#1#2#3#4#5#6#7#8#9{#1#2#3,#4#5#6,#7#8#9} -%<package> \def\ispmocto#1#2#3#4#5#6#7#8{#1#2,#3#4#5,#6#7#8} -%<package> \def\ispmseptem#1#2#3#4#5#6#7{#1,#2#3#4,#5#6#7} -%<package> \def\ispmsex#1#2#3#4#5#6{#1#2#3,#4#5#6} -%<package> \def\ispmquinque#1#2#3#4#5{#1#2,#3#4#5} -%<package> \def\ispmquattuor#1#2#3#4{#1,#2#3#4} +%<package>\def\ispmc#1{% +%<package>\StrLen{#1}[\temp]% +%<package>\ifnum\temp=4% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\unoq,\dueq\treq\quattroq% +%<package>\fi% +%<package>\ifnum\temp=5% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq% +%<package>\fi% +%<package>\ifnum\temp=6% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq% +%<package>\fi% +%<package>\ifnum\temp=7% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +%<package>\fi% +%<package>\ifnum\temp=8% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +%<package>\fi% +%<package>\ifnum\temp=9% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\StrChar{#1}{9}[\noveq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +%<package>\fi% +%<package>} %<package>} %<package>\ExecuteOptions{dc} %<package>\ExecuteOptions{comma} %<package>\ProcessOptions\relax -%<package>% space between value and measurement unit -%<package>\newcommand{\ispms}{\hspace{0.5mm}} +%<package>% +%<package>% command \ispmcomma: scientific international notation for thousands and their multiples. +%<package>\newcommand{\ispmcomma}[1]{% +%<package>\StrLen{#1}[\temp]% +%<package>\ifnum\temp=4% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\unoq,\dueq\treq\quattroq% +%<package>\fi% +%<package>\ifnum\temp=5% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq% +%<package>\fi% +%<package>\ifnum\temp=6% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq% +%<package>\fi% +%<package>\ifnum\temp=7% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\unoq,\dueq\treq\quattroq,\cinqueq\seiq\setteq% +%<package>\fi% +%<package>\ifnum\temp=8% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\unoq\dueq,\treq\quattroq\cinqueq,\seiq\setteq\ottoq% +%<package>\fi% +%<package>\ifnum\temp=9% +%<package>\StrChar{#1}{1}[\unoq]% +%<package>\StrChar{#1}{2}[\dueq]% +%<package>\StrChar{#1}{3}[\treq]% +%<package>\StrChar{#1}{4}[\quattroq]% +%<package>\StrChar{#1}{5}[\cinqueq]% +%<package>\StrChar{#1}{6}[\seiq]% +%<package>\StrChar{#1}{7}[\setteq]% +%<package>\StrChar{#1}{8}[\ottoq]% +%<package>\StrChar{#1}{9}[\noveq]% +%<package>\unoq\dueq\treq,\quattroq\cinqueq\seiq,\setteq\ottoq\noveq% +%<package>\fi% +%<package>} +%<package>% +%<package>% +%<package>% Formatting section: +%<package>% a small space between value and measurement unit +%<package>\newcommand{\ispms}{\,} %<package>% normal text rendering for first measurement unit %<package>\newcommand{\ispmntone}[1]{\textnormal{#1}} -%<package>% jolly: the default setting is --- normal text rendering for a generic 'entity'. +%<package>% jolly: the default setting consists in --- a $0.15\ispmone{mm}$ of space +%<package>% and normal text rendering for a generic 'entity'. %<package>% If you are a developer, you can modify it when and how you want. -%<package>\newcommand{\ispm}[1]{\textnormal{#1}} +%<package>\newcommand{\ispm}[1]{\hspace{0.15mm}\textnormal{#1}} %<package>% normal text rendering for first and second measurement units %<package>\newcommand{\ispmnttwo}[2]{\textnormal{#1}\textnormal{#2}} %<package>% space between first and second measurement units @@ -64,14 +189,21 @@ %<package>% \ispm if you have two measurement units %<package>% e.g. $L = 20 \ispmtwo{N}{m}$ %<package>\newcommand{\ispmtwo}[2]{\ispms\ispmnttwo\ispmss{#1}\ispmnttwo\ispmss{#2}} -%<package>% normal text rendering for third measurement unit -%<package>\newcommand{\ispmntr}[1]{\textnormal{#1}} %<package>% ispm if you have three measurement units %<package>% e.g. $V = 8 \ispmtwo{m}{m}\ispmthird{m}$ -%<package>\newcommand{\ispmthird}[1]{\ispmss\ispmntr{#1}} +%<package>\newcommand{\ispmthird}[1]{\ispmss\ispm{#1}} +%<package>% and so on until ninth measurement unit +%<package>\newcommand{\ispmfourth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmfifth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmsixth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmseventh}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmeighth}[1]{\ispmss\ispm{#1}} +%<package>\newcommand{\ispmninth}[1]{\ispmss\ispm{#1}} +%<package>% If you don't want numerical order, you could use generic \ispmn command +%<package>\newcommand{\ispmn}[1]{\ispmss\ispm{#1}} %<*driver> \documentclass{ltxdoc} -\usepackage{isphysicalmath}[2023/09/18] +\usepackage{isphysicalmath}[2024/01/03] \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} @@ -83,13 +215,10 @@ \renewcommand*\contentsname{General index}% \tableofcontents% \clearpage} - \EnableCrossrefs \CodelineIndex -\RecordChanges \begin{document} - \DocInput{isphysicalmath.dtx} - \PrintChanges +\DocInput{isphysicalmath.dtx} \end{document} %</driver> % \fi @@ -110,10 +239,6 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% -% -%\changes{v1.0.0}{2023/09/18}{Initial version} -% %\indice % %\GetFileInfo{isphysicalmath.dtx} @@ -152,19 +277,20 @@ %\textsl{isphysicalmath} acting is valid too. % %\section{Dependencies} -% \textsl{isphysicalmath} has not dependencies. +%\label{sec:dependencies} +%\textsl{isphysicalmath} has \textsl{xstring} package dependency. % %Internally, it uses standard \LaTeX{} built-in commands like: \texttt{\textbackslash textnormal}, -%\texttt{\textbackslash hspace\{\}}; +%\texttt{\textbackslash hspace\{\}}, \texttt{\textbackslash ,}; % however, it performs its activity in complex math environment too. %\newpage %\section{Usage} -% +%\label{sec:usage} %\DescribeMacro{\ispm} % -%\textit{hp.} It is a jolly command. The default setting substitutes the famous -% \LaTeX{} built-in command \texttt{\textbackslash textnormal}, in other words -% \texttt{\textbackslash textnormal} is the value of \texttt{\textbackslash ispm} +%\textit{hp.} It is a jolly command. +%The default setting consists in --- a $0.15\ispmone{mm}$ of space and normal text rendering for a generic 'entity'. +%In other words <\texttt{\textbackslash textnormal}> and <0.15mm> are the values of \texttt{\textbackslash ispm} % variable. So, if you are a developer you can modify this variable how and when you want. % I use it for generic ``entities''. \\ %\textit{th.} Default setting: normal text rendering for a generic ``entity''.\\ @@ -202,33 +328,59 @@ %|\ispmone|\marg{the second %measurement unit in place of the II argument (denominator)} %|\ispmthird|\marg{third measurement unit in place of III argument} \\ \\ % +%\DescribeMacro{ ~\ } And so on until ninth measurement unit, having: \\ +%\DescribeMacro{\ispmfourth}\\ +%\DescribeMacro{\ispmfifth} \\ +%\DescribeMacro{\ispmsixth}\\ +%\DescribeMacro{\ispmseventh} \\ +%\DescribeMacro{\ispmeighth} \\ +%\DescribeMacro{\ispmninth} ~\ \\ \\ +%\DescribeMacro{\ispmn} +% +%If you don't want to follow a numerical order, you can use this command. +% +%\textit{hp.} You have three measurement units. \\ +%\textit{th.} Horizontal space between the first measurement unit +%and numerical value, horizontal space between the first +%measurement unit and the second %measurement unit, horizontal space between +%the second measurement unit and third measurement unit; normal text +%rendering for all the measurement units.\\ +%|\ispmtwo|\marg{the first measurement unit in place of the I argument}\marg{the second +%measurement unit in place of the II argument}% +%|\ispmn|\marg{third measurement unit in place of III argument} \\ +% Or, e.g. if you have a fraction [see In-depth formatting' +%(\autoref{subsec:inDepthFormatting})]:\\ +%|\ispmone|\marg{the first measurement unit in place of the I argument (numerator)} +%|\ispmn|\marg{the second %measurement unit in place of the II argument (denominator)} +%|\ispmn|\marg{third measurement unit in place of III argument} \\ \\ +% +% %\begin{environment}{dc} % option \textit{dc} \\ %\textbackslash usepackage\oarg{dc}\{isphysicalmath\} \\ % -%$\forall x,y, \ldots \in \mathbb{N}$:\\ -%|\ispmdc| \meta{x.y} \\ +%$\forall x,y,\ldots,+\infty \in \mathbb{N}$:\\ +%|\ispmc| \meta{x.y} \\ +%|\ispmrc| \meta{x,y} \\ %\end{environment} % %\begin{environment}{comma} % option \textit{comma} \\ %\textbackslash usepackage\oarg{comma}\{isphysicalmath\} \\ % -%$\forall a,b,c,d,e,f,g,h,i \in \mathbb{N}$: \\ -%|\ispmnovem| \meta{abcdefghi} \\ -%|\ispmocto| \meta{abcdefgh} \\ -%|\ispmseptem| \meta{abcdefg} \\ -%|\ispmsex| \meta{abcdef} \\ -%|\ispmquinque| \meta{abcde} \\ -%|\ispmquattuor| \meta{abcd} \\ +%$\forall a,b,c,d,e,f,g,h,i \in \mathbb{N}$ [0,9]: \\ +%|\ispmc|\{abcdefghi\} \\ +%|\ispmc|\{abcdefghi\}.aa \\ %\end{environment} %\newpage % \section{In-depth usage} %\subsection{In-depth formatting} %\label{subsec:inDepthFormatting} +% \textsl{isphysicalmath} command, in mathematical environments, can be joined or detached to previous term; +%while, in not mathematical environments, \textsl{isphysicalmath} command must be joined to previous term. \\ \\ % \textsl{isphysicalmath} automatical settings: % \begin{itemize} -% \item 0.5\ispmone{mm} between numerical value and first +% \item a small space between numerical value and first % measurement unit, <<first>> if there are others. % \item 0.15\ispmone{mm} between two or three % measurement units, or between measurement units and their factors. @@ -261,6 +413,7 @@ % \item With one measurement unit. % % \[F = 1 \ispmone{N}\] +% \[P = 1 \ispmone{bar}\] % % The code: %\begin{center} @@ -268,6 +421,7 @@ %\[ %F = 1 \ispmone{N} %\] +%\[P = 1 \ispmone{bar}\] %\end{verbatim} %\end{center} % @@ -378,49 +532,86 @@ %\end{verbatim} %\end{center} % +%\item With inner mathematical environments (e). +% +%\[ +%P_p = (V_{cls})(\gamma_{cls}) = (29.6\ispmone{m$^3$})\Big(25\frac{\ispmone{kN}}{\ispmone{m$^3$}}\Big) = 740 \ispmone{kN} +%\] +% +%The code: +%\begin{center} +%\begin{verbatim} +%\[ +%P_p = (V_{cls})(\gamma_{cls}) = (29.6\ispmone{m$^3$}) +%\Big(25\frac{\ispmone{kN}} +%{\ispmone{m$^3$}}\Big) = 740 \ispmone{kN} +%\] +%\end{verbatim} +%\end{center} +% %\item About physical quantities dimensions. % %e.g. %\[ -%F = m a = \ispmtwo{[M]}{[L]}\ispmthird{[T$^{-2}$]} +%F = m a \equiv \ispmtwo{[M]}{[L]}\ispmthird{[T]$^{-2}$} %\] %The code: %\begin{center} %\begin{verbatim} -%F = m a = \ispmtwo{[M]}{[L]}\ispmthird{[T$^{-2}$]} +%F = m a \equiv \ispmtwo{[M]}{[L]}\ispmthird{[T]$^{-2}$} +%\end{verbatim} +%\end{center} +% +%\item Final example. +% +%e.g. +%\[1\ispmtwo{a}{b}\ispmthird{c}\ispmfourth{d}\ispmfifth{e}\ispmsixth{f}\ispmseventh{g}\ispmeighth{h}\ispmninth{i}\] +%\[1\ispmone{a}\ispmn{b}\ispmn{c}\ispmn{d}\ispmn{e}\ispmn{f}\ispmn{g}\ispmn{h}\ispmn{i}\] +%The code: +%\begin{center} +%\begin{verbatim} +%\[1\ispmtwo{a}{b}\ispmthird{c}\ispmfourth{d}\ispmfifth{e} +%\ispmsixth{f}\ispmseventh{g}\ispmeighth{h}\ispmninth{i}\] +% +%\[1\ispmone{a}\ispmn{b}\ispmn{c}\ispmn{d}\ispmn{e} +%\ispmn{f}\ispmn{g}\ispmn{h}\ispmn{i}\] %\end{verbatim} %\end{center} +% %\end{itemize} %\end{description} % %\newpage %\subsection{In-depth notation} -% -%Option \textsl{dc} and option \textsl{comma} are compatible, -%you can use both in the same document; e.g.: \\ -%\texttt{\textbackslash usepackage[comma, dc]\{isphysicalmath\}} \\ -%\begin{center} -% 1,234 \\ -% 1,234,567 -%\end{center} +%\label{subsec:in-depthNotation} +%Option \textsl{dc} and option \textsl{comma} are not compatible, but you can use option \textsl{dc} and +%\texttt{\textbackslash ispmcomma} command, both in the same document. \\ \\ +%\texttt{\textbackslash usepackage[dc]\{isphysicalmath\}} \\ +%\texttt{\textbackslash usepackage[comma]\{isphysicalmath\}} \\ \\ +%In a document by \textsl{dc} option: \\ +%1,234 \\ \\ +%In an other document by \textsl{comma} option: \\ +%1,234,567 \\ \\ +%Both in the same document, by \textsl{dc} option and \texttt{\textbackslash ispmcomma} command:\\ +%1,234 1,234,567 \\ \\ %The code: %\begin{verbatim} -%\ispmdc 1.234 \\ -%\ispmseptem 1234567 +%\ispmc 1.234 \\ +%\ispmc{1234567} \\ +%\ispmc 1.234 \ispmcomma{1234567} %\end{verbatim} % %\subsubsection{option <dc>} -% +%\label{subsubsec:optionDc} %\textsl{Usage}: \texttt{\textbackslash usepackage[dc]\{isphysicalmath\}} \\ % %The code of this option is not mine, it already exists in \LaTeX{} literature, % I discovered it in \tiny\url{https://en.wikibooks.org/wiki/LaTeX}\normalsize. \\ % -%This option changes dots in commas. It is useful for some users who don't +%This option by \texttt{\textbackslash ispmc} changes dots in commas. It is useful for some users who don't %use scientific international notation. It is convenient for users who %respect scientific international notation, so they change dots -%in commas to select thousands and not to separate the unit from -%negative numbers. \\ +%in commas to select thousands and not to express numbers under the unit. \\ % %e.g. %\begin{center} @@ -429,48 +620,97 @@ %The code: %\begin{center} %\begin{verbatim} -%\ispmdc 1.234 +%\ispmc 1.234 %\end{verbatim} %\end{center} +%~\ \\ +%This option by \texttt{\textbackslash ispmrc} changes commas in dots. It is useful for some users who want to +%use scientific international notation. It is convenient for users who +%respect scientific international notation, so they change commas +%in dots to express numbers under the unit. \\ % -%\subsubsection{option <comma>} +%e.g. +%\begin{center} +% 1,234 becomes 1.234 +%\end{center} +%The code: +%\begin{center} +%\begin{verbatim} +%\ispmrc 1,234 +%\end{verbatim} +%\end{center} % +%\subsubsection{option <comma>} +%\label{subsubsec:optionComma} %\textsl{Usage}: \texttt{\textbackslash %\{usepackage\}[comma]\{isphysicalmath\}} \\ % %It adds comma after every three digits, according to international %scientific notation. % -%For this task there are six ispm commands, in the next \textsl{isphysicalmath} -%version I'll automate this goal introducing one single ispm command. \\ %\begin{center} % 100,000,000 \\ -% 10,000,000 \\ -% 1,000,000 \\ -% 100,000 \\ -% 10,000 \\ -% 1,000 +% 100,000,000.00\\ +% 10,000,000.00 \\ +% 1,000,000.00 \\ +% 100,000.00 \\ +% 10,000.00 \\ +% 1,000.00 %\end{center} % %The code: %\begin{center} %\begin{verbatim} -%\ispmnovem 100000000 \\ -%\ispmocto 10000000 \\ -%\ispmseptem 1000000 \\ -%\ispmsex 100000 \\ -%\ispmquinque 10000 \\ -%\ispmquattuor 1000 +%\ispmc{100000000} \\ +%\ispmc{100000000}.00 \\ +%\ispmc{10000000}.00 \\ +%\ispmc{1000000}.00 \\ +%\ispmc{100000}.00 \\ +%\ispmc{10000}.00 \\ +%\ispmc{1000}.00 +%\end{verbatim} +%\end{center} +%\subsubsection{command <comma>} +%\label{subsubsec:commandComma} +%\textsl{Usage}: \texttt{\textbackslash +%\{usepackage\}[dc]\{isphysicalmath\}} \\ +%or \\ +%\texttt{\textbackslash \{usepackage\}\{isphysicalmath\}} \\ +%It adds comma after every three digits, according to international +%scientific notation. +% +%\begin{center} +% 100,000,000 \\ +% 100,000,000.00\\ +% 10,000,000.00 \\ +% 1,000,000.00 \\ +% 100,000.00 \\ +% 10,000.00 \\ +% 1,000.00 +%\end{center} +% +%The code: +%\begin{center} +%\begin{verbatim} +%\ispmcomma{100000000} \\ +%\ispmcomma{100000000}.00 \\ +%\ispmcomma{10000000}.00 \\ +%\ispmcomma{1000000}.00 \\ +%\ispmcomma{100000}.00 \\ +%\ispmcomma{10000}.00 \\ +%\ispmcomma{1000}.00 %\end{verbatim} %\end{center} %\newpage % %\section{isphysicalmath url}% -%Package home URL: \tiny \url{https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath} \normalsize% +%Package home URL: +%\tiny \url{https://ctan.org/pkg/isphysicalmath} \\ +%\url{https://github.com/MartDiVenus/LaTeX/tree/isphysicalmath} \normalsize% % %\section{Copyright} % -%Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +%Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> % %This file may be distributed and/or modified under the conditions of %the \LaTeX\ Project Public License, either version 1.3 of this license @@ -486,5 +726,52 @@ % % This work consists of the files isphysicalmath.dtx and isphysicalmath.ins % and the derived file isphysicalmath.sty. +%\section{Change history} +%\subsection{v1.0.0} +%2023.09.18 First version. +%\subsection{v1.1.0} +%2024.01.03 Following improvements have been brought: +%\begin{enumerate} +%\item \autoref{sec:dependencies} changed. +%\item URL \tiny \url{https://ctan.org/pkg/isphysicalmath} \normalsize specified. +%\item Original \textsl{comma} option changed in command, and new \textsl{comma} option \texttt{\textbackslash ispmc} added. +%\item Example added in \autoref{subsec:inDepthFormatting}. +%\item Doc \textsl{dc} option improved in \autoref{sec:usage}. +%\item \textsl{dc} option changed in \texttt{\textbackslash ispmc}. +%\item \textsl{dc} option improved adding \texttt{\textbackslash ispmrc} to change commas in dots. +%\item Doc \textsl{comma} option improved in \autoref{sec:usage}. +%\item Doc \textsl{comma} option changed in \autoref{subsec:in-depthNotation}. +%\item Option \textsl{comma} improved, now the goal is reached by a single command. +%\item \autoref{subsubsec:optionComma} changed. +%\item \autoref{subsubsec:commandComma} added. +%\item Following commands added: +%\begin{itemize} +% \item \texttt{\textbackslash ispmfourth}; +% \item \texttt{\textbackslash ispmfifth}; +% \item \texttt{\textbackslash ispmsixth}; +%\item \texttt{\textbackslash ispmseventh}; +%\item \texttt{\textbackslash ispmeighth}; +%\item \texttt{\textbackslash ispmninth}; +%\item \texttt{\textbackslash ispmn}. +%\end{itemize} +%\item Example `With inner mathematical environments (e)' added in \autoref{subsec:inDepthFormatting}. +%\item Example `Final example' added in \autoref{subsec:inDepthFormatting}. +%\item \autoref{subsubsec:optionDc} changed. +%\item \texttt{\textbackslash ispm} command changed, so \autoref{sec:usage} changed. +%\item `About physical quantities dimensions' (\autoref{subsec:inDepthFormatting}) improved. +%\item Clarified in \autoref{subsec:inDepthFormatting} when to join or to detach formatting commands to previous term. +%\item Year of the copyright modified. +%\item README.md: +%\begin{itemize} +%\item Year of the copyright modified. +%\item `Change History' added. +%\item `URL' modified. +%\item `Documentation' modified. +%\item `Dependencies' modified. +%\item `Build the documentation' removed. +%\item `Build isphysicalmath.sty' removed. +%\end{itemize} +%\end{enumerate} +% % \Finale \endinput diff --git a/macros/latex/contrib/isphysicalmath/isphysicalmath.ins b/macros/latex/contrib/isphysicalmath/isphysicalmath.ins index c4b638a7b3..2cbd19533c 100644 --- a/macros/latex/contrib/isphysicalmath/isphysicalmath.ins +++ b/macros/latex/contrib/isphysicalmath/isphysicalmath.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +%% Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2023 by Mario Fantini <marfant7@gmail.com> +Copyright (C) 2024 by Mario Fantini <marfant7@gmail.com> This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license diff --git a/macros/latex/contrib/texshade/README b/macros/latex/contrib/texshade/README index a57f0eac62..2d2d83caf3 100644 --- a/macros/latex/contrib/texshade/README +++ b/macros/latex/contrib/texshade/README @@ -1,4 +1,4 @@ - TeXshade v1.26c + TeXshade v1.27 >> >> A LaTeX package for setting nucleotide and peptide alignments. >> @@ -26,7 +26,7 @@ >> ding modes. TeXshade combines highest flexibility and the >> habitual TeX output quality--with reasonable time expenditure. >> - Copyright (C) 1999 - 2023 Eric Beitz + Copyright (C) 1999 - 2024 Eric Beitz diff --git a/macros/latex/contrib/texshade/texshade.dtx b/macros/latex/contrib/texshade/texshade.dtx index da16105ddf..8ea0d6febb 100644 --- a/macros/latex/contrib/texshade/texshade.dtx +++ b/macros/latex/contrib/texshade/texshade.dtx @@ -10,7 +10,7 @@ % `README.txt' for further information! % % -% Copyright (C) 1999-2023 Eric Beitz +% Copyright (C) 1999-2024 Eric Beitz % % \fi % @@ -422,6 +422,10 @@ % Corrections: shading, tinting, emphasizing, lower casing, % and framing of motifs now works with set domains.} % +% \changes{1.27}{2024-01-06}{% +% Introduction: a second full ruler with independent [top] and [bottom] +% options, and the possibility to show ruler names.} +% % % % \CharacterTable @@ -461,7 +465,7 @@ % for further information, updates and on-line documentation % see my homepage at % \texttt{www.pharmazie.uni-kiel.de/chem/Prof\_Beitz/biotex.html} }} -% \date{\small v1.26c; 2023/06/04\\[2pt]} +% \date{\small v1.27; 2024/01/06\\[2pt]} % \maketitle % \begin{abstract} % Setting alignments of nucleotides and peptides for publication @@ -545,12 +549,23 @@ % % \subsection{Version History} % -% \textbf{v1.26(a-c) 2021/04/01 (2022/08/29-2023/06/04)} +% \textbf{v1.7 2024/01/06} +% \medskip +% +% \emph{Introduction:} +% The possibility to show a second full ruler at the [top] or [bottom] +% was introduced plus the option to show ruler names by +% |\nameruler|. The |rulername| style can be adjusted using the +% common |setfamily| and |setsize| commands. +% \medskip +% \newpage +% +% \textbf{v1.26(a/b/c) 2021/04/01 (2022/08/29, 2023/05/28, 2023/06/04)} % \medskip % % \emph{Corrections}: Frames at line ends remain open to indicate % continuity of the marked region, and |\par| line endings are now treated -% correctly. +% correctly. Motif labels were corrected. % % \emph{Introductions:} % Chimera command file export option for 'structure memes' @@ -607,7 +622,7 @@ % sets of colors can be selected for different sequence blocks by % |\changeshadingcolors| (\ref{Lchangeshadingcolors}). % \medskip -% +% \newpage % % \textbf{v1.21 2010/03/01} % \medskip @@ -726,7 +741,7 @@ % |\setsize{featurenames}{large}| or % |\featurestylenamesrm|. % \bigskip -% +% \newpage % % \textbf{v1.16 2007/02/18} % \medskip @@ -896,7 +911,7 @@ % mode were switched (`|-|' in gaps; `|.|' at matching % positions) in order to follow convention. % -% \emph{Introduction:} \TeXshade{} speaks spanish (|\spanishlanguage|). +% \emph{Introduction:} \TeXshade{} speaks Spanish (|\spanishlanguage|). % Necessary translations were contributed by Mikel Ega\~na Aranguren. % A new feature label style |helix| has been introduced. % \bigskip @@ -1015,7 +1030,7 @@ % can be activated by `|\numcount|', `|\alphacount|' and % `|\Alphacount|'. All commands are described in \ref{structure}. % \bigskip -% +% \newpage % % \textbf{v1.1 1999/5/26} % \medskip @@ -1300,7 +1315,7 @@ % threshold is set to 50\%. Neither residue exceeds this percentage % but as a group of similars they do. % -% In grayscale printouts some colors of the following alignment may appear +% In grayscale printouts, some colors of the following alignment may appear % undistinguishable. Don't worry if you usually use grayscale---all % colors/grays can be selected freely (see \ref{colors}). % \medskip @@ -2619,12 +2634,12 @@ % \label{Lhideallmatchpositions} % Since alignment positions where all residues match do not contain % much information, those sites can be blanked out using -% Ê|\hideallmatchpositions|. The resulting break in the alignment is +% |\hideallmatchpositions|. The resulting break in the alignment is % indicated by a gap and a vertical line. See the |\setdomain| % command (\ref{Lsetdomain}) % for further information on how to change the gap and ruler colors. % A single-stepped ruler is also recommended (\ref{Lshowruler}). -% Ê|\hideallmatchpositions| can be combined with |\setends| +% |\hideallmatchpositions| can be combined with |\setends| % (\ref{Lsetends}). % % @@ -3269,24 +3284,30 @@ % Another possibility to label sequence positions is to switch % on a ruler on the top or at the bottom of the sequence block % using \label{ruler} -% |\showruler[|\meta{color}|]{|\meta{position}|}{|\meta{seqref}|}|. +% |\showruler[|\meta{color}|]{|\meta{top/bottom}|}{|\meta{seqref}|}|. % The residue ruler of one sequence \meta{seqref} or the consensus % (declare `|consensus|' as \meta{seqref}) can be -% displayed at \meta{position} |top| or |bottom|. -% The ruler is hidden with |\hideruler|. The steps between two -% numbers are set by |\rulersteps{|\meta{number}|}|. If the steps +% displayed at |top| or |bottom|. +% A ruler is hidden with |\hideruler[|\meta{top/bottom}|]|. When +% |[|\meta{top/bottom}|]| is omitted, both rulers are addressed. The steps +% between two numbers are set by +% |\rulersteps[|\meta{top/bottom}|]{|\meta{number}|}|. If the steps % are set to be very close ($< 4$) or when every position is numbered, the % numbering is automatically rotated by 90$^\circ$. Using |\rotateruler| -% and |\unrotateruler| this can be done and undone manually. -% In order to change the +% and |\unrotateruler| this can be done and undone manually, again +% with the |[|\meta{top/bottom}|]| option. In order to change the % ruler color use the optional parameter or the command -% |\rulercolor{|\meta{color}|}|. Also, the label and its color at individual -% ruler positions can be changed by the user to a string using -% |\namerulerpos{|\meta{number}|}{|\meta{text}|[|\meta{color}|]}| -% (see example on p.\ \pageref{ras}). Finally, to adjust the distance +% |\rulercolor[|\meta{top/bottom}|]{|\meta{color}|}|. Also, the label and its color +% at individual ruler numbers can be changed by the user to a string using +% |\namerulerpos[|\meta{top/bottom}|]{|\meta{number}|}{|\meta{text}|[|\meta{color}|]}| +% (see example on p.\ \pageref{ras}). To adjust the distance % between the ruler and the top or bottom sequence row use -% |\rulerspace{|\meta{length}|}|, e.\,g. |\rulerspace{1mm}|. -% +% |\rulerspace[|\meta{top/bottom}|]{|\meta{length}|}|, e.\,g. |\rulerspace{1mm}|. +% Finally, ruler names can be displayed using +% |\nameruler[|\meta{top/bottom}|]{|\meta{name}|}| with |\setfamily|, +% |\setsize|, and |\rulernamecolor[|\meta{top/bottom}|]{|\meta{color}|}| +% for further adjustments. +% % \label{Lgapchar}\label{Lgaprule} % \label{Lgapcolors}\label{gapchar} % Further, the symbol which is displayed in sequence gaps is freely @@ -4752,6 +4773,7 @@ % residues (|\residuesrm| etc.), % hideblock labels (|hideblockrm| etc.), % rulers (|\rulerrm| etc.), and +% rulernames (|\rulernamerm| etc.), and % legend texts (|legendrm| etc.). % % @@ -6031,25 +6053,31 @@ % \quad|\showruler[|\meta{color}|]{|\meta{top/bottom}|}{|\meta{seqref}|}| % \hfill[\pageref{Lshowruler}] % -% \quad|\rulersteps{|\meta{number}|}| +% \quad|\rulersteps[|\meta{top/bottom}|]{|\meta{number}|}| % \hfill[\pageref{Lrulersteps}] % -% \quad|\rulercolor{|\meta{color}|}| +% \quad|\rulercolor[|\meta{top/bottom}|]{|\meta{color}|}| % \hfill[\pageref{Lrulercolor}] % -% \quad|\hideruler| +% \quad|\hideruler[|\meta{top/bottom}|]| % \hfill[\pageref{Lhideruler}] % -% \quad|\rotateruler| +% \quad|\rotateruler[|\meta{top/bottom}|]| % \hfill[\pageref{Lrotateruler}] % -% \quad|\unrotateruler| +% \quad|\unrotateruler[|\meta{top/bottom}|]| % \hfill[\pageref{Lunrotateruler}] % -% \quad|\namerulerpos{|\meta{number}|}{|\meta{text}|[|\meta{color}|]}| +% \quad|\namerulerpos[|\meta{top/bottom}|]{|\meta{number}|}{|\meta{text}|[|\meta{color}|]}| +% \hfill[\pageref{Lnamerulerpos}] +% +% \quad|\nameruler[|\meta{top/bottom}|]{|\meta{name}|]}| % \hfill[\pageref{Lnamerulerpos}] % -% \quad|\rulerspace{|\meta{length}|}| +% \quad|\rulernamecolor[|\meta{top/bottom}|]{|\meta{color}|]}| +% \hfill[\pageref{Lnamerulerpos}] +% +% \quad|\rulerspace[|\meta{top/bottom}|]{|\meta{length}|}| % \hfill[\pageref{Lrulerspace}] % % \quad|\gapchar{|\meta{symbol}|}| @@ -6614,8 +6642,8 @@ % \begin{macrocode} %<*texshade> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{texshade}[2023/06/04 LaTeX TeXshade (v1.26c)] -\message{Package `texshade', Version 1.26c of 2023/06/04.} +\ProvidesPackage{texshade}[2023/06/04 LaTeX TeXshade (v1.27)] +\message{Package `texshade', Version 1.27 of 2024/01/06.} \PassOptionsToPackage{dvips}{color} \PassOptionsToPackage{dvips}{graphicx} @@ -6755,6 +6783,10 @@ \def\resm@tch{upper} \def\res@llm@tch{upper} \def\tr@ns{translate} \def\gr@ydef@ult{GrayDefault} \xdef\par@{\string\par} +\xdef\rule@bottom{-1}\xdef\rule@top{-1} +\xdef\rulername@top{} \xdef\rulername@bottom{} +\xdef\rulernamecolor@top{n} \xdef\rulernamecolor@bottom{n} +\xdef\rulername@family{n} \xdef\rulername@size{n} \expandafter\def\csname fg@textcolor/\endcsname{White} \expandafter\def\csname fg@color/\endcsname{White} \expandafter\def\csname func@style/\endcsname{\csname textup\endcsname} @@ -9011,8 +9043,9 @@ \expandafter\order@set\second@ \ifnum\loopcount<\killseq@count \repeat \ifnum\cons@num>0 \xdef\cons@num{\csname @rd\cons@num\endcsname} \fi - \ifnum\rule@num>0 \xdef\rule@num{\csname @rd\rule@num\endcsname} \fi - \ifnum\divref@>0 \xdef\divref@{\csname @rd\divref@\endcsname} \fi + \ifnum\rule@num@top>0 \xdef\rule@num@top{\csname @rd\rule@num@top\endcsname} \fi + \ifnum\rule@num@bottom>0 \xdef\rule@num@bottom{\csname @rd\rule@num@bottom\endcsname} \fi + \ifnum\divref@>0 \xdef\divref@{\csname @rd\divref@\endcsname} \fi \loopcount=0 \loop \advance\loopcount by 1 @@ -9288,12 +9321,14 @@ \expandafter\xdef\csname res@count\the\loopcount\endcsname{% \csname res@count\the\innerloopcount\endcsname} \expandafter\xdef\csname hide@seq\the\innerloopcount\endcsname{kill} - \ifnum\loopcount=\rule@num \hideruler \fi + \ifnum\loopcount=\rule@num@top \hideruler[top] \fi + \ifnum\loopcount=\rule@num@bottom \hideruler[bottom] \fi \fi \expandafter\xdef\csname @rd\the\innerloopcount\endcsname{\the\loopcount} \advance\loopcount by 1 \ifnum\loopcount>\killseq@count - \ifnum\rule@num>0\xdef\rule@num{\csname @rd\rule@num\endcsname}\fi + \ifnum\rule@num@top>0\xdef\rule@num@top{\csname @rd\rule@num@top\endcsname}\fi + \ifnum\rule@num@bottom>0\xdef\rule@num@bottom{\csname @rd\rule@num@bottom\endcsname}\fi \ifnum\cons@num>0\xdef\cons@num{\csname @rd\cons@num\endcsname}\fi \else \kill@seqnow @@ -12667,7 +12702,11 @@ \def\bbottomspace#1{\def\bb@sp@ce{#1}} \def\bbbottomspace#1{\def\bbb@sp@ce{#1}} \def\bbbbottomspace#1{\def\bbbb@sp@ce{#1}} -\def\rulerspace#1{\def\ruler@sp@ce{#1}} +\newcommand\rulerspace[2][n]{ + \xdef\first@{#1} \ifx\first@\n@ \def\ruler@sp@ce@top{#2}\def\ruler@sp@ce@bottom{#2}\fi + \xdef\second@{top} \ifx\first@\second@ \def\ruler@sp@ce@top{#2}\fi + \xdef\second@{bottom} \ifx\first@\second@ \def\ruler@sp@ce@bottom{#2}\fi +} \def\fixblockspace{\fix@true} \def\flexblockspace{\fix@false} \def\nosepline{\def\seq@skip{\relax}} @@ -13176,34 +13215,96 @@ \def\hideleadinggaps{\sh@wg@psfalse} \def\showleadinggaps{\sh@wg@pstrue} \newcommand\showruler[3][n]{% - \xdef\first@{#1} - \ifx\first@\n@\else\xdef\ruler@fg{#1}\fi + \xdef\first@@{#1} \xdef\first@{consensus} \xdef\second@{#3} \xdef\third@{bottom} \xdef\fourth@{#2} - \ifx\third@\fourth@ \xdef\rule@top{1}\else\xdef\rule@top{0}\fi - \ifx\first@\second@ \xdef\rule@num{0} + \ifx\third@\fourth@ + \xdef\rule@bottom{1} + \ifx\first@@\n@\else\xdef\ruler@fg@bottom{#1}\fi + \ifx\first@\second@ \xdef\rule@num@bottom{0} + \else + \xdef\first@{#3 @} \expandafter\check@letter\first@ + \xdef\first@{#3} \ifletter \get@name@number \fi + \ifnum\first@>\seq@count + \else + \ifnum\first@>0 + \xdef\rule@num@bottom{\first@} + \fi + \fi + \fi \else - \xdef\first@{#3 @} \expandafter\check@letter\first@ - \xdef\first@{#3} \ifletter \get@name@number \fi - \ifnum\first@>\seq@count - \else - \ifnum\first@>0 - \xdef\rule@num{\first@} - \fi + \xdef\rule@top{1} + \ifx\first@@\n@\else\xdef\ruler@fg@top{#1}\fi + \ifx\first@\second@ \xdef\rule@num@top{0} + \else + \xdef\first@{#3 @} \expandafter\check@letter\first@ + \xdef\first@{#3} \ifletter \get@name@number \fi + \ifnum\first@>\seq@count + \else + \ifnum\first@>0 + \xdef\rule@num@top{\first@} + \fi + \fi \fi \fi - \xdef\ruler@{}} -\def\hideruler{\xdef\rule@num{-1}} + \xdef\topruler@{}\xdef\bottomruler@{} +} +\newcommand\hideruler[1][n]{ + \xdef\first@{#1} \ifx\first@\n@ + \xdef\rule@num@top{-1} \xdef\rule@top{0} + \xdef\rule@num@bottom{-1} \xdef\rule@bottom{0} + \fi + \xdef\second@{top} \ifx\first@\second@ + \xdef\rule@num@top{-1} \xdef\rule@top{0} + \fi + \xdef\second@{bottom} \ifx\first@\second@ + \xdef\rule@num@bottom{-1} \xdef\rule@bottom{0} + \fi +} \def\allowzero{\xdef\allow@zero{y}} \def\disallowzero{\xdef\allow@zero{n}} -\def\rulersteps#1{% - \xdef\ruler@step{#1} - \ifnum#1<4 \xdef\ruler@rot{90}\fi +\newcommand\rulersteps[2][n]{ + \xdef\first@{#1} \ifx\first@\n@ + \xdef\ruler@step@top{#2} \ifnum#2<4 \xdef\ruler@rot@top{90}\fi + \xdef\ruler@step@bottom{#2} \ifnum#2<4 \xdef\ruler@rot@bottom{90}\fi + \fi + \xdef\second@{top} \ifx\first@\second@ + \xdef\ruler@step@top{#2} \ifnum#2<4 \xdef\ruler@rot@top{90}\fi + \fi + \xdef\second@{bottom} \ifx\first@\second@ + \xdef\ruler@step@bottom{#2} \ifnum#2<4 \xdef\ruler@rot@bottom{90}\fi + \fi } -\def\rotateruler{\xdef\ruler@rot{90}} -\def\unrotateruler{\xdef\ruler@rot{0}} -\def\namerulerpos#1#2{% - \expandafter\xdef\csname alt@ruler#1\endcsname{#2} +\newcommand\rotateruler[1][n]{ + \xdef\first@{#1} \ifx\first@\n@ \xdef\ruler@rot@top{90} \xdef\ruler@rot@bottom{90} \fi + \xdef\second@{top} \ifx\first@\second@ \xdef\ruler@rot@top{90}\fi + \xdef\second@{bottom} \ifx\first@\second@ \xdef\ruler@rot@bottom{90}\fi +} +\newcommand\unrotateruler[1][n]{ + \xdef\first@{#1} \ifx\first@\n@ \xdef\ruler@rot@top{0} \xdef\ruler@rot@bottom{0} \fi + \xdef\second@{top} \ifx\first@\second@ \xdef\ruler@rot@top{0}\fi + \xdef\second@{bottom} \ifx\first@\second@ \xdef\ruler@rot@bottom{0}\fi +} +\newcommand\namerulerpos[3][n]{% + \xdef\first@{#1} + \ifx\first@\n@ + \expandafter\xdef\csname alt@ruler@top#2\endcsname{#3} + \expandafter\xdef\csname alt@ruler@bottom#2\endcsname{#3} + \fi + \xdef\second@{top} + \ifx\first@\second@ \expandafter\xdef\csname alt@ruler@top#2\endcsname{#3} \fi + \xdef\second@{bottom} + \ifx\first@\second@ \expandafter\xdef\csname alt@ruler@bottom#2\endcsname{#3} \fi +} +\newcommand\nameruler[2][n]{ + \xdef\first@{#1} \ifx\first@\n@ \xdef\rulername@top{#2} \xdef\rulername@bottom{#2} \fi + \xdef\second@{top} \ifx\first@\second@ \xdef\rulername@top{#2}\fi + \xdef\second@{bottom} \ifx\first@\second@ \xdef\rulername@bottom{#2}\fi +} +\newcommand\rulernamecolor[2][n]{ + \xdef\first@{#1} \ifx\first@\n@ \xdef\rulernamecolor@top{#2} \xdef\rulernamecolor@bottom{#2} \fi + \xdef\second@{top} \ifx\first@\second@ \xdef\rulernamecolor@top{#2}\fi + \xdef\second@{bottom} \ifx\first@\second@ \xdef\rulernamecolor@bottom{#2}\fi } \def\featurerule#1{\setlength\rule@thick{#1}} \def\orderseqs#1{% @@ -13281,6 +13382,9 @@ \xdef\temp@{ruler} \ifx\first@\temp@ \xdef\ruler@family{\second@} \else + \xdef\temp@{rulername} + \ifx\first@\temp@ \xdef\rulername@family{\second@} + \else \xdef\temp@{all} \ifx\first@\temp@ \xdef\ftext@family{\third@} @@ -13293,7 +13397,8 @@ \xdef\legend@family{\third@} \xdef\label@family{\third@} \xdef\ruler@family{\second@} - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \xdef\rulername@family{\second@} + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi } \def\setseries#1#2{% @@ -13504,6 +13609,10 @@ \ifx\first@\temp@ \def\bottomruler@size{\csname #2\endcsname} \fi + \xdef\temp@{rulername} + \ifx\first@\temp@ + \def\rulername@size{\csname #2\endcsname} + \fi } \def\setfont#1#2#3#4#5{% \setfamily{#1}{#2}\setseries{#1}{#3} @@ -13673,6 +13782,19 @@ \def\rulerLARGE {\setsize{ruler}{LARGE}} \def\rulerhuge {\setsize{ruler}{huge}} \def\rulerHuge {\setsize{ruler}{Huge}} +\def\rulernamerm{\setfamily{rulername}{rm}} +\def\rulernamesf{\setfamily{rulername}{sf}} +\def\rulernamett{\setfamily{rulername}{tt}} +\def\rulernametiny {\setsize{rulername}{tiny}} +\def\rulernamescriptsize {\setsize{rulername}{scriptsize}} +\def\rulernamefootnotesize{\setsize{rulername}{footnotesize}} +\def\rulernamesmall {\setsize{rulername}{small}} +\def\rulernamenormalsize {\setsize{rulername}{normalsize}} +\def\rulernamelarge {\setsize{rulername}{large}} +\def\rulernameLarge {\setsize{rulername}{Large}} +\def\rulernameLARGE {\setsize{rulername}{LARGE}} +\def\rulernamehuge {\setsize{rulername}{huge}} +\def\rulernameHuge {\setsize{rulername}{Huge}} \def\funcshadingstyle#1#2#3#4#5{% \xdef\temp@{nomatch} \xdef\first@{#1} \ifx\temp@\first@ @@ -13877,7 +13999,11 @@ \fi } \def\legendcolor#1{\xdef\legend@fg{#1}} -\def\rulercolor#1{\xdef\ruler@fg{#1}} +\newcommand\rulercolor[2][n]{ + \xdef\first@{#1} \ifx\first@\n@ \xdef\ruler@fg@top{#2} \xdef\ruler@fg@bottom{#2} \fi + \xdef\second@{top} \ifx\first@\second@ \xdef\ruler@fg@top{#2}\fi + \xdef\second@{bottom} \ifx\first@\second@ \xdef\ruler@fg@bottom{#2}\fi +} \def\molweight#1#2{% \xdef\temp@{Da}% \xdef\second@{#2}% @@ -17053,17 +17179,27 @@ % \advance\pos@count by 1 } -\def\add@to@rule@tens{% - \advance\innerloopcount by \ruler@step\relax - \ifnum\innerloopcount=0 - \ifx\allow@zero\n@ \innerloopcount=\ruler@step \fi +\def\add@to@rule@tens@top{% + \advance\innerloopcount by \ruler@step@top\relax + \ifnum\innerloopcount=0 + \ifx\allow@zero\n@ \innerloopcount=\ruler@step@top \fi \fi - \expandafter\ifnum\csname res@count\rule@num\endcsname>\innerloopcount \add@to@rule@tens + \expandafter\ifnum\csname res@count\rule@num@top\endcsname>\innerloopcount \add@to@rule@tens@top \else - \xdef\rule@tens{\the\innerloopcount} + \xdef\rule@tens@top{\the\innerloopcount} \fi } +\def\add@to@rule@tens@bottom{% + \advance\innerloopcount by \ruler@step@bottom\relax + \ifnum\innerloopcount=0 + \ifx\allow@zero\n@ \innerloopcount=\ruler@step@bottom \fi + \fi + \expandafter\ifnum\csname res@count\rule@num@bottom\endcsname>\innerloopcount \add@to@rule@tens@bottom + \else + \xdef\rule@tens@bottom{\the\innerloopcount} + \fi +} \def\c@nsensus{% \ifnum\pos@count>\res@perline @@ -17111,24 +17247,44 @@ \expandafter\xdef\csname res@count\the\loopcount\endcsname{\the\res@count} \ifnum\loopcount=\chimera@seqnum \xdef\chimera@stack{\chimera@stack \the\res@count,} \fi \ifnum\loopcount=\exp@rt@num \xdef\sixth@{\the\res@count}\xdef\seventh@{y}\fi - \ifnum\loopcount=\rule@num\relax - \expandafter\ifnum\csname res@count\rule@num\endcsname>\rule@tens - \innerloopcount=\rule@tens \add@to@rule@tens - \fi - \expandafter\ifnum\csname res@count\rule@num\endcsname=\rule@tens - \expandafter\ifx\csname alt@ruler\rule@tens\endcsname\relax - \xdef\temp@{\rule@tens} + \ifnum\loopcount=\rule@num@top\relax + \expandafter\ifnum\csname res@count\rule@num@top\endcsname>\rule@tens@top + \innerloopcount=\rule@tens@top \add@to@rule@tens@top + \fi + \expandafter\ifnum\csname res@count\rule@num@top\endcsname=\rule@tens@top + \expandafter\ifx\csname alt@ruler@top\rule@tens@top\endcsname\relax + \xdef\temp@{\rule@tens@top} + \else + \xdef\temp@{\csname alt@ruler@top\rule@tens@top\endcsname} + \fi + \xdef\topruler@{\topruler@ !<\temp@>} + \else + \xdef\topruler@{\topruler@ -} + \fi + \xdef\temp@{\csname res@count\rule@num@top\endcsname} + \expandafter\ifx\csname alt@ruler@top\temp@\endcsname\relax + \else + \expandafter\xdef\csname alt@ruler@top\temp@\endcsname{\temp@} + \fi + \fi + \ifnum\loopcount=\rule@num@bottom\relax + \expandafter\ifnum\csname res@count\rule@num@bottom\endcsname>\rule@tens@bottom + \innerloopcount=\rule@tens@bottom \add@to@rule@tens@bottom + \fi + \expandafter\ifnum\csname res@count\rule@num@bottom\endcsname=\rule@tens@bottom + \expandafter\ifx\csname alt@ruler@bottom\rule@tens@bottom\endcsname\relax + \xdef\temp@{\rule@tens@bottom} \else - \xdef\temp@{\csname alt@ruler\rule@tens\endcsname} + \xdef\temp@{\csname alt@ruler@bottom\rule@tens@bottom\endcsname} \fi - \xdef\ruler@{\ruler@ !<\temp@>} + \xdef\bottomruler@{\bottomruler@ !<\temp@>} \else - \xdef\ruler@{\ruler@ -} + \xdef\bottomruler@{\bottomruler@ -} \fi - \xdef\temp@{\csname res@count\rule@num\endcsname} - \expandafter\ifx\csname alt@ruler\temp@\endcsname\relax + \xdef\temp@{\csname res@count\rule@num@bottom\endcsname} + \expandafter\ifx\csname alt@ruler@bottom\temp@\endcsname\relax \else - \expandafter\xdef\csname alt@ruler\temp@\endcsname{\temp@} + \expandafter\xdef\csname alt@ruler@bottom\temp@\endcsname{\temp@} \fi \fi \ifx\collect@valtop\yes @@ -17252,7 +17408,8 @@ \expandafter\xdef\csname ch@rge\the\loopcount\endcsname{% \the\innerloopcount} \else - \ifnum\loopcount=\rule@num \xdef\ruler@{\ruler@ -} \fi + \ifnum\loopcount=\rule@num@top \xdef\topruler@{\topruler@ -} \fi + \ifnum\loopcount=\rule@num@bottom \xdef\bottomruler@{\bottomruler@ -} \fi \ifnum\loopcount=\chimera@seqnum \xdef\chimera@stack{\chimera@stack &,} \fi \ifx\collect@valtop\yes \ifnum\v@lseqtop=\loopcount @@ -17425,31 +17582,56 @@ \ifcase\match@case \unc@nserved \or \c@nserved \or \allm@tch \else \functi@nal \fi \fi \fi - \ifnum\rule@num=0 - \ifx\g@p\y@ - \xdef\ruler@{\ruler@ -} + \ifnum\rule@num@top=0 + \ifx\g@p\y@ + \xdef\topruler@{\topruler@ -} \else - \ifnum\cons@count=\rule@tens - \expandafter\ifx\csname alt@ruler\rule@tens\endcsname\relax - \xdef\temp@{\rule@tens} + \ifnum\cons@count=\rule@tens@top + \expandafter\ifx\csname alt@ruler@top\rule@tens@top\endcsname\relax + \xdef\temp@{\rule@tens@top} \else - \xdef\temp@{\csname alt@ruler\rule@tens\endcsname} + \xdef\temp@{\csname alt@ruler@top\rule@tens@top\endcsname} \fi - \xdef\ruler@{\ruler@ !<\temp@>} - \innerloopcount=\rule@tens \advance\innerloopcount by \ruler@step\relax - \ifnum\innerloopcount=0 - \ifx\allow@zero\n@ \innerloopcount=\ruler@step \fi + \xdef\topruler@{\topruler@ !<\temp@>} + \innerloopcount=\rule@tens@top \advance\innerloopcount by \ruler@step@top\relax + \ifnum\innerloopcount=0 + \ifx\allow@zero\n@ \innerloopcount=\ruler@step@top \fi \fi - \xdef\rule@tens{\the\innerloopcount} + \xdef\rule@tens@top{\the\innerloopcount} \else - \xdef\ruler@{\ruler@ -} - \fi - \expandafter\ifx\csname alt@ruler\the\cons@count\endcsname\relax + \xdef\topruler@{\topruler@ -} + \fi + \expandafter\ifx\csname alt@ruler@top\the\cons@count\endcsname\relax \else - \expandafter\xdef\csname alt@ruler\the\cons@count\endcsname{\the\cons@count} + \expandafter\xdef\csname alt@ruler@top\the\cons@count\endcsname{\the\cons@count} \fi \fi - \fi + \fi + \ifnum\rule@num@bottom=0 + \ifx\g@p\y@ + \xdef\bottomruler@{\bottomruler@ -} + \else + \ifnum\cons@count=\rule@tens@bottom + \expandafter\ifx\csname alt@ruler@bottom\rule@tens@bottom\endcsname\relax + \xdef\temp@{\rule@tens@bottom} + \else + \xdef\temp@{\csname alt@ruler@bottom\rule@tens@bottom\endcsname} + \fi + \xdef\bottomruler@{\bottomruler@ !<\temp@>} + \innerloopcount=\rule@tens@bottom \advance\innerloopcount by \ruler@step@bottom\relax + \ifnum\innerloopcount=0 + \ifx\allow@zero\n@ \innerloopcount=\ruler@step@bottom \fi + \fi + \xdef\rule@tens@bottom{\the\innerloopcount} + \else + \xdef\bottomruler@{\bottomruler@ -} + \fi + \expandafter\ifx\csname alt@ruler@bottom\the\cons@count\endcsname\relax + \else + \expandafter\xdef\csname alt@ruler@bottom\the\cons@count\endcsname{\the\cons@count} + \fi + \fi + \fi \expandafter\ifnum\csname res@count\start@seq\endcsname<\end@num\relax \c@nsensus \else @@ -17498,12 +17680,19 @@ \expandafter\xdef\csname dom@num\the\loopcount\endcsname{\temp@} \fi %%%%%%%%%%%***** \expandafter\xdef\csname res@count\the\loopcount\endcsname{\the\res@count} - \ifnum\rule@num=\loopcount + \ifnum\rule@num@top=\loopcount + \temp@count=\csname res@count\the\loopcount\endcsname + \advance\temp@count by \ruler@step@top + \divide\temp@count by \ruler@step@top + \multiply\temp@count by \ruler@step@top + \xdef\rule@tens@top{\the\temp@count} + \fi + \ifnum\rule@num@bottom=\loopcount \temp@count=\csname res@count\the\loopcount\endcsname - \advance\temp@count by \ruler@step - \divide\temp@count by \ruler@step - \multiply\temp@count by \ruler@step - \xdef\rule@tens{\the\temp@count} + \advance\temp@count by \ruler@step@bottom + \divide\temp@count by \ruler@step@bottom + \multiply\temp@count by \ruler@step@bottom + \xdef\rule@tens@bottom{\the\temp@count} \fi \fi \ifnum\loopcount<\seq@count \c@unt\fi} @@ -18414,67 +18603,69 @@ \xdef\first@{#2@}% \xdef\fill@char{#1[,]&}% \expandafter\opt@color\fill@char% - \ifx\f@color\comm@\xdef\f@color{\ruler@fg}\fi% - \ifcase\rule@top - \ifnum\ruler@rot=0 % + \ifnum\top@bot=0 + \ifx\f@color\comm@\xdef\f@color{\ruler@fg@top}\fi + \ifnum\ruler@rot@top=0% \xdef\temp@{tt}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\mathtt{\fourth@}}{\textcolor{\ruler@fg}{.}}}}% + \def\third@{\tt\bottomruler@size\vbox{\hbox to \ruler@width{\hss\fourth@\hss}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\textcolor{\ruler@fg@top}{\hss.\hss}}}}% \else \xdef\temp@{sf}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\mathsf{\fourth@}}{\textcolor{\ruler@fg}{.}}}}% + \def\third@{\sf\bottomruler@size\vbox{\hbox to \ruler@width{\hss\fourth@\hss}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\textcolor{\ruler@fg@top}{\hss.\hss}}}}% \else \xdef\temp@{rm}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\mathrm{\fourth@}}{\textcolor{\ruler@fg}{.}}}}% + \def\third@{\rm\bottomruler@size\vbox{\hbox to \ruler@width{\hss\fourth@\hss}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\textcolor{\ruler@fg@top}{\hss.\hss}}}}% \fi\fi\fi \else \xdef\temp@{tt}% \ifx\ruler@family\temp@% \def\third@{\tt\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg@top}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% \else \xdef\temp@{sf}% \ifx\ruler@family\temp@% \def\third@{\sf\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg@top}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% \else \xdef\temp@{rm}% \ifx\ruler@family\temp@% \def\third@{\rm\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\,\textcolor{\ruler@fg@top}{\ensuremath{\cdot}}\,\fourth@\hss}\end{rotopo}}% \fi\fi\fi \fi - \else - \ifnum\ruler@rot=0 % + \fi + \ifnum\top@bot=1 + \ifx\f@color\comm@\xdef\f@color{\ruler@fg@bottom}\fi + \ifnum\ruler@rot@bottom=0% \xdef\temp@{tt}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg}{.}}{\mathtt{\fourth@}}}}% + \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg@bottom}{.}}{\mathtt{\fourth@}}}}% \else \xdef\temp@{sf}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg}{.}}{\mathsf{\fourth@}}}}% + \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg@bottom}{.}}{\mathsf{\fourth@}}}}% \else \xdef\temp@{rm}% \ifx\ruler@family\temp@% - \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg}{.}}{\mathrm{\fourth@}}}}% + \def\third@{\bottomruler@size\ensuremath{\,\stackrel{\textcolor{\ruler@fg@bottom}{.}}{\mathrm{\fourth@}}}}% \fi\fi\fi \else \xdef\temp@{tt}% \ifx\ruler@family\temp@% \def\third@{\tt\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg@bottom}{\ensuremath{\cdot}}}\end{rotopo}}% \else \xdef\temp@{sf}% \ifx\ruler@family\temp@% \def\third@{\sf\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg@bottom}{\ensuremath{\cdot}}}\end{rotopo}}% \else \xdef\temp@{rm}% \ifx\ruler@family\temp@% \def\third@{\rm\bottomruler@size\,\,\,\,% - \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg}{\ensuremath{\cdot}}}\end{rotopo}}% + \begin{rotopo}{90}\hbox to \ruler@width{\hss\fourth@\,\textcolor{\ruler@fg@bottom}{\ensuremath{\cdot}}}\end{rotopo}}% \fi\fi\fi \fi \fi} @@ -18497,44 +18688,118 @@ \fi} \def\put@ruler{% - \ifnames@right% - \ifnumbers@left% - \ifnumbers@right% - \xdef\ruler@{)\ruler@)<>}% - \else% - \xdef\ruler@{)\ruler@<>}% - \fi% - \else% - \xdef\ruler@{\ruler@)<>}% - \fi% - \else% - \ifnumbers@left% - \ifnumbers@right% - \xdef\ruler@{<>)\ruler@)}% - \else% - \xdef\ruler@{<>)\ruler@}% - \fi% - \else% - \xdef\ruler@{<>\ruler@)}% - \fi% - \fi% + \ifx\rulernamecolor@top\n@\xdef\rulernamecolor@top{\ruler@fg@top}\fi% + \ifx\rulernamecolor@bottom\n@\xdef\rulernamecolor@bottom{\ruler@fg@bottom}\fi% + \ifx\rulername@family\n@\xdef\rulername@family{\ruler@family}\fi% + \ifx\rulername@size\n@\def\rulername@size{\bottomruler@size}\fi% \xdef\first@{\ruler@ @}% - \ifnum\rule@top=1% - \vspace{\ruler@sp@ce}% + \ifnum\top@bot=1% + \vspace{\ruler@sp@ce@bottom}% \vspace{-\baselineskip}% \newline\hbox{}% + \ifnames@right% + \else + \ifnum\ruler@rot@bottom=0% + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\tt\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\sf\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\rm\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \fi\fi\fi% + \else% + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\tt\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\sf\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\rm\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \fi\fi\fi% + \fi% + \fi% + \ifnumbers@left\hbox to \number@width{\hss\kern1em}\fi% \fi% - \ifnames@right\else\def\@kern{\kern0em}\expandafter\put@name\first@\fi% - \ifnumbers@left\def\@kern{\kern1em}\expandafter\put@number\first@\fi% - \vspace{-0.25\baselineskip}% - \ifnum\rule@top=0% - \vspace{\ruler@sp@ce}% + \vspace{-0.4\baselineskip}% + \ifnum\top@bot=0% + \ifnum\ruler@rot@top=90 \vspace{1.4\baselineskip}\fi% + \vspace{-0.58\baselineskip}% + \newline\hbox{}% + \ifnames@right% + \else + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \vbox{\tt\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \vbox{\sf\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \vbox{\rm\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \fi\fi\fi% + \fi% + \ifnumbers@left\hbox to \number@width{\hss\kern1em}\fi% + \vspace{-0.2\baselineskip}% + \vspace{\ruler@sp@ce@top}% \fi% - \fontfamily{\ruler@family}% - \fontseries{m}% - \fontshape{n}% - \selectfont% \innerloopcount=1\relax\put@rulechar% + \ifnames@right% + \kern1em% + \ifnumbers@left\else\hbox to \number@width{\hss}\fi% + \ifnum\top@bot=1% + \ifnum\ruler@rot@bottom=0% + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\tt\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\sf\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\rm\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}% + \fi\fi\fi% + \else% + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\tt\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\sf\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \hbox to \name@width{\raisebox{0.6\baselineskip}{\rm\rulername@size\textcolor{\rulernamecolor@bottom}{\rulername@bottom\hss}}}% + \fi\fi\fi% + \fi% + \else + \xdef\temp@{tt}% + \ifx\rulername@family\temp@% + \vbox{\tt\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \else + \xdef\temp@{sf}% + \ifx\rulername@family\temp@% + \vbox{\sf\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \else + \xdef\temp@{rm}% + \ifx\rulername@family\temp@% + \vbox{\rm\rulername@size\hbox to \name@width{\textcolor{\rulernamecolor@top}{\rulername@top\hss}}\vspace{-0.75\baselineskip}\hbox to \ruler@width{\hss}}% + \fi\fi\fi% + \fi% + \fi% \newline\hbox{}% } \def\get@firstfill#1#2&{\xdef\second@@{#1}\xdef\fill@char{#2&}} @@ -20689,7 +20954,7 @@ \else \iffix@\iftopfeature \vspace{\t@sp@ce}\newline\hbox{}\newline\hbox{}\fi\fi \fi - \ifnum\rule@num<0 \else \ifnum\rule@top=0 \loopcount=0 \put@ruler \fi\fi + \ifnum\rule@num@top<0 \else \ifnum\rule@top=1 \loopcount=0 \xdef\top@bot{0}\xdef\ruler@{\topruler@}\put@ruler\fi\fi \ifshow@logo\ifnum\logo@top=0 \xdef\last@{\stack@sequencelogo @}% \ifx\logo@name@user\ampers@nd\xdef\logo@name{logo}\else\xdef\logo@name{\logo@name@user}\fi @@ -20777,15 +21042,15 @@ \ifx\sublogo@name@user\ampers@nd\xdef\logo@name{subfamily}\else\xdef\logo@name{\sublogo@name@user}\fi \put@logo% \fi\fi% - \ifnum\rule@num<0 % + \ifnum\rule@num@bottom<0 % \else% - \ifnum\rule@top=1 % + \ifnum\rule@bottom=1 % \loopcount=0\relax% - \ifnum\ruler@rot=0 % + \ifnum\ruler@rot@bottom=0 % \else \vspace{\ruler@width}\vspace{-1.75\baselineskip}\newline\hbox{}% \fi - \put@ruler% - \ifnum\ruler@rot=0 \vspace{0.25\baselineskip}\fi% + \xdef\top@bot{1}\xdef\ruler@{\bottomruler@}\put@ruler% + \ifnum\ruler@rot@bottom=0 \vspace{0.25\baselineskip}\fi% \fi% \fi% \xdef\fe@turep@s{bottom}% @@ -20895,7 +21160,7 @@ \fi \fi \fi - \xdef\consensus{} \xdef\ruler@{} + \xdef\consensus{} \xdef\topruler@{} \xdef\bottomruler@{} \xdef\styleframe{} \xdef\textfeaturetop{} \xdef\textfeaturebottom{} \xdef\textfeaturettop{} \xdef\textfeaturebbottom{} @@ -21969,30 +22234,55 @@ \xdef\start@num{\the\loopcount} \fi \fi - \ifnum\rule@num>0 - \loopcount=\csname res@count\rule@num\endcsname - \divide\loopcount by \ruler@step - \multiply\loopcount by \ruler@step - \ifnum\loopcount<0 - \ifnum\ruler@step<3 - \advance\loopcount by \ruler@step + \ifnum\rule@num@top>0 + \loopcount=\csname res@count\rule@num@top\endcsname + \divide\loopcount by \ruler@step@top + \multiply\loopcount by \ruler@step@top + \ifnum\loopcount<0 + \ifnum\ruler@step@top<3 + \advance\loopcount by \ruler@step@top \fi - \else - \advance\loopcount by \ruler@step + \else + \advance\loopcount by \ruler@step@top \fi - \xdef\rule@tens{\the\loopcount} + \xdef\rule@tens@top{\the\loopcount} \else - \loopcount=\cons@count - \divide\loopcount by \ruler@step - \multiply\loopcount by \ruler@step - \ifnum\loopcount<0 - \ifnum\ruler@step<3 - \advance\loopcount by \ruler@step + \loopcount=\cons@count + \divide\loopcount by \ruler@step@top + \multiply\loopcount by \ruler@step@top + \ifnum\loopcount<0 + \ifnum\ruler@step@top<3 + \advance\loopcount by \ruler@step@top \fi - \else - \advance\loopcount by \ruler@step + \else + \advance\loopcount by \ruler@step@top + \fi + \xdef\rule@tens@top{\the\loopcount} + \fi + \ifnum\rule@num@bottom>0 + \loopcount=\csname res@count\rule@num@bottom\endcsname + \divide\loopcount by \ruler@step@bottom + \multiply\loopcount by \ruler@step@bottom + \ifnum\loopcount<0 + \ifnum\ruler@step@bottom<3 + \advance\loopcount by \ruler@step@bottom + \fi + \else + \advance\loopcount by \ruler@step@bottom + \fi + \xdef\rule@tens@bottom{\the\loopcount} + \else + \loopcount=\cons@count + \divide\loopcount by \ruler@step@bottom + \multiply\loopcount by \ruler@step@bottom + \ifnum\loopcount<0 + \ifnum\ruler@step@bottom<3 + \advance\loopcount by \ruler@step@bottom + \fi + \else + \advance\loopcount by \ruler@step@bottom \fi - \xdef\rule@tens{\the\loopcount} + \xdef\rule@tens@bottom{\the\loopcount} \fi \xdef\first@{top} \ifx\cap@pos\first@ @@ -22068,7 +22358,7 @@ \xdef\allow@zero{n} \xdef\c@ns@shift{0} \regionalshadefalse\regionalemphfalse\regionallowerfalse\regionaltintfalse \frame@false\shading@false -\xdef\ruler@rot{0} +\xdef\ruler@rot@top{0} \xdef\ruler@rot@bottom{0} \topfeaturefalse \bottomfeaturefalse \ttopfeaturefalse \bbottomfeaturefalse \tttopfeaturefalse \bbbottomfeaturefalse @@ -22119,7 +22409,7 @@ \xdef\ttt@sp@ce{0mm} \xdef\tttt@sp@ce{0mm} \xdef\b@sp@ce{0mm} \xdef\bb@sp@ce{0mm} \xdef\bbb@sp@ce{0mm} \xdef\bbbb@sp@ce{0mm} -\xdef\ruler@sp@ce{0mm} +\xdef\ruler@sp@ce@top{0mm} \xdef\ruler@sp@ce@bottom{0mm} \xdef\seq@gap@num{0} \xdef\h@ndalign{no} \xdef\sep@space{0pt} \xdef\c@pshort{n} diff --git a/macros/latex/contrib/texshade/texshade.ins b/macros/latex/contrib/texshade/texshade.ins index 47130a0699..5bc07c48c4 100644 --- a/macros/latex/contrib/texshade/texshade.ins +++ b/macros/latex/contrib/texshade/texshade.ins @@ -1,7 +1,7 @@ %% %% docstrip install file for texshade.sty %% -%% Copyright 1999-2023 Eric Beitz +%% Copyright 1999-2024 Eric Beitz %% \def\batchfile{texshade.ins} @@ -14,7 +14,7 @@ LaTeX package for typesetting nucleotide and peptide alignments -Copyright (C) 1999-2023 Eric Beitz +Copyright (C) 1999-2024 Eric Beitz See the file README \endpreamble diff --git a/macros/latex/contrib/texshade/texshade.pdf b/macros/latex/contrib/texshade/texshade.pdf Binary files differindex 01730abc59..2df2b88e3b 100644 --- a/macros/latex/contrib/texshade/texshade.pdf +++ b/macros/latex/contrib/texshade/texshade.pdf diff --git a/macros/latex/contrib/tutodoc/code/tdoc-locale-english.cfg.sty b/macros/latex/contrib/tutodoc/code/tdoc-locale-english.cfg.sty deleted file mode 100644 index 58d8975905..0000000000 --- a/macros/latex/contrib/tutodoc/code/tdoc-locale-english.cfg.sty +++ /dev/null @@ -1,17 +0,0 @@ -\NewDocumentCommand{\tdoc@trans@in@EN}{}{in \ english} -\NewDocumentCommand{\tdoc@trans@latex@show@start}{}{Start \ of \ the \ real \ output} -\NewDocumentCommand{\tdoc@trans@latex@show@end}{}{End \ of \ the \ real \ output} -\NewDocumentCommand{\tdoc@trans@this@gives}{}{This \ gives} -\NewDocumentCommand{\tdoc@trans@exa@title}{}{Example} -\NewDocumentCommand{\tdoc@trans@rmk@title}{}{Remark} -\NewDocumentCommand{\tdoc@trans@important@title}{}{Important} -\NewDocumentCommand{\tdoc@trans@warn@title}{}{Warning} -\NewDocumentCommand{\tdoc@trans@caution@title}{}{Caution} -\NewDocumentCommand{\tdoc@trans@note@title}{}{Note} -\NewDocumentCommand{\tdoc@trans@tip@title}{}{Tip} - -\NewDocumentCommand{\tdoc@trans@chges@new}{}{New} -\NewDocumentCommand{\tdoc@trans@chges@update}{}{Update} -\NewDocumentCommand{\tdoc@trans@chges@fix}{}{Fix} - -\NewDocumentCommand{\tdoc@trans@date}{ mmm }{#1-#2-#3} diff --git a/macros/latex/contrib/tutodoc/code/tdoc-locale-french.cfg.sty b/macros/latex/contrib/tutodoc/code/tdoc-locale-french.cfg.sty deleted file mode 100644 index 2973757dd8..0000000000 --- a/macros/latex/contrib/tutodoc/code/tdoc-locale-french.cfg.sty +++ /dev/null @@ -1,17 +0,0 @@ -\NewDocumentCommand{\tdoc@trans@in@EN}{}{en \ anglais} -\NewDocumentCommand{\tdoc@trans@latex@show@start}{}{Début \ du \ rendu \ réel} -\NewDocumentCommand{\tdoc@trans@latex@show@end}{}{Fin \ du \ rendu \ réel} -\NewDocumentCommand{\tdoc@trans@this@gives}{}{Ceci \ donne} -\NewDocumentCommand{\tdoc@trans@exa@title}{}{Exemple} -\NewDocumentCommand{\tdoc@trans@rmk@title}{}{Remarque} -\NewDocumentCommand{\tdoc@trans@important@title}{}{Important} -\NewDocumentCommand{\tdoc@trans@warn@title}{}{Avertissement} -\NewDocumentCommand{\tdoc@trans@caution@title}{}{Prudence} -\NewDocumentCommand{\tdoc@trans@note@title}{}{Note} -\NewDocumentCommand{\tdoc@trans@tip@title}{}{Astuce} - -\NewDocumentCommand{\tdoc@trans@chges@new}{}{Nouveau} -\NewDocumentCommand{\tdoc@trans@chges@update}{}{Mise \ à \ jour} -\NewDocumentCommand{\tdoc@trans@chges@fix}{}{Réparation} - -\NewDocumentCommand{\tdoc@trans@date}{ mmm }{#3/#2/#1} diff --git a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty new file mode 100644 index 0000000000..339f10240c --- /dev/null +++ b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty @@ -0,0 +1,17 @@ +\NewDocumentCommand{\tutodoc@trans@date}{mmm}{#1-#2-#3} +\NewDocumentCommand{\tutodoc@trans@in@EN}{m}{#1 ~ in ~ english} +\NewDocumentCommand{\tutodoc@trans@this@gives}{m}{This ~ gives ~ #1} +\NewDocumentCommand{\tutodoc@trans@latex@show@start}{}{Start ~ of ~ the ~ real ~ output} +\NewDocumentCommand{\tutodoc@trans@latex@show@end}{}{End ~ of ~ the ~ real ~ output} +\NewDocumentCommand{\tutodoc@trans@exa@title}{}{Example} +\NewDocumentCommand{\tutodoc@trans@rmk@title}{}{Remark} +\NewDocumentCommand{\tutodoc@trans@note@title}{}{Note} +\NewDocumentCommand{\tutodoc@trans@tip@title}{}{Tip} +\NewDocumentCommand{\tutodoc@trans@important@title}{}{Important} +\NewDocumentCommand{\tutodoc@trans@caution@title}{}{Caution} +\NewDocumentCommand{\tutodoc@trans@warn@title}{}{Warning} +\NewDocumentCommand{\tutodoc@trans@chges@pb}{}{Problem} +\NewDocumentCommand{\tutodoc@trans@chges@break}{}{Break} +\NewDocumentCommand{\tutodoc@trans@chges@fix}{}{Fix} +\NewDocumentCommand{\tutodoc@trans@chges@new}{}{New} +\NewDocumentCommand{\tutodoc@trans@chges@update}{}{Update}
\ No newline at end of file diff --git a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty new file mode 100644 index 0000000000..c639e1e9e0 --- /dev/null +++ b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty @@ -0,0 +1,17 @@ +\NewDocumentCommand{\tutodoc@trans@date}{mmm}{#3/#2/#1} +\NewDocumentCommand{\tutodoc@trans@in@EN}{m}{#1 ~ en ~ anglais} +\NewDocumentCommand{\tutodoc@trans@this@gives}{m}{Ceci ~ donne ~ #1} +\NewDocumentCommand{\tutodoc@trans@latex@show@start}{}{Début ~ du ~ rendu ~ réel} +\NewDocumentCommand{\tutodoc@trans@latex@show@end}{}{Fin ~ du ~ rendu ~ réel} +\NewDocumentCommand{\tutodoc@trans@exa@title}{}{Exemple} +\NewDocumentCommand{\tutodoc@trans@rmk@title}{}{Remarque} +\NewDocumentCommand{\tutodoc@trans@note@title}{}{Note} +\NewDocumentCommand{\tutodoc@trans@tip@title}{}{Astuce} +\NewDocumentCommand{\tutodoc@trans@important@title}{}{Important} +\NewDocumentCommand{\tutodoc@trans@caution@title}{}{Caution} +\NewDocumentCommand{\tutodoc@trans@warn@title}{}{Danger} +\NewDocumentCommand{\tutodoc@trans@chges@pb}{}{Problème} +\NewDocumentCommand{\tutodoc@trans@chges@break}{}{Bifurcation} +\NewDocumentCommand{\tutodoc@trans@chges@fix}{}{Réparation} +\NewDocumentCommand{\tutodoc@trans@chges@new}{}{Nouveau} +\NewDocumentCommand{\tutodoc@trans@chges@update}{}{Mise ~ à ~ jour}
\ No newline at end of file diff --git a/macros/latex/contrib/tutodoc/code/tutodoc.sty b/macros/latex/contrib/tutodoc/code/tutodoc.sty index cd4a6aecb3..5e0ea7a0fb 100644 --- a/macros/latex/contrib/tutodoc/code/tutodoc.sty +++ b/macros/latex/contrib/tutodoc/code/tutodoc.sty @@ -1,7 +1,7 @@ % ------------------------------------------------------- % % - This is file `tutodoc.sty' generated automatically. - % % - - % -% - Copyright (C) 2023 by Christophe BAL - % +% - Copyright (C) 2023-2024 by Christophe BAL - % % - - % % - This file may be distributed and/or modified under - % % - the conditions of the GNU 3 License. - % @@ -9,8 +9,8 @@ \ProvidesExplPackage {tutodoc} - {2023-12-08} % Creation: 2023-11-29 - {1.0.1} + {2024-01-06} % Creation: 2023-11-29 + {1.1.0} {This package proposes tools for writing "human friendly" documentations of LaTeX packages.} \RequirePackage[ @@ -88,18 +88,18 @@ % -- LOCALE SETTINGS -- % -\NewDocumentCommand{\tdoc@colon}{}{:} +\NewDocumentCommand{\tutodoc@colon}{}{:} % We must take care of the colons, babel and spacing. \@ifpackageloaded{babel}{ \iflanguage{french}{ - \RenewDocumentCommand{\tdoc@colon}{}{\babelshorthand{:}} + \RenewDocumentCommand{\tutodoc@colon}{}{\babelshorthand{:}} }{} }{} \ExplSyntaxOn -\input{tdoc-locale-\l_tdoc_opt_lang_str.cfg.sty} +\input{tutodoc-locale-main-\l_tdoc_opt_lang_str.cfg.sty} \ExplSyntaxOff @@ -199,7 +199,7 @@ \NewDocumentCommand{\tdocinEN}{s m}{% \tdocquote{#2}% \IfBooleanF{#1}{% No star used. - \ \tdoc@trans@in@EN{}% + \ \tutodoc@trans@in@EN{}% }% } @@ -212,7 +212,7 @@ % See the \doc of the macro ''\newtheorem'' from the package ''amsthm'' % to have \infos about the environment ''@@tdocexa@nb''. %%% -\newtheorem{@@tdocexa@nb}{\tdoc@trans@exa@title}% +\newtheorem{@@tdocexa@nb}{\tutodoc@trans@exa@title}% [subsubsection] %%% @@ -226,7 +226,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''@@tdocexa@no@nb''. %%% -\newtheorem*{@@tdocexa@no@nb}{\tdoc@trans@exa@title} +\newtheorem*{@@tdocexa@no@nb}{\tutodoc@trans@exa@title} % :: EXAMPLE - PUBLIC VERSION :: % @@ -268,7 +268,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdocrem''. %%% -\newtheorem*{tdocrem}{\tdoc@trans@rmk@title} +\newtheorem*{tdocrem}{\tutodoc@trans@rmk@title} % :: IMPORTANT :: % @@ -277,7 +277,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdocimportant''. %%% -\newtheorem*{tdocimportant}{\tdoc@trans@important@title} +\newtheorem*{tdocimportant}{\tutodoc@trans@important@title} % :: NOTE :: % @@ -286,7 +286,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdocnote''. %%% -\newtheorem*{tdocnote}{\tdoc@trans@note@title} +\newtheorem*{tdocnote}{\tutodoc@trans@note@title} % :: TIP :: % @@ -295,7 +295,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdoctip''. %%% -\newtheorem*{tdoctip}{\tdoc@trans@tip@title} +\newtheorem*{tdoctip}{\tutodoc@trans@tip@title} % :: CUATION :: % @@ -304,7 +304,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdoccaution''. %%% -\newtheorem*{tdoccaution}{\tdoc@trans@caution@title} +\newtheorem*{tdoccaution}{\tutodoc@trans@caution@title} % :: WARNING :: % @@ -313,7 +313,7 @@ % See the \doc of the macro ''\newtheorem*'' from the package ''amsthm'' % to have \infos about the environment ''tdocwarn''. %%% -\newtheorem*{tdocwarn}{\tdoc@trans@warn@title} +\newtheorem*{tdocwarn}{\tutodoc@trans@warn@title} % -- NAMES OF PACKAGES, MACROS & ENVIRONMENTS -- % @@ -563,9 +563,9 @@ \keys_define:nn { tdoc/showcase } { % Texts. before .tl_set:N = \l_tdoc_showcase_before_tl, - before .initial:n = \tdoc@trans@latex@show@start, + before .initial:n = \tutodoc@trans@latex@show@start, after .tl_set:N = \l_tdoc_showcase_after_tl, - after .initial:n = \tdoc@trans@latex@show@end, + after .initial:n = \tutodoc@trans@latex@show@end, % Decorations. color .tl_set:N = \l_tdoc_showcase_color_tl, color .initial:n = cyan, @@ -644,7 +644,7 @@ % See the \doc of the macro ''\newmintinline'' from the package ''minted'' % to have \infos about the macro ''tdocinlatex''. %%% -\newmintinline[tdocinlatex]{latex}{} +\newmintinline[tdocinlatex]{latex}{bgcolor = yellow!4} % :: SHORTCUTS FOR TCOLORBOX LISTING FORMATING :: % @@ -662,7 +662,7 @@ % % See the pgfkeys package documentation for explanation. %%% -\NewExpandableDocumentCommand{\tdoc@latex@listing@formating}{ m }{ +\NewExpandableDocumentCommand{\tutodoc@latex@listing@formating}{ m }{ \str_case:nnF { #1 } { { sbs } { listing ~ side ~ text } { code } { listing ~ only } @@ -721,7 +721,7 @@ % ''tcolorbox'' to have \infos about the environment ''tdoclatex''. %%% \newtcblisting{tdoclatex}[1][std]{% - tdoclatex_tcbstyle = \tdoc@latex@listing@formating{#1} + tdoclatex_tcbstyle = \tutodoc@latex@listing@formating{#1} } @@ -738,7 +738,7 @@ %%% \newtcbinputlisting{\tdoclatexinput}[2][std]{ listing file = {#2}, - tdoclatex_tcbstyle = \tdoc@latex@listing@formating{#1} + tdoclatex_tcbstyle = \tutodoc@latex@listing@formating{#1} } @@ -758,7 +758,7 @@ %%% \keys_define:nn { tdoc/latexshow } { explain .tl_set:N = \l_tdoc_listing_explain_tl, - explain .initial:n = { \tdoc@trans@this@gives \tdoc@colon }, + explain .initial:n = { \tutodoc@trans@this@gives \tutodoc@colon }, } @@ -817,7 +817,7 @@ % % :see: \__tdoc_translate_date:n %%% -\NewDocumentCommand{\tdoc@new@change@margin}{m m m m}{ +\NewDocumentCommand{\tutodoc@new@change@margin}{m m m m}{ \marginnote{ \color{#1} \scriptsize @@ -866,11 +866,11 @@ %%% % prototype:: % :action: this function extracts year, month and day in something -% like ''YYYY-MM-DD'' and then it calls ''\tdoc@trans@date'' +% like ''YYYY-MM-DD'' and then it calls ''\tutodoc@trans@date'' % to use the format expected for a "localised" date. %%% \cs_new:Npn \__tdoc_translate_date_process:w #1 - #2 - #3 \q_stop { - \tdoc@trans@date{#1} + \tutodoc@trans@date{#1} {#2} {#3} } @@ -894,7 +894,7 @@ % of the language chosen when loading the package. %%% \NewDocumentCommand{\tdocversion}{O{blue} m O{}}{ - \tdoc@new@change@margin{#1} % Color + \tutodoc@new@change@margin{#1} % Color {#3} % Date {#2} % Version {-4.25pt} % Last negative vertical spacing @@ -912,7 +912,7 @@ % prints a date. %%% \NewDocumentCommand{\tdocdate}{O{blue} m}{ - \tdoc@new@change@margin{#1} % Color + \tutodoc@new@change@margin{#1} % Color {#2} % Date {} % Version {-5.35pt} % Last negative spacing @@ -962,7 +962,7 @@ % translated into the good language. %%% \NewDocumentEnvironment{tdocnew}{}{ - \begin{tdoctopic}{\tdoc@trans@chges@new} + \begin{tdoctopic}{\tutodoc@trans@chges@new} }{ \end{tdoctopic} } @@ -978,7 +978,39 @@ % translated into the good language. %%% \NewDocumentEnvironment{tdocupdate}{}{ - \begin{tdoctopic}{\tdoc@trans@chges@update} + \begin{tdoctopic}{\tutodoc@trans@chges@update} +}{ + \end{tdoctopic} +} + + +% :: CHANGES - BREAK :: % + +%%% +% prototype:: +% :see: env.tdoctopic +% +% :action: similar to the \env ''tdoctopic'' with the title "Break" +% translated into the good language. +%%% +\NewDocumentEnvironment{tdocbreak}{}{ + \begin{tdoctopic}{\tutodoc@trans@chges@break} +}{ + \end{tdoctopic} +} + + +% :: CHANGES - PROBLEM :: % + +%%% +% prototype:: +% :see: env.tdoctopic +% +% :action: similar to the \env ''tdoctopic'' with the title "Problem" +% translated into the good language. +%%% +\NewDocumentEnvironment{tdocprob}{}{ + \begin{tdoctopic}{\tutodoc@trans@chges@pb} }{ \end{tdoctopic} } @@ -994,7 +1026,7 @@ % translated into the good language. %%% \NewDocumentEnvironment{tdocfix}{}{ - \begin{tdoctopic}{\tdoc@trans@chges@fix} + \begin{tdoctopic}{\tutodoc@trans@chges@fix} }{ \end{tdoctopic} } @@ -1004,6 +1036,9 @@ % -- DECORATIONS -- % +% Source for \addvspace{\medskipamount} instead of \medskip. +% * https://tex.stackexchange.com/a/705938/6880 + %%% % prototype:: % :action: this macro draws a centered horizontal rule with a height @@ -1012,8 +1047,8 @@ % Extra vertical spaces are added above and below the rule. %%% \NewDocumentCommand{\tdocsep}{}{ - \medskip - \hfill\rule{0.5\textwidth}{0.75pt}\hfill + \par\addvspace{\medskipamount} + \hfill\rule{0.5\textwidth}{0.75pt}\hfill\null \medskip \smallskip } diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf b/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf Binary files differindex a83fc1915d..6124b97c99 100644 --- a/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf +++ b/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex b/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex index 8d628d7b4a..f6449b959c 100644 --- a/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex +++ b/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex @@ -1,27 +1,27 @@ - + % -------------------- % % -- RESOURCES USED -- % % -------------------- % \begin{filecontents*}[overwrite]{examples-focus-exa.tex} - Bla, bla, bla... +Bla, bla, bla... - \begin{tdocexa} - Ble, ble, ble... - \end{tdocexa} +\begin{tdocexa} + Ble, ble, ble... +\end{tdocexa} - \begin{tdocexa}[Wonderful] - Bli, bli, bli... - \end{tdocexa} +\begin{tdocexa}[Wonderful] + Bli, bli, bli... +\end{tdocexa} - \begin{tdocexa}<nonb> - Blo, blo, blo... - \end{tdocexa} +\begin{tdocexa}<nonb> + Blo, blo, blo... +\end{tdocexa} - \begin{tdocexa}<nonb>[Superb] - Blu, blu, blu... - \end{tdocexa} +\begin{tdocexa}<nonb>[Superb] + Blu, blu, blu... +\end{tdocexa} \end{filecontents*} @@ -119,7 +119,7 @@ \begin{tdocshowcase}[before = My beginning, after = My end, color = red] -Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla... + Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla... \end{tdocshowcase} \end{filecontents*} @@ -143,9 +143,8 @@ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla... before = My beginning, after = My end, color = green] -Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla... + Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla... \end{tdocshowcase} - \end{filecontents*} @@ -168,6 +167,13 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli... \end{filecontents*} +\begin{filecontents*}[overwrite]{examples-listing-strange-bis.tex} +\begin{tdoclatex} + \string[Strange... Or not!] +\end{tdoclatex} +\end{filecontents*} + + \begin{filecontents*}[overwrite]{examples-listing-xyz.tex} % Just one demo. $x y z = 1$ @@ -236,6 +242,22 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \end{filecontents*} +\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex} +\begin{tdocbreak} + \item Info 1... + \item Info 2... +\end{tdocbreak} +\end{filecontents*} + + +\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex} +\begin{tdocprob} + \item Info 1... + \item Info 2... +\end{tdocprob} +\end{filecontents*} + + \begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex} \begin{tdocfix} \item Info 1... @@ -244,8 +266,8 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \end{filecontents*} -\begin{filecontents*}[overwrite]{examples-version-n-change-topic.tex} -\begin{tdoctopic}{Unclassifiable changes} +\begin{filecontents*}[overwrite]{examples-version-n-change-unclassifiable.tex} +\begin{tdoctopic}{Unclassifiable} % This is where the point needs to be put. \item Info 1... \item Info 2... @@ -265,7 +287,6 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \usepackage[english]{babel, varioref} \usepackage{enumitem} -%\frenchsetup{StandardItemLabels=true} \usepackage{tabularray} \usepackage{fmtcount} @@ -324,12 +345,11 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \title{Le package \texttt{tutodoc} - Documentation de type tutoriel} \author{Christophe BAL} -\date{8th Dec. 2023 - Version 1.0.1} +\date{\ordinalnum{1} Jan. 2024 - Version 1.1.0} \maketitle \begin{abstract} -\noindent The \tdocpack{tutodoc} package \footnote{ The name comes from \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}}. @@ -340,15 +360,10 @@ is used by its author to semantically produce documentation of \LaTeX\ packages }, and with a sober rendering for reading on screen. -\medskip -\noindent -Two important points to note. -\begin{itemize} - \item This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package. - - \item This documentation is also available in French. -\end{itemize} +\begin{tdocnote} + This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package. +\end{tdocnote} \end{abstract} @@ -374,6 +389,7 @@ The \tdocpack{geometry} package is loaded with the following settings. ]{geometry} \end{tdoclatex} + \subsection{Title and table of contents} The \tdocpack{titlesec} and \tdocpack{tocbasic} packages are set as follows. @@ -495,9 +511,9 @@ The macro \tdocmacro{tdocinEN} and its starred version are based on \tdocmacro{t Numbered or unnumbered examples can be indicated using the \tdocenv{tdocexa} environment, which offers two optional arguments. \begin{enumerate} - \item The \ordinalnum{1} argument between brackets \verb#<...># can take the values \verb#nb# to number, which is the default setting, and \verb#nonb# to not number. + \item The \ordinalnum{1} argument between brackets \tdocinlatex#<...># can take the values \tdocinlatex#nb# to number, which is the default setting, and \tdocinlatex#nonb# to not number. - \item The \ordinalnum{2} argument in square brackets \verb#[...]# is used to add a mini-title.. + \item The \ordinalnum{2} argument in square brackets \tdocinlatex#[...]# is used to add a mini-title.. \end{enumerate} @@ -545,13 +561,13 @@ The \tdocenv{tdocnote} environment is used to highlight useful information. Here \tdoclatexinput[sbs]{examples-focus-note.tex} - \subsection{Something important} The \tdocenv{tdocimportant} environment is used to indicate something important but harmless. \tdoclatexinput[sbs]{examples-focus-important.tex} + \subsection{Caution about a delicate point} The \tdocenv{tdoccaution} environment is used to indicate a delicate point to the user. Here's how to use it. @@ -566,6 +582,7 @@ The \tdocenv{tdocwarn} environment is used to warn the user of a trap to avoid. \tdoclatexinput[sbs]{examples-focus-warn.tex} +\newpage \section{Specify packages, classes, macros or environments} Here's what you can type semantically. @@ -698,7 +715,7 @@ It is sometimes useful to render code directly in the documentation. This type o \begin{tdocwarn} - With the default settings, if the code to be formatted begins with an opening bracket, use \tdocmacro{string} as in the following example. the following example. + With the default settings, if the code to be formatted begins with an opening bracket, use \tdocmacro{string} as in the following example. \tdoclatexinput[code]{examples-showcase-hook.tex} @@ -769,7 +786,7 @@ To obtain renderings by importing the code from an external file, instead of typ \medskip - As for \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+ , this will produce the colour change shown below. + As for \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+\,, this will produce the colour change shown below. \medskip @@ -777,6 +794,7 @@ To obtain renderings by importing the code from an external file, instead of typ \end{tdocexa} +\newpage \section{Use cases in \LaTeX} Documenting a package or a class is done efficiently using use cases showing both the code and the corresponding result. @@ -789,7 +807,7 @@ Documenting a package or a class is done efficiently using use cases showing bot The \tdocmacro{tdocinlatex} macro \footnote{ - The name of the macro \tdocmacro{tdocinlatex} comes from \tdocquote{tdocprewhy{in.line} \LaTeX}. + The name of the macro \tdocmacro{tdocinlatex} comes from \tdocquote{\tdocprewhy{in.line} \LaTeX}. } can be used to type inline code in a similar way to \tdocmacro{verb}. Here are some examples. @@ -803,10 +821,11 @@ Here are some examples. \begin{tdocnote} - The \tdocmacro{tdocinlatex} macro can be used in a footnote: see the bottom of this page + The \tdocmacro{tdocinlatex} macro can be used in a footnote: see below. \footnote{ - \tdocinlatex+$minted = TOP$+ was typed \tdocinlatex|\tdocinlatex+$minted = TOP$+| in this footnote. + \tdocinlatex+$minted = TOP$+ has been typed \tdocinlatex|\tdocinlatex+$minted = TOP$+| in this footnote... }. + In addition, a background color is deliberately used to subtly highlight the codes \tdocinlatex#\LaTeX#\,. \end{tdocnote} @@ -854,6 +873,11 @@ Here are some examples. \begin{tdocwarn} With default formatting, if the code begins with an opening bracket, the default option must be explicitly indicated. \tdocdocbasicinput{examples-listing-strange.tex} + + \smallskip + + Another method is to use the \tdocmacro{string} primitive. + \tdocdocbasicinput{examples-listing-strange-bis.tex} \end{tdocwarn} @@ -865,7 +889,7 @@ For the following codes, consider a file with the relative path \verb+examples-l \medskip -The \tdocmacro{tdoclatexinput} macro, shown below, is used in the same way as the \tdocenv{tdoclatex} environment except that the path to a file is supplied. +The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file and offers the same options as the \tdocenv{tdoclatex} environment. % ------------------ % @@ -919,10 +943,11 @@ The \tdocmacro{tdoclatexinput} macro, shown below, is used in the same way as th % ------------------ % +\newpage \subsection{Imported codes put into practice} \label{tdoc-latexshow} \begin{tdocexa}[Showcase] - The following can be obtained via \tdocinlatex+\tdoclatexshow{examples-listing-xyz.tex}+. + The following comes from \tdocinlatex+\tdoclatexshow{examples-listing-xyz.tex}+. \medskip @@ -943,8 +968,7 @@ The \tdocmacro{tdoclatexinput} macro, shown below, is used in the same way as th \begin{tdocexa}[Changing the explanatory text] Using the key \tdocinlatex|explain|, you can use custom text. Thus, \tdocinlatex|tdoclatexshow[explain = Here is the actual rendering.]{examples-listing-xyz.tex}| will produce the following. - \newpage -% \medskip + \medskip \begin{tdoc-doc-showcase} \tdoclatexshow[explain = Here is the actual rendering.]{examples-listing-xyz.tex} @@ -1057,6 +1081,27 @@ during the latest changes. % ------------------ % +\begin{tdocexa}[For breaks] + \leavevmode + + \tdoclatexinput[sbs]{examples-version-n-change-break.tex} +\end{tdocexa} + + +% ------------------ % + + +\begin{tdocexa}[For problems] + \leavevmode + + \tdoclatexinput[sbs]{examples-version-n-change-pb.tex} +\end{tdocexa} + + +% ------------------ % + + +\newpage \begin{tdocexa}[For fixes] \leavevmode @@ -1070,9 +1115,10 @@ during the latest changes. \begin{tdocexa}[Chosen topics] \leavevmode - \tdoclatexinput[sbs]{examples-version-n-change-topic.tex} + \tdoclatexinput[sbs]{examples-version-n-change-unclassifiable.tex} \end{tdocexa} + \section{Ornaments} Let's finish this documentation with a few small formatting tools that can be very useful. @@ -1083,6 +1129,16 @@ Bla, bla, bla... \tdocsep % Practical for demarcation. +This works with enumerations. + +\begin{itemize} + \item Underline. + + \item Something else useful. +\end{itemize} + +\tdocsep % Uniform behaviour. + Ble, ble, ble... Bli, bli, bli... @@ -1095,18 +1151,31 @@ Blo, blo, blo... Blu, blu, blu... \end{tdoclatex} +\newpage +\section{History} +\tdocversion{1.1.0}[2024-01-06] +\begin{tdocnew} + \item Change log : two new environments. + \begin{enumerate} + \item \tdocenv{tdocbreak} for breaking changes which are not backward compatible. -\newpage -\section{History} + \item \tdocenv{tdocprob} for identified problems. + \end{enumerate} + + \item \tdocmacro{tdocinlatex}: a light yellow is used as the background color. +\end{tdocnew} + +\tdocsep \tdocversion{1.0.1}[2023-12-08] \begin{tdocfix} \item \tdocmacro{tdocenv}: spacing is now correct, even if the \tdocpack{babel} package is not loaded with the French language. - \item \tdocenv[{[nostripe]}]{showcase}: page breaks around the rulers are no longer possible.\end{tdocfix} + \item \tdocenv[{[nostripe]}]{tdocshowcase}: page breaks around \tdocquote{framing} lines should be rare from now on. +\end{tdocfix} \tdocsep @@ -1115,3 +1184,4 @@ Blu, blu, blu... First public version of the project. \end{document} +
\ No newline at end of file diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf Binary files differindex 3b37329ef4..a8691e1e8d 100644 --- a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf +++ b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex index ef86f8a9bc..ae9f99c300 100644 --- a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex +++ b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex @@ -167,6 +167,13 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli... \end{filecontents*} +\begin{filecontents*}[overwrite]{examples-listing-strange-bis.tex} +\begin{tdoclatex} + \string[Étrange... Ou pas !] +\end{tdoclatex} +\end{filecontents*} + + \begin{filecontents*}[overwrite]{examples-listing-xyz.tex} % Juste une démo. $x y z = 1$ @@ -235,6 +242,22 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \end{filecontents*} +\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex} +\begin{tdocbreak} + \item Info 1... + \item Info 2... +\end{tdocbreak} +\end{filecontents*} + + +\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex} +\begin{tdocprob} + \item Info 1... + \item Info 2... +\end{tdocprob} +\end{filecontents*} + + \begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex} \begin{tdocfix} \item Info 1... @@ -243,8 +266,8 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \end{filecontents*} -\begin{filecontents*}[overwrite]{examples-version-n-change-topic.tex} -\begin{tdoctopic}{Des changements inclassables} +\begin{filecontents*}[overwrite]{examples-version-n-change-unclassifiable.tex} +\begin{tdoctopic}{Inclassable} % Ici le point s'impose. \item Info 1... \item Info 2... @@ -269,7 +292,6 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... % Package documented. \usepackage[lang = french]{tutodoc} -\setlength{\parindent}{0em} % Source. % * https://tex.stackexchange.com/a/604698/6880 @@ -319,12 +341,11 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble... \title{Le package \texttt{tutodoc} - Documentation de type tutoriel} \author{Christophe BAL} -\date{8 Déc. 2023 - Version 1.0.1} +\date{1\ier{} Janv. 2024 - Version 1.1.0} \maketitle \begin{abstract} -\noindent Le package \tdocpack{tutodoc} \footnote{ Le nom vient de \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}} se traduit en \tdocquote{documentation de type tutoriel}. @@ -335,24 +356,15 @@ est utilisé par son auteur pour produire de façon sémantique des documentatio }, et avec un rendu sobre pour une lecture sur écran. -\medskip - -\noindent -Deux points importants à noter. -\begin{itemize} - \item Ce package impose un style de mise en forme. Dans un avenir plus ou moins proche, \tdocpack{tutodoc} sera sûrement éclaté en une classe et un package. - - \item Cette documentation est aussi disponible en anglais. -\end{itemize} - - -% ------------------ % +\begin{tdocnote} + Ce package impose un style de mise en forme. + Dans un avenir plus ou moins proche, \tdocpack{tutodoc} sera sûrement éclaté en une classe et un package. +\end{tdocnote} \tdocsep -{\noindent -\small\itshape +{\small\itshape \textbf{Abstract.} The \tdocpack{tutodoc} package \footnote{ @@ -364,15 +376,10 @@ is used by its author to semantically produce documentation of \LaTeX\ packages }, and with a sober rendering for reading on screen. -\medskip -\noindent -Two important points to note. -\begin{itemize} - \item This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package. - - \item This documentation is also available in French. -\end{itemize} +\begin{tdocnote} + This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package. +\end{tdocnote} } \end{abstract} @@ -521,9 +528,9 @@ La macro \tdocmacro{tdocinEN} et sa version étoilée s'appuient sur \tdocmacro{ Des exemples numérotés, ou non, s'indiquent via l'environnement \tdocenv{tdocexa} qui propose deux arguments optionnels. \begin{enumerate} - \item Le 1\ier{} argument entre chevrons \verb#<...># peut prendre au choix les valeurs \verb#nb# pour numéroter, réglage par défaut, et \verb#nonb# pour ne pas numéroter. + \item Le 1\ier{} argument entre chevrons \tdocinlatex#<...># peut prendre au choix les valeurs \tdocinlatex#nb# pour numéroter, réglage par défaut, et \tdocinlatex#nonb# pour ne pas numéroter. - \item Le 2\ieme{} argument entre crochets \verb#[...]# sert à ajouter un mini-titre. + \item Le 2\ieme{} argument entre crochets \tdocinlatex#[...]# sert à ajouter un mini-titre. \end{enumerate} @@ -795,7 +802,7 @@ Pour obtenir des rendus en important le code depuis un fichier externe, au lieu \medskip - Quant à \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+ , ceci produira le changement de couleur observable ci-après. + Quant à \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+\,, ceci produira le changement de couleur observable ci-après. \medskip @@ -829,10 +836,11 @@ Voici des exemples d'utilisation. \begin{tdocnote} - La macro \tdocmacro{tdocinlatex} est utilisable dans une note de pied de page : voir le bas de cette page + La macro \tdocmacro{tdocinlatex} est utilisable dans une note de pied de page : voir plus bas \footnote{ \tdocinlatex+$minted = TOP$+ a été tapé \tdocinlatex|\tdocinlatex+$minted = TOP$+| dans cette note de bas de page.. }. + De plus, une couleur de fond est volontairement utilisée pour subtilement faire ressortir les codes \tdocinlatex#\LaTeX#\,. \end{tdocnote} @@ -881,6 +889,11 @@ Voici des exemples d'utilisation. \begin{tdocwarn} Avec la mise en forme par défaut, si le code commence par un crochet ouvrant, il faudra indiquer explicitement l'option par défaut. \tdocdocbasicinput{examples-listing-strange.tex} + + \smallskip + + Une autre méthode consiste à utiliser la primitive \tdocmacro{string}. + \tdocdocbasicinput{examples-listing-strange-bis.tex} \end{tdocwarn} @@ -892,13 +905,12 @@ Pour les codes suivants, on considère un fichier de chemin relatif \verb+exampl \medskip -La macro \tdocmacro{tdoclatexinput} , présentée ci-après, s'utilise comme l'environnement \tdocenv{tdoclatex} excepté que l'on fournit le chemin d'un fichier. +La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'un fichier et propose les mêmes options que l'environnement \tdocenv{tdoclatex}. % ------------------ % -\newpage \begin{tdocexa}[Face à face] \leavevmode @@ -1067,7 +1079,6 @@ On peut au choix dater quelque chose, ou bien le versionner, dans ce second cas lors des derniers changements. -\newpage \begin{tdocexa}[Pour les nouveautés] \leavevmode @@ -1088,6 +1099,26 @@ lors des derniers changements. % ------------------ % +\begin{tdocexa}[Pour les bifurcations] + \leavevmode + + \tdoclatexinput[sbs]{examples-version-n-change-break.tex} +\end{tdocexa} + + +% ------------------ % + + +\begin{tdocexa}[Pour les problèmes] + \leavevmode + + \tdoclatexinput[sbs]{examples-version-n-change-pb.tex} +\end{tdocexa} + + +% ------------------ % + + \begin{tdocexa}[Pour les réparations] \leavevmode @@ -1101,10 +1132,11 @@ lors des derniers changements. \begin{tdocexa}[Thématiques aux choix] \leavevmode - \tdoclatexinput[sbs]{examples-version-n-change-topic.tex} + \tdoclatexinput[sbs]{examples-version-n-change-unclassifiable.tex} \end{tdocexa} +\newpage \section{Décorations} Finissons cette documentation avec de petites outils de mise en forme pouvant rendre de grands services. @@ -1115,6 +1147,16 @@ Bla, bla, bla... \tdocsep % Pratique pour délimiter. +Ceci fonctionne avec des énumérations. + +\begin{itemize} + \item Point souligné. + + \item Autre chose utile. +\end{itemize} + +\tdocsep % Un comportement uniforme. + Ble, ble, ble... Bli, bli, bli... @@ -1127,16 +1169,30 @@ Blo, blo, blo... Blu, blu, blu... \end{tdoclatex} - \newpage \section{Historique} +\tdocversion{1.1.0}[2024-01-06] + +\begin{tdocnew} + \item Journal des changements : deux nouveaux environnements. + \begin{enumerate} + \item \tdocenv{tdocbreak} pour les \tdocquote{bifurcations}\,, soit les modifications non rétrocompatibles. + + \item \tdocenv{tdocprob} pour les problèmes repérés. + \end{enumerate} + + \item \tdocmacro{tdocinlatex}: un jaune léger est utilisé comme couleur de fond. +\end{tdocnew} + +\tdocsep + \tdocversion{1.0.1}[2023-12-08] \begin{tdocfix} \item \tdocmacro{tdocenv}: l'espacement est maintenant correct, même si le paquet \tdocpack{babel} n'est pas chargé avec la langue française. - \item \tdocenv[{[nostripe]}]{showcase}: les sauts de page autour des règles ne sont plus possibles. + \item \tdocenv[{[nostripe]}]{tdocshowcase}: les sauts de page autour des lignes \tdocquote{cadrantes} devraient être rares dorénavant. \end{tdocfix} \tdocsep diff --git a/macros/latex/contrib/ukbill/README b/macros/latex/contrib/ukbill/README index 1b7de43e75..eee87a03d6 100644 --- a/macros/latex/contrib/ukbill/README +++ b/macros/latex/contrib/ukbill/README @@ -1,6 +1,6 @@ ukbill - easily typeset UK legislation -version: 1.0.2 +version: 1.2 This package provides formatting to easily typeset draft UK legislation. The libre font Palatine Parliamentary is required to use this class: https://github.com/ezgranet/palatine-parliamentary @@ -12,6 +12,8 @@ For suggestions, feature requests, and bug reports, please use the project's GitHub site: https://github.com/ezgranet/ukbill Version history: +06/01/2024: v 1.2 fixed issues with macros not being properly used in template environment + 13/12/2022: v 1.0.2 fixed indent with nostat environment 12/12/2022: v 1.0.1 fixed errors in sample bill—no substantive changes to package diff --git a/macros/latex/contrib/ukbill/immigration-bill.pdf b/macros/latex/contrib/ukbill/immigration-bill.pdf Binary files differindex 7e2ebf234a..8ebc864b30 100644 --- a/macros/latex/contrib/ukbill/immigration-bill.pdf +++ b/macros/latex/contrib/ukbill/immigration-bill.pdf diff --git a/macros/latex/contrib/ukbill/immigration-bill.tex b/macros/latex/contrib/ukbill/immigration-bill.tex index d194f25ef4..e6ec02f011 100644 --- a/macros/latex/contrib/ukbill/immigration-bill.tex +++ b/macros/latex/contrib/ukbill/immigration-bill.tex @@ -3,6 +3,9 @@ \billcopyright{\ccbysa\, This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International Licence.} \publishedby{the drafter} \billtitle{Commonwealth (Designated Realms) Bill} +\billday{5} +\billmonth{March} +\billyear{2024} \billto{Make provision in connection with citizens of certain Commonwealth Realms.} \humanrights{\printdrafter\ has made the following statement, which a minister would be obliged to give under section 19(1)(a), of the Human Rights Act 1998: \vspace{1ex} diff --git a/macros/latex/contrib/ukbill/ukbill-documentation.pdf b/macros/latex/contrib/ukbill/ukbill-documentation.pdf Binary files differindex 0ea80331cf..87b172449d 100644 --- a/macros/latex/contrib/ukbill/ukbill-documentation.pdf +++ b/macros/latex/contrib/ukbill/ukbill-documentation.pdf diff --git a/macros/latex/contrib/ukbill/ukbill-documentation.tex b/macros/latex/contrib/ukbill/ukbill-documentation.tex index a4577f8c76..f8f1de1635 100644 --- a/macros/latex/contrib/ukbill/ukbill-documentation.tex +++ b/macros/latex/contrib/ukbill/ukbill-documentation.tex @@ -25,7 +25,7 @@ ItalicFont={Palatine Parliamentary Italic}]{Palatine Parliamentary Regular} \newcommand{\thebox}{{\boxy ▯}} %\usepackage[firstnumber=last]{fancyvrb} \usepackage{minted} -\date{\today\\\smallskip\ttfamily Version 1.0.2} +\date{\today\\\smallskip\ttfamily Version 1.2.0} \author{Elijah Z Granet\thanks{e-mail: \href{mailto:ezg21@cantab.ac.uk}{\ttfamily ezg21@cantab.ac.uk}}} \title{\texttt{ukbill}:\\A package for typesetting UK legislation} @@ -168,8 +168,8 @@ firstnumber=last ] {latex} \NeedsTeXFormat{LaTeX2e} -\def\ukbillversionnumber{1.0.3} -\ProvidesClass{ukbill}[2022-12-01 A Class for Legal Notes] +\def\ukbillversionnumber{1.2.0} +\ProvidesClass{ukbill}[2024-01-06 A Class for UK legislation] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -200,6 +200,41 @@ firstnumber=last \end{center} \addcontentsline{toc}{chapter}{\rule{.45\textwidth}{1pt}} } +%\RequirePackage{datetime2} +%\DTMlangsetup[en-GB]{ord=omit} +\ExplSyntaxOn + +\NewExpandableDocumentCommand{\addordinal}{m} + {% #1 should be something that TeX interprets as an integer + \int_to_arabic:n { #1 } + \exp_args:Ne \ORDINAL { \deman_compute_suffix:n { #1 } } + } + +\NewDocumentCommand{\ORDINAL}{m}{\textsuperscript{\itshape #1}}% how ugly is it? + +\cs_new:Nn \deman_compute_suffix:n + { + \int_case:nnF { #1 } + {% special cases + {11}{th} + {12}{th} + {13}{th} + } + { \__deman_compute_suffix_normal:n { #1 } } + } + +\cs_new:Nn \__deman_compute_suffix_normal:n + { + \int_case:nnF { \int_mod:nn { #1 } { 10 } } + { + {1}{st} + {2}{nd} + {3}{rd} + } + {th} + } +\ExplSyntaxOff + %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -219,11 +254,23 @@ firstnumber=last \newcommand{\whereas}[1]{\def\@whereas{#1}} \newcommand{\printwhereas}{\@whereas} +%\newcommand{\billto}[1]{\def\@billto{#1}} + + \newcommand{\publishedby}[1]{\def\@publishedby{#1}} \newcommand{\printpublishedby}{\@publishedby} \def\@publishedby{\@latex@warning@no@line{No \noexpand\publishedby given}} \newcommand{\billtitle}[1]{\def\@billtitle{#1}} \newcommand{\printbilltitle}{\@billtitle} +\newcommand{\billday}[1]{\def\@billday{#1}} +\newcommand{\printbillday}{\@billday} +\def\@billday{\@latex@warning@no@line{No \noexpand\billday given}} +\newcommand{\billmonth}[1]{\def\@billmonth{#1}} +\newcommand{\printbillmonth}{\@billmonth} +\def\@billmonth{\@latex@warning@no@line{No \noexpand\billmonth given}} +\newcommand{\billyear}[1]{\def\@billyear{#1}} +\newcommand{\printbillyear}{\@billyear} +\def\@billyear{\@latex@warning@no@line{No \noexpand\billyear given}} \def\@billtitle{\@latex@warning@no@line{No \noexpand\billtitle given}} \newcommand{\humanrights}[1]{\def\@humanrights{#1}} \newcommand{\printhumanrights}{\@humanrights} @@ -496,7 +543,6 @@ BoldFont={PalatineP-Bold}, ItalicFont={PalatineP-Italic}, BoldItalicFont={PalatineP-BoldItalic}]{PalatineP-Regular} \newfontface{\extfont}[SmallCapsFont={Times New Roman}]{Times New Roman}}{\ClassWarning{Please install the Palatine Parliamentary Font}} - \RequirePackage[english]{babel} %\RequirePackage{csquotes} %\MakeOuterQuote{"} @@ -746,8 +792,7 @@ the authority of the same, as follows:― \vskip 3ex \end{center} -\normalsize To make provision in connection with the citizens of certain Commonwealth Realms - +\normalsize \printbillto \vskip 3ex \begin{center} @@ -759,7 +804,7 @@ the authority of the same, as follows:― \vspace{1ex} \begin{minipage}{.4\textwidth}\centering -\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, \normalfont 19\itshape th March \normalfont 2020\itshape. +\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, {\normalfont\addordinal{\printbillday}} \textit{\printbillmonth} \printbillyear. \end{minipage} \vspace{1ex} diff --git a/macros/latex/contrib/ukbill/ukbill.cls b/macros/latex/contrib/ukbill/ukbill.cls index ef19b7b602..36f393a5a9 100644 --- a/macros/latex/contrib/ukbill/ukbill.cls +++ b/macros/latex/contrib/ukbill/ukbill.cls @@ -1,6 +1,6 @@ \NeedsTeXFormat{LaTeX2e} -\def\ukbillversionnumber{1.0.3} -\ProvidesClass{ukbill}[2022-12-01 A Class for Legal Notes] +\def\ukbillversionnumber{1.2.0} +\ProvidesClass{ukbill}[2024-01-06 A Class for UK legislation] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -31,6 +31,41 @@ \end{center} \addcontentsline{toc}{chapter}{\rule{.45\textwidth}{1pt}} } +%\RequirePackage{datetime2} +%\DTMlangsetup[en-GB]{ord=omit} +\ExplSyntaxOn + +\NewExpandableDocumentCommand{\addordinal}{m} + {% #1 should be something that TeX interprets as an integer + \int_to_arabic:n { #1 } + \exp_args:Ne \ORDINAL { \deman_compute_suffix:n { #1 } } + } + +\NewDocumentCommand{\ORDINAL}{m}{\textsuperscript{\itshape #1}}% how ugly is it? + +\cs_new:Nn \deman_compute_suffix:n + { + \int_case:nnF { #1 } + {% special cases + {11}{th} + {12}{th} + {13}{th} + } + { \__deman_compute_suffix_normal:n { #1 } } + } + +\cs_new:Nn \__deman_compute_suffix_normal:n + { + \int_case:nnF { \int_mod:nn { #1 } { 10 } } + { + {1}{st} + {2}{nd} + {3}{rd} + } + {th} + } +\ExplSyntaxOff + %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -50,11 +85,23 @@ \newcommand{\whereas}[1]{\def\@whereas{#1}} \newcommand{\printwhereas}{\@whereas} +%\newcommand{\billto}[1]{\def\@billto{#1}} + + \newcommand{\publishedby}[1]{\def\@publishedby{#1}} \newcommand{\printpublishedby}{\@publishedby} \def\@publishedby{\@latex@warning@no@line{No \noexpand\publishedby given}} \newcommand{\billtitle}[1]{\def\@billtitle{#1}} \newcommand{\printbilltitle}{\@billtitle} +\newcommand{\billday}[1]{\def\@billday{#1}} +\newcommand{\printbillday}{\@billday} +\def\@billday{\@latex@warning@no@line{No \noexpand\billday given}} +\newcommand{\billmonth}[1]{\def\@billmonth{#1}} +\newcommand{\printbillmonth}{\@billmonth} +\def\@billmonth{\@latex@warning@no@line{No \noexpand\billmonth given}} +\newcommand{\billyear}[1]{\def\@billyear{#1}} +\newcommand{\printbillyear}{\@billyear} +\def\@billyear{\@latex@warning@no@line{No \noexpand\billyear given}} \def\@billtitle{\@latex@warning@no@line{No \noexpand\billtitle given}} \newcommand{\humanrights}[1]{\def\@humanrights{#1}} \newcommand{\printhumanrights}{\@humanrights} @@ -327,7 +374,6 @@ BoldFont={PalatineP-Bold}, ItalicFont={PalatineP-Italic}, BoldItalicFont={PalatineP-BoldItalic}]{PalatineP-Regular} \newfontface{\extfont}[SmallCapsFont={Times New Roman}]{Times New Roman}}{\ClassWarning{Please install the Palatine Parliamentary Font}} - \RequirePackage[english]{babel} %\RequirePackage{csquotes} %\MakeOuterQuote{"} @@ -577,8 +623,7 @@ the authority of the same, as follows:― \vskip 3ex \end{center} -\normalsize To make provision in connection with the citizens of certain Commonwealth Realms - +\normalsize \printbillto \vskip 3ex \begin{center} @@ -590,7 +635,7 @@ the authority of the same, as follows:― \vspace{1ex} \begin{minipage}{.4\textwidth}\centering -\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, \normalfont 19\itshape th March \normalfont 2020\itshape. +\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, {\normalfont\addordinal{\printbillday}} \textit{\printbillmonth} \printbillyear. \end{minipage} \vspace{1ex} diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index def9611a9d..55553c86e8 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 3.99 +## Babel 24.1 -2023-12-10 +2024-01-07 This package manages culturally-determined typographical (and other) rules, and hyphenation patterns for a wide range of languages. Many @@ -10,9 +10,9 @@ is a set of ini files for about 300 languages. The latest stable version is available on <https://ctan.org/pkg/babel>. -Changes in version 3.99 are described in: +Changes in version 24.1 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.99.html +https://latex3.github.io/babel/news/whats-new-in-babel-24.1.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,23 +48,11 @@ respective authors. ### Summary of latest changes ``` -3.99 2023-12-10 - * Spurious space in some cases because of a missing % (introduced - in 3.98). - * Two new locales: chakma and lowgerman. - * And more bare minimum locales: aramaic, avestan, aymara, - bashkir, bataktoba, bavarian, classicalmandaic, ingush, komi, - lepcha, limbu, lineara, lu, makasar, samaritan, sinteromani, - tainua, tangut, waray. - -3.98 2023-12-06 - * Case mappings in ini files, with new casing variants in the - Latin locales. - * New: \ShowLocaleProperties. - * Improved Persian/Farsi, thanks to Farshad Rasuli - (@farshadrasuli). - * In some languages and xetex, the language name was printed with - the first \foreignlanguage. +24.1 2024-01-07 + * New version numbering scheme. + * New key in \babelprovide: interchar (xe). + * Definitions for French interchar=punctuation.space (xe) and + transforms=punctuation.space (lua). ``` ### Previous changes diff --git a/macros/latex/required/babel/base/babel-code.pdf b/macros/latex/required/babel/base/babel-code.pdf Binary files differindex fad4043c77..d9b3837fe9 100644 --- a/macros/latex/required/babel/base/babel-code.pdf +++ b/macros/latex/required/babel/base/babel-code.pdf diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index aa4c096b0d..4bf1f3e84d 100644 --- a/macros/latex/required/babel/base/babel.dtx +++ b/macros/latex/required/babel/base/babel.dtx @@ -1,7 +1,7 @@ % \iffalse % This document requires lualatex %% -%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2024 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -32,7 +32,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2023/12/10 v3.99 The Babel package] +\ProvidesFile{babel.dtx}[2024/01/07 v24.1 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -90,17 +90,23 @@ localization}} \ExplSyntaxOn \newcommand\New[1]{% - \regex_extract_once:nnN{(\d\d?)\.(\d\d)}{#1}\bbltempa + \regex_extract_once:nnN{(\d\d?)\.(\d\d?)}{#1}\bbltempa \seq_pop_right:NN\bbltempa\bbltempb \seq_pop_right:NN\bbltempa\bbltempa \colorbox[rgb]{.92, .86, .73}% {New~#1% \quark_if_no_value:NTF\bbltempb{}% - {~\ifnum\bbltempa>2 \ifnum\bbltempb>34 + {~ + \ifnum\bbltempa>2 \ifnum\bbltempb>34 \href{https://latex3.github.io/babel/news/% whats-new-in-babel-\bbltempa.\bbltempb.html}% {\raisebox{.15ex}{$\oplus$}}% - \fi\fi}}\enspace\ignorespaces} + \fi\fi + \ifnum\bbltempa>23 + \href{https://latex3.github.io/babel/news/% + whats-new-in-babel-\bbltempa.\bbltempb.html}% + {\raisebox{.15ex}{$\oplus$}}% + \fi}}\enspace\ignorespaces} \ExplSyntaxOff \definecolor{thered}{rgb}{0.65,0.04,0.07} \definecolor{thegrey}{gray}{0.8} @@ -275,7 +281,8 @@ are highlighted with \New{X.XX}\hspace{-.5em} (\raisebox{.15ex}{$\oplus$} is a link to the \babel{} site), and there are some notes for the latest versions in \href{https://latex3.github.io/babel/}{the \babel{} site}. The most -recent features can be still unstable. +recent features can be still unstable. Remember version 24.1 follows +3.99, because of a new numbering scheme. \item[\sffamily\color{messages}Can I help?] Sure! If you are interested in the \TeX{} multilingual support, please join the @@ -1465,7 +1472,7 @@ Or also: \item[Hebrew] Niqqud marks seem to work in both engines, but depending on the font cantillation marks might be misplaced (\xetex{} or \luatex{} with Harfbuzz seems better). -\item[Devanagari] In \luatex{} and the the default renderer many fonts +\item[Devanagari] In \luatex{} and the default renderer many fonts work, but some others do not, the main issue being the ‘ra’. You may need to set explicitly the script to either |deva| or |dev2|, eg: \begin{verbatim} @@ -2972,7 +2979,7 @@ line breaking mode is not really ‘sloppy’ (in other words, overfull boxes are reported as usual). The second and the third are for the Arabic script. It sets the -linebreaking and justification method, which can be based on the the +linebreaking and justification method, which can be based on the \textsc{arabic tatweel} character or in the ‘justification alternatives’ OpenType table (\texttt{jalt}). For an explanation see the @@ -3628,6 +3635,9 @@ a non-syllabic preposition or conjunction into a non-breaking space.} \trans{Finnish}{prehyphen.nobreak}{Line breaks just after hyphens prepended to words are prevented, like in “pakastekaapit ja -arkut”.} +\trans{French}{punctuation.space}{Rules for proper spacing with +characters \textit{;:!?«»} are applied.} + \trans{Greek}{diaeresis.hyphen}{Removes the diaeresis above iota and upsilon if hyphenated just before. It works with the three variants.} @@ -3901,6 +3911,13 @@ current language. however, must be large enough for many uses). \end{warning} +\Describe{interchar=}{\meta{interchar-list}} + +\New{24.1} This key in |\babelprovide| activates predefined rules for +the ‘provided’ locale. Currently there is a set of rules for French +named |punctuation.space|, which applies proper spacing with characters +\textit{;:!?«»}. + \subsection{Selection based on BCP 47 tags} \label{bcp47} @@ -5678,8 +5695,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<<version=3.99>> -%<<date=2023/12/10>> +%<<version=24.1>> +%<<date=2024/01/07>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -10202,7 +10219,7 @@ wouldn’t exist. \bbl@vforeach{captions,date,import,main,script,language,% hyphenrules,linebreaking,justification,mapfont,maparabic,% mapdigits,intraspace,intrapenalty,onchar,transforms,alph,% - Alph,labels,labels*,calendar,date,casing}% + Alph,labels,labels*,calendar,date,casing,interchar}% {\bbl@csarg\let{KVP@##1}\@nnil}% \global\let\bbl@release@transforms\@empty \global\let\bbl@release@casing\@empty @@ -12872,9 +12889,17 @@ wouldn’t exist. \csname bbl@mod@\CurrentOption\endcsname \bbl@exp{\\\AtBeginDocument{% \\\bbl@usehooks@lang{\CurrentOption}{begindocument}{{\CurrentOption}}}}}% - {\bbl@error{% + {\IfFileExists{babel-#1.tex}% + {\def\bbl@tempa{% + .\\There is a locale ini file for this language.\\% + If it’s the main language, try adding `provide=*'\\% + to the babel package options}}% + {\let\bbl@tempa\empty}% + \bbl@error{% Unknown option '\CurrentOption'. Either you misspelled it\\% - or the language definition file \CurrentOption.ldf was not found}{% + or the language definition file \CurrentOption.ldf\\% + was not found% + \bbl@tempa}{% Valid options are, among others: shorthands=, KeepShorthandsActive,\\% activeacute, activegrave, noconfigs, safe=, main=, math=\\% headfoot=, strings=, config=, hyphenmap=, or a language name.}}} @@ -13954,6 +13979,18 @@ wouldn’t exist. % special case, hyphens are stored as |\bbl@upto|, to deal with ranges. % % \begin{macrocode} +\newcommand\IfBabelIntercharT[1]{% + \let\bbl@tempa\@gobble % Assume to ignore + \edef\bbl@tempb{\zap@space#1 \@empty}% + \ifx\bbl@KVP@interchar\@nnil\else + \bbl@replace\bbl@KVP@interchar{ }{,}% + \bbl@foreach\bbl@tempb{% + \bbl@xin@{,##1,}{,\bbl@KVP@interchar,}% + \ifin@ + \let\bbl@tempa\@firstofone + \fi}% + \fi + \bbl@tempa} \newcommand\babelcharclass[3]{% \EnableBabelHook{babel-interchar}% \bbl@csarg\newXeTeXintercharclass{xeclass@#2@#1}% @@ -14013,9 +14050,9 @@ wouldn’t exist. \bbl@exp{\\\bbl@for\\\bbl@tempb{\zap@space#4 \@empty}}{% \XeTeXinterchartoks \@nameuse{bbl@xeclass@\bbl@tempa @% - \bbl@ifunset{bbl@xeclass@\bbl@tempa @#2}{}{#2}} + \bbl@ifunset{bbl@xeclass@\bbl@tempa @#2}{}{#2}} % \@nameuse{bbl@xeclass@\bbl@tempb @% - \bbl@ifunset{bbl@xeclass@\bbl@tempb @#2}{}{#2}} + \bbl@ifunset{bbl@xeclass@\bbl@tempb @#2}{}{#2}} % = \expandafter{% \csname bbl@ic@\bbl@kv@label @#2\expandafter\endcsname \csname\zap@space bbl@xeinter@\bbl@kv@label @@ -14151,7 +14188,8 @@ wouldn’t exist. % \subsection{8-bit TeX} % % Which start just above, because some code is shared with \xetex. Now, -% 8-bit specific stuff. +% 8-bit specific stuff. If just one encoding has been declared, then +% asume no switching is necessary (1). % % \begin{macrocode} %<*texxet> @@ -14165,7 +14203,7 @@ wouldn’t exist. \bbl@foreach\bbl@tempe{% \def\bbl@tempd{##1}% Save last declared \advance\count@\@ne}% - \ifnum\count@>\@ne + \ifnum\count@>\@ne % (1) \getlocaleproperty*\bbl@tempa{#1}{identification/encodings}% \ifx\bbl@tempa\relax \let\bbl@tempa\@empty \fi \bbl@replace\bbl@tempa{ }{,}% diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index ab14e5ccb8..5c80152d15 100644 --- a/macros/latex/required/babel/base/babel.ins +++ b/macros/latex/required/babel/base/babel.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 2012-2023 Javier Bezos and Johannes L. Braams. +%% Copyright 2012-2024 Javier Bezos and Johannes L. Braams. %% Copyright 1989-2008 Johannes L. Braams and any individual authors %% listed elsewhere in this file. All rights reserved. %% @@ -26,7 +26,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %% -\def\filedate{2023/12/10} +\def\filedate{2024/01/07} \def\batchfile{babel.ins} \input docstrip.tex diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf Binary files differindex e17676a481..b28a330557 100644 --- a/macros/latex/required/babel/base/babel.pdf +++ b/macros/latex/required/babel/base/babel.pdf diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx index 7afefacc0a..e1de136111 100644 --- a/macros/latex/required/babel/base/bbcompat.dtx +++ b/macros/latex/required/babel/base/bbcompat.dtx @@ -30,7 +30,7 @@ % % \iffalse %<*dtx> -\ProvidesFile{bbcompat.dtx}[2023/12/10 v3.99] +\ProvidesFile{bbcompat.dtx}[2024/01/07 v24.1] %</dtx> % %% File 'bbcompat.dtx' diff --git a/macros/luatex/latex/pyluatex/README.md b/macros/luatex/latex/pyluatex/README.md index f753b5850d..3f7f30ebcc 100644 --- a/macros/luatex/latex/pyluatex/README.md +++ b/macros/luatex/latex/pyluatex/README.md @@ -35,7 +35,7 @@ $\sqrt{371} = \py{math.sqrt(371)}$ 2\. Compile using LuaLaTeX (shell escape is required) ``` -lualatex -shell-escape example.tex +lualatex --shell-escape example.tex ``` **Note:** PyLuaTeX starts Python 3 using the command `python3` by default. @@ -53,7 +53,7 @@ executed. For this reason, it is recommended to compile trusted documents only. ## License [LPPL 1.3c](http://www.latex-project.org/lppl.txt) for LaTeX code and -[MIT license](https://opensource.org/licenses/MIT) for Python and Lua code. +[MIT license](https://opensource.org/licenses/MIT) for Python and Lua code and other files. ## Further Information Author: Tobias Enderle diff --git a/macros/luatex/latex/pyluatex/example/beamer.tex b/macros/luatex/latex/pyluatex/example/beamer.tex index 3592a56922..804721df85 100644 --- a/macros/luatex/latex/pyluatex/example/beamer.tex +++ b/macros/luatex/latex/pyluatex/example/beamer.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/data-visualization.tex b/macros/luatex/latex/pyluatex/example/data-visualization.tex index 2d43cb946b..1a6869c8ad 100644 --- a/macros/luatex/latex/pyluatex/example/data-visualization.tex +++ b/macros/luatex/latex/pyluatex/example/data-visualization.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/matplotlib-external.tex b/macros/luatex/latex/pyluatex/example/matplotlib-external.tex index 9289d1c6d7..d4f4f2b1f5 100644 --- a/macros/luatex/latex/pyluatex/example/matplotlib-external.tex +++ b/macros/luatex/latex/pyluatex/example/matplotlib-external.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/matplotlib-pgf.tex b/macros/luatex/latex/pyluatex/example/matplotlib-pgf.tex index 9172bbe0de..990645aaf3 100644 --- a/macros/luatex/latex/pyluatex/example/matplotlib-pgf.tex +++ b/macros/luatex/latex/pyluatex/example/matplotlib-pgf.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/readme-custom-env.tex b/macros/luatex/latex/pyluatex/example/readme-custom-env.tex index 115299264e..d6dc87e440 100644 --- a/macros/luatex/latex/pyluatex/example/readme-custom-env.tex +++ b/macros/luatex/latex/pyluatex/example/readme-custom-env.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/readme-example.tex b/macros/luatex/latex/pyluatex/example/readme-example.tex index 63ba160ace..130e553eee 100644 --- a/macros/luatex/latex/pyluatex/example/readme-example.tex +++ b/macros/luatex/latex/pyluatex/example/readme-example.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/repl.tex b/macros/luatex/latex/pyluatex/example/repl.tex index fd56dbc91a..52aef0a358 100644 --- a/macros/luatex/latex/pyluatex/example/repl.tex +++ b/macros/luatex/latex/pyluatex/example/repl.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -57,7 +57,7 @@ square(5) \maketitle PyLuaTeX allows you to run and typeset Python code in an interactive console -or read–eval–print loop (REPL) fashion. Very much like in an interactive python session, +or read–eval–print loop (REPL) fashion. Very much like in an interactive Python session, code is prefixed with \verb|>>>| (or \verb|...| in case of multi-line commands) and the results are added to the output buffer automatically. diff --git a/macros/luatex/latex/pyluatex/example/sessions.tex b/macros/luatex/latex/pyluatex/example/sessions.tex index 49f49c4ddb..e6b071c30c 100644 --- a/macros/luatex/latex/pyluatex/example/sessions.tex +++ b/macros/luatex/latex/pyluatex/example/sessions.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/typesetting-example.tex b/macros/luatex/latex/pyluatex/example/typesetting-example.tex index 435c02973a..ade107e5fe 100644 --- a/macros/luatex/latex/pyluatex/example/typesetting-example.tex +++ b/macros/luatex/latex/pyluatex/example/typesetting-example.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/typesetting-listings.tex b/macros/luatex/latex/pyluatex/example/typesetting-listings.tex index 116ebc2fc8..e251fe86b2 100644 --- a/macros/luatex/latex/pyluatex/example/typesetting-listings.tex +++ b/macros/luatex/latex/pyluatex/example/typesetting-listings.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/example/typesetting-minted.tex b/macros/luatex/latex/pyluatex/example/typesetting-minted.tex index 760d1a1355..930f8018dd 100644 --- a/macros/luatex/latex/pyluatex/example/typesetting-minted.tex +++ b/macros/luatex/latex/pyluatex/example/typesetting-minted.tex @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py index 13256ba386..020412ff73 100644 --- a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py +++ b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py @@ -1,7 +1,7 @@ """ MIT License -Copyright (c) 2021-2023 Tobias Enderle +Copyright (c) 2021-2024 Tobias Enderle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/macros/luatex/latex/pyluatex/pyluatex.lua b/macros/luatex/latex/pyluatex/pyluatex.lua index c12faa5cc8..7ec06f8ea6 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.lua +++ b/macros/luatex/latex/pyluatex/pyluatex.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2021-2023 Tobias Enderle +Copyright (c) 2021-2024 Tobias Enderle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -22,7 +22,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] -require("lualibs-util-jsn") +require("lualibs") local socket = require("socket") pyluatex = pyluatex or { @@ -31,8 +31,6 @@ pyluatex = pyluatex or { session = "default" } -local dir_sep = package.config:sub(1,1) - -- status.filename: path to pyluatex.sty local folder = file.pathpart(file.collapsepath(status.filename, true)) local tcp = nil @@ -40,15 +38,13 @@ local tcp = nil local env_end = nil local env_lines = nil local parent_env = nil -local env_repl_mode = false -local env_success = true local last_code = nil local last_output = nil local function get_tex_file_folder() - for k, v in ipairs(arg) do - if not v:find("^%-") then + for _, v in ipairs(arg) do + if v:sub(1, 1) ~= "-" then local path = file.collapsepath(v, true) if lfs.isfile(path) then return file.pathpart(path) @@ -63,27 +59,26 @@ local function get_tex_file_folder() return nil end -local function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) +local function show_err(message) + tex.sprint("\\PackageError{PyLuaTeX}{" .. message .. "}{}") end -local function err_cmd(message) - return "\\PackageError{PyLuaTeX}{" .. message .. "}{}" +local function not_empty(str) + return str ~= nil and str ~= "" end function pyluatex.start(executable, local_imports) local script = file.join(folder, "pyluatex-interpreter.py") - local is_windows = dir_sep ~= "/" local cmd = "" if local_imports then local tex_file_folder = get_tex_file_folder() if tex_file_folder ~= nil then - cmd = " \"" .. tex_file_folder .. "\"" + cmd = ' "' .. tex_file_folder .. '"' end end - cmd = executable .. " \"" .. script .. "\"" .. cmd - if is_windows then + cmd = executable .. ' "' .. script .. '"' .. cmd + if os.type == "windows" then cmd = "start /B " .. cmd else cmd = cmd .. " &" @@ -92,15 +87,15 @@ function pyluatex.start(executable, local_imports) local port = f:read("*l") f:close() - function err(message) - tex.sprint(err_cmd("Python backend could not be started (" .. message .. ")")) + local function err(message) + show_err("Python backend could not be started (" .. message .. ")") end if port == nil then err("executable: " .. executable) return end - port = trim(port) + port = port:fullstrip() if port:match("^%d+$") == nil then err("invalid TCP port: " .. port) return @@ -121,26 +116,6 @@ local function request(data) return utilities.json.tolua(output) end -local function log_input(code) - texio.write_nl("PyLuaTeX input for session \"" .. pyluatex.session .. "\": " .. code) -end - -local function log_output(code) - texio.write_nl("PyLuaTeX output: " .. code) -end - -local function split_lines(str) - if str:sub(-1) ~= "\n" then - str = str .. "\n" - end - - local t = {} - for s in str:gmatch("(.-)\r?\n") do - table.insert(t, s) - end - return t -end - function pyluatex.execute(code, auto_print, write, repl_mode, store) local full_code if auto_print then @@ -149,77 +124,62 @@ function pyluatex.execute(code, auto_print, write, repl_mode, store) full_code = code end - if pyluatex.verbose then log_input(full_code) end - - local resp = request( - { - session = pyluatex.session, - code = full_code, - repl_mode = repl_mode, - ignore_errors = pyluatex.ignore_errors - } - ) - local output_lines = split_lines(resp.output) + local resp = request({ + session = pyluatex.session, + code = full_code, + repl_mode = repl_mode, + ignore_errors = pyluatex.ignore_errors + }) + local code_lines = code:splitlines() + local output_lines = resp.output:splitlines() if store then - last_code = split_lines(code) + last_code = code_lines last_output = output_lines end - if resp.success or pyluatex.ignore_errors then - if pyluatex.verbose or not resp.success then log_output(resp.output) end + if pyluatex.verbose or not resp.success then + texio.write_nl('PyLuaTeX input for session "' .. pyluatex.session .. + '": ' .. full_code) + texio.write_nl("PyLuaTeX output: " .. resp.output) + end - if write then - tex.print(output_lines) - end + if resp.success or pyluatex.ignore_errors then + if write then tex.print(output_lines) end else - if not pyluatex.verbose then log_input(full_code) end - log_output(resp.output) - if write then - tex.sprint(err_cmd("Python error (see above)")) - end + show_err("Python error (see above)") end - if resp.log_msg ~= "" then texio.write(resp.log_msg) end - - return resp.success + if not_empty(resp.log_msg) then texio.write(resp.log_msg) end end -function pyluatex.print_env() - if last_output ~= nil and (env_success or pyluatex.ignore_errors) then - tex.print(last_output) - end +function pyluatex.execute_env(write, repl_mode) + local code = table.concat(env_lines, "\n") + pyluatex.execute(code, false, write, repl_mode, true) end local function record_line(line) - local s, e = line:find(env_end, 1, true) + local s = line:find(env_end) if s ~= nil then luatexbase.remove_from_callback("process_input_buffer", "pyluatex_record_line") - local code_in_line = line:sub(1, s - 1) - if trim(code_in_line):len() > 0 then + local code = line:sub(1, s - 1) + if code:strip():len() > 0 then -- only include this line if it contains non-whitespace characters - table.insert(env_lines, code_in_line) - end - local code = table.concat(env_lines, "\n") - env_success = pyluatex.execute(code, false, false, env_repl_mode, true) - if env_success or pyluatex.ignore_errors then - return line:sub(s) - else - return env_end .. err_cmd("Python error (see above)") .. line:sub(e + 1) + table.insert(env_lines, code) end + return line:sub(s) else table.insert(env_lines, line) return "" end end -function pyluatex.record_env(name, repl_mode) +function pyluatex.record_env(name) if parent_env ~= nil then name = parent_env parent_env = nil end - env_end = "\\end{" .. name .. "}" + env_end = "\\end%s*{" .. name:escapedpattern() .. "}" env_lines = {} - env_repl_mode = repl_mode luatexbase.add_to_callback("process_input_buffer", record_line, "pyluatex_record_line") end @@ -236,13 +196,13 @@ function pyluatex.run_file(path, write, repl_mode) f:close() -- ignore trailing new line if present if code:sub(-2) == "\r\n" then - code = code:sub(0, -3) + code = code:sub(1, -3) elseif code:sub(-1) == "\n" then - code = code:sub(0, -2) + code = code:sub(1, -2) end pyluatex.execute(code, false, write, repl_mode, true) else - tex.sprint(err_cmd("File not found: " .. path)) + show_err("File not found: " .. path) end end @@ -255,26 +215,24 @@ function pyluatex.get_last_output() end local function parse_bool(name, value) + value = value:fullstrip() if value == "true" then return true elseif value == "false" then return false else - tex.sprint( - err_cmd("Invalid value '" .. value .. "' for option " .. name) - ) + show_err('Invalid value "' .. value .. '" for option "' .. name .. '"') end end function pyluatex.set_option(name, value) - name = trim(name) - value = trim(value) + name = name:fullstrip() if name == "ignoreerrors" then pyluatex.ignore_errors = parse_bool(name, value) elseif name == "verbose" then pyluatex.verbose = parse_bool(name, value) else - tex.sprint(err_cmd("Unknown option '" .. name .. "'")) + show_err('Unknown option "' .. name .. '"') end end diff --git a/macros/luatex/latex/pyluatex/pyluatex.pdf b/macros/luatex/latex/pyluatex/pyluatex.pdf Binary files differindex d357f15385..c3623287dd 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.pdf +++ b/macros/luatex/latex/pyluatex/pyluatex.pdf diff --git a/macros/luatex/latex/pyluatex/pyluatex.sty b/macros/luatex/latex/pyluatex/pyluatex.sty index 11b9261709..2b0575a830 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.sty +++ b/macros/luatex/latex/pyluatex/pyluatex.sty @@ -1,4 +1,4 @@ -%% Copyright 2021-2023 Tobias Enderle +%% Copyright 2021-2024 Tobias Enderle %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -9,15 +9,15 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pyluatex}[2023/02/15 v0.6.1 Execute Python code on the fly] +\ProvidesPackage{pyluatex}[2024/01/07 v0.6.2 Execute Python code on the fly] \RequirePackage{expl3} \ExplSyntaxOn -\sys_if_engine_luatex:TF{}{ +\sys_if_engine_luatex:F{ \PackageError{PyLuaTeX}{LuaTeX~is~required}{} } -\sys_if_shell_unrestricted:TF{}{ - \PackageError{PyLuaTeX}{Shell~escape~required~(add~-shell-escape~option)}{} +\sys_if_shell_unrestricted:F{ + \PackageError{PyLuaTeX}{Shell~escape~is~required~(add~--shell-escape~option)}{} } \ExplSyntaxOff @@ -31,40 +31,32 @@ \DeclareStringOption[veryveryend]{shutdown} \ProcessKeyvalOptions* -\directlua{pyluatex.ignore_errors = \ifpyluatex@ignoreerrors true\else false\fi} -\directlua{pyluatex.verbose = \ifpyluatex@verbose true\else false\fi} -\directlua{pyluatex.start( - [==[\pyluatex@executable]==], - \ifpyluatex@localimports true\else false\fi -)} +\newcommand*{\pyluatex@boolopt}[1]{\csname ifpyluatex@#1\endcsname true\else false\fi} + +\directlua{pyluatex.ignore_errors = \pyluatex@boolopt{ignoreerrors}} +\directlua{pyluatex.verbose = \pyluatex@boolopt{verbose}} +\directlua{pyluatex.start([==[\pyluatex@executable]==], \pyluatex@boolopt{localimports})} \ExplSyntaxOn -\cs_generate_variant:Nn \tl_if_eq:nnTF { V } -\tl_if_eq:VnTF{\pyluatex@shutdown}{veryveryend}{ - \RequirePackage{atveryend} - \AtVeryVeryEnd{\directlua{pyluatex.shutdown()}} -}{ - \tl_if_eq:VnTF{\pyluatex@shutdown}{veryenddocument}{ - \RequirePackage{atveryend} - \AtVeryEndDocument{\directlua{pyluatex.shutdown()}} - }{ - \tl_if_eq:VnTF{\pyluatex@shutdown}{off}{}{ - \PackageError{PyLuaTeX}{ - Invalid~value~for~package~option~"shutdown":~\pyluatex@shutdown - }{} - } - } -} +\str_case_e:nnF{\pyluatex@shutdown}{ + {veryveryend}{ + \AddToHook{enddocument/end}{\directlua{pyluatex.shutdown()}} + }{veryenddocument}{ + \AddToHook{enddocument/afteraux}{\directlua{pyluatex.shutdown()}} + }{off}{} +}{\PackageError{PyLuaTeX}{Invalid~value~for~package~option~"shutdown":~\pyluatex@shutdown}{}} \ExplSyntaxOff \newcommand*{\PyLTVerbatimEnv}{\directlua{pyluatex.set_parent_env([==[\@currenvir]==])}} -\newenvironment{python}{\directlua{pyluatex.record_env("python", false)}} -{\directlua{pyluatex.print_env()}} +\newenvironment{python}{\directlua{pyluatex.record_env("python")}} +{\directlua{pyluatex.execute_env(true, false)}} -\newenvironment{pythonq}{\directlua{pyluatex.record_env("pythonq", false)}}{} +\newenvironment{pythonq}{\directlua{pyluatex.record_env("pythonq")}} +{\directlua{pyluatex.execute_env(false, false)}} -\newenvironment{pythonrepl}{\directlua{pyluatex.record_env("pythonrepl", true)}}{} +\newenvironment{pythonrepl}{\directlua{pyluatex.record_env("pythonrepl")}} +{\directlua{pyluatex.execute_env(false, true)}} \newcommand*{\pyluatex@inline}[3]{\directlua{pyluatex.execute([==[#1]==], #2, #3, false, true)}} diff --git a/macros/luatex/latex/pyluatex/pyluatex.tex b/macros/luatex/latex/pyluatex/pyluatex.tex index 908fb04c77..5080c4b52f 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.tex +++ b/macros/luatex/latex/pyluatex/pyluatex.tex @@ -15,7 +15,7 @@ \usepackage{url} \title{The \emph{pyluatex} package} \author{Tobias Enderle\\\url{https://github.com/tndrle/PyLuaTeX}} -\date{v0.6.1 (2023/02/15)} +\date{v0.6.2 (2024/01/07)} \begin{document} \maketitle \raggedright @@ -57,7 +57,7 @@ $\sqrt{371} = \py{math.sqrt(371)}$ \item Compile using Lua\LaTeX{} (shell escape is required) \begin{tcblisting}{breakable,listing only, size=fbox,colframe=black!8,boxrule=3pt,colback=black!8} -lualatex -shell-escape example.tex +lualatex --shell-escape example.tex \end{tcblisting} \end{enumerate} \textbf{Note:} PyLuaTeX starts Python 3 using the command \inlcode|python3| by default. @@ -122,7 +122,8 @@ For an example, see the Typesetting Code section. \item \inlcode|shutdown|\\[0.5ex] Specifies when the Python process is shut down. (default: \inlcode|veryveryend|)\\[0.5ex] \textit{Options:} \inlcode|veryveryend|, \inlcode|veryenddocument|, \inlcode|off|\\[0.5ex] - PyLuaTeX uses the hooks of the package \textit{atveryend} to shut down the Python interpreter when the compilation is done. With the option \inlcode|veryveryend|, Python is shut down in the \inlcode|\AtVeryVeryEnd| hook. With the option \inlcode|veryenddocument|, Python is shut down in the \inlcode|\AtVeryEndDocument| hook. With the option \inlcode|off|, Python is not shut down explicitly. However, the Python process will shut down when the LuaTeX process finishes even if \inlcode|off| is selected. Using \inlcode|off| on Windows might lead to problems with SyncTeX, though.\\[0.5ex] + PyLuaTeX shuts down the Python interpreter when the compilation is done. With the option \inlcode|veryveryend|, Python is shut down in the \inlcode|enddocument/end| hook. With the option \inlcode|veryenddocument|, Python is shut down in the \inlcode|enddocument/afteraux| hook. With the option \inlcode|off|, Python is not shut down explicitly. However, the Python process will shut down when the LuaTeX process finishes even if \inlcode|off| is selected. Using \inlcode|off| on Windows might lead to problems with SyncTeX, though.\\[0.5ex] + Before v0.6.2, PyLuaTeX used the hooks \inlcode|\AtVeryVeryEnd| and \inlcode|\AtVeryEndDocument| of the package \textit{atveryend}. The new hooks \inlcode|enddocument/end| and \inlcode|enddocument/afteraux| are equivalent to those of the \textit{atveryend} package.\\[0.5ex] \textit{Example:} \inlcode|\usepackage[shutdown=veryenddocument]{pyluatex}| \item \inlcode|verbose|\\[0.5ex] If this option is set, Python input and output is written to the \LaTeX{} log file.\\[0.5ex] @@ -285,5 +286,5 @@ No placeholders have to be inserted. \section{License} LPPL 1.3c\footnote{\url{http://www.latex-project.org/lppl.txt}} for \LaTeX{} code and -MIT license\footnote{\url{https://opensource.org/licenses/MIT}} for Python and Lua code. +MIT license\footnote{\url{https://opensource.org/licenses/MIT}} for Python and Lua code and other files. \end{document} |