diff options
author | Norbert Preining <norbert@preining.info> | 2023-11-12 03:02:06 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-11-12 03:02:06 +0000 |
commit | 5ee22d8ea7f225ba59142a53f0387a2bccc22dde (patch) | |
tree | 63ca211ff5ff12c7f756ac8a197726c314eb980b /macros/latex | |
parent | e4ccc7921b6518e670428990524161b3ddbfebd2 (diff) |
CTAN sync 202311120302
Diffstat (limited to 'macros/latex')
17 files changed, 317 insertions, 87 deletions
diff --git a/macros/latex/contrib/crefthe/crefthe-doc.pdf b/macros/latex/contrib/crefthe/crefthe-doc.pdf Binary files differindex ac2a6d590e..524854ddd9 100644 --- a/macros/latex/contrib/crefthe/crefthe-doc.pdf +++ b/macros/latex/contrib/crefthe/crefthe-doc.pdf diff --git a/macros/latex/contrib/crefthe/crefthe-doc.tex b/macros/latex/contrib/crefthe/crefthe-doc.tex index 2567d4f02e..39ccd9c191 100644 --- a/macros/latex/contrib/crefthe/crefthe-doc.tex +++ b/macros/latex/contrib/crefthe/crefthe-doc.tex @@ -120,7 +120,7 @@ \begin{document} -\def\PackageVersion{2023/10/21} +\def\PackageVersion{2023/11/11} \def\PackageSubVersion{} \title{\crefthepackage{}\\\smallskip\itshape Cross referencing with proper definite articles} diff --git a/macros/latex/contrib/crefthe/crefthe.sty b/macros/latex/contrib/crefthe/crefthe.sty index e73444aa88..51d2e5fbd2 100644 --- a/macros/latex/contrib/crefthe/crefthe.sty +++ b/macros/latex/contrib/crefthe/crefthe.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplPackage {crefthe} - {2023/10/21} {} + {2023/11/11} {} {Cross referencing with proper definite articles} \keys_define:nn { crefthe } @@ -39,6 +39,7 @@ \RequirePackage { cleveref } \RequirePackage { regexpatch } +\@namedef{ver@xpatch.sty}{} \NewCommandCopy \crefthe_cref_original:w \cref \NewCommandCopy \crefthe_Cref_original:w \Cref diff --git a/macros/latex/contrib/notebeamer/doc/notebeamer-demo.pdf b/macros/latex/contrib/notebeamer/doc/notebeamer-demo.pdf Binary files differindex d36511b6f5..c6752e931b 100644 --- a/macros/latex/contrib/notebeamer/doc/notebeamer-demo.pdf +++ b/macros/latex/contrib/notebeamer/doc/notebeamer-demo.pdf diff --git a/macros/latex/contrib/notebeamer/doc/notebeamer-demo.tex b/macros/latex/contrib/notebeamer/doc/notebeamer-demo.tex index cadf4dfb76..3d4b7136b9 100644 --- a/macros/latex/contrib/notebeamer/doc/notebeamer-demo.tex +++ b/macros/latex/contrib/notebeamer/doc/notebeamer-demo.tex @@ -18,12 +18,12 @@ \notebook[H5]{AQM \& SPD} \chapter[Introduction \& Fundamental Concepts]{newnote3sdemo.pdf} % Insert the page 1--2, 4--6 of the file with the format 3 images per page - \newnotesss{1}{2} \newnotesss{4}{6} + \newnotesss{1}{2} \newnotesss{3}{6} \chapter[SPD Basic: Transport]{newnote4sdemo.pdf} % Insert the page 1--2, 4--6, 7--10 of the file with the format 4 images per page \newnotessss{1}{2} \newnotessss{4}{6} \newnotessss{7}{10} % Create an empty note paper with no page number - \emptynote*[3] + \emptynote*[2] % Create an empty note paper with logo and info but no page number \emptyhdunote*[2] \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/notebeamer/doc/notebeamer-doc.pdf b/macros/latex/contrib/notebeamer/doc/notebeamer-doc.pdf Binary files differindex 4905a3c915..ace62f54d5 100644 --- a/macros/latex/contrib/notebeamer/doc/notebeamer-doc.pdf +++ b/macros/latex/contrib/notebeamer/doc/notebeamer-doc.pdf diff --git a/macros/latex/contrib/notebeamer/doc/notebeamer-doc.tex b/macros/latex/contrib/notebeamer/doc/notebeamer-doc.tex index 8caa538d0b..a0668e292c 100644 --- a/macros/latex/contrib/notebeamer/doc/notebeamer-doc.tex +++ b/macros/latex/contrib/notebeamer/doc/notebeamer-doc.tex @@ -49,8 +49,7 @@ \hypersetup{colorlinks,urlcolor=H1,linkcolor=H2,filecolor=filecolor,pdfstartview=FitH,pdfview=FitH,pdfcreator=XeTeX output} \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.1em}} -\def\@pkg#1{\texorpdfstring{\href{https://www.ctan.org/pkg/#1}% -{\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}} +\def\@pkg#1{\texorpdfstring{\href{https://www.ctan.org/pkg/#1}{\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}} \def\s@pkg#1{\texorpdfstring{\textcolor{pkgcolor}{\textsf{#1}}}{“#1”}} \DeclareRobustCommand\pkg{\@ifstar\s@pkg\@pkg} \def\mode#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}} @@ -65,7 +64,7 @@ \ddmmyyyydate \date{\today} \affil[1]{\href{mailto:xiamyphys@gmail.com}{\texttt{xiamyphys@gmail.com}}} -\date{\today\quad Version 2.0a\thanks{% +\date{\today\quad Version 2.2b\thanks{% \url{https://github.com/xiamyphys/NoteBeamer}}} \begin{document} \maketitle @@ -87,7 +86,7 @@ If you meet bugs when using this template, or you have better suggestions or ide Also, you can join my \textsf\LaTeX{} Template Discussion \href{https://qm.qq.com/q/OnHzbNvVAG}{QQ Group: 760570712} to communicate with me and get the insider preview edition of the template. \subsection{Packages required} -This template is based on the template \pkg{standalone}. And it requires \pkg{tikz} package to plot some graphics, \pkg{kvoptions} and \pkg{etoolbox} packages to provide global opinions, \pkg{graphics} package to provides the \verb|draft| mode, \pkg{xparse} to provide the commands with star\footnote{This is an awful idea, because using the original command can be better than using a package.}\footnote{In the later versions, the template will change to use the original commands of \textsf\LaTeX{$2\varepsilon$} to avoid using the package \pkg{xparse}, which can improve the compilation efficiency in some ways.}, \pkg{hyperref} package provides link jump function, \pkg{ctex} package to supports the \textbf{Chinese, Simplified} language and \pkg{fontawesome5} package to provides a set of beautiful icons. +This template is based on the template \pkg{standalone}. And it requires \pkg{tikz} package to plot some graphics, \pkg{kvoptions} and \pkg{etoolbox} packages to provide global opinions, \pkg{graphics} package to provides the \mode{draft} mode, \pkg{xparse} to provide the commands with star, \pkg{hyperref} package provides link jump function, \pkg{ctex} package to supports the \textbf{Chinese, Simplified} language and \pkg{fontawesome5} package to provides a set of beautiful icons. I strongly suggest that you should use cmd to implement the commands to update all the packages to the latest version or switch to portable version instead. \begin{verbatim} @@ -95,33 +94,39 @@ I strongly suggest that you should use cmd to implement the commands to update a tlmgr update --all \end{verbatim} -If you are in some areas with awful Internet environment, you can choose proper mirror source or use other means\footnote{Please comply with local network regulations.}. To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my TEX distribution?} +Remember to choose the proper mirror source in your region. To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my TEX distribution?} \subsection{Loading \pkg{NoteBeamer} and its modes} -Save the file \verb|notebeamer.cls| to your project's root directory, and then create a \verb|.tex| file, just input the command \verb|\documentclass{notebeamer}| on the first line. +Update your \sffamily\TeX distribution or just save the file \verb|notebeamer.cls| to your project's root directory, then create a \verb|.tex| file, just input the command \verb|\documentclass{notebeamer}| on the first line. -The template provides two modes, \mode{draft} and \mode{color}. Just add the options of the modes you want separately in the square bracket of the command \verb|\documentclass[options]{notebeamer}| in your \verb|.tex| file. +The template provides three modes: \mode{draft}, \mode{color} and \mode{font}. Just add the options of the modes separately by commas in the square bracket of the command in your \verb|.tex| file, such as + +\begin{verbatim} + \documentclass[draft,dark,libertinus]{notebeamer} +\end{verbatim} \section{Modes of \pkg{NoteBeamer}} \subsection{The \mode{draft} mode} -Like most of the templates, this template also provide \mode{draft} mode (with the support of package \pkg{graphics}), \sffamily\TeX{} will only read for size info of pages you input, and a box of the correct size is printed with the filename in. +Like most of the templates, this template also provide all modes provided by \pkg{graphics} package such as \mode{draft}, \sffamily\TeX{} will only read for size info of pages you input, and a box of the correct size is printed with the filename in. This can accelerate the speed of compile and you can preview the effect quickly when you input a file with too many pages and (or) its size is too large. After you make sure that there's no formatting errors, you can cancel this mode just to wait until compiled. -\subsection{The \mode{normal}, \mode{lighter}, \& \mode{darker} modes} -This mode can make the color of the covers you create in this template get lighter or darker, and the default opinion is \mode{normal}. +The files corresponding to the commands \cmd{sticker}, \cmd{logo} and \cmd{flyleaf} can be stored in a folder named \verb|figure(s)|, \verb|image(s)|, \verb|graphic(s)| or \verb|picture(s)|, and you needn't to write these directories again in these commands because this template has already set these directories as indexes. Just as shown in the file tree in the example in \nameref{dirtree}. -\subsection{The \mode{times} \& \mode{libertinus} modes} -This mode can deside which font the notebook will use: The default \emph{New Times Roman} font or the \emph{Libertinus} font. You can use Libertinus fonts if you've installed it on your computer, and the default opinion is \mode{times}. +\subsection{The \mode{color} mode} +This mode has three opinions, \mode{normal}, \mode{lighter} and \& \mode{darker}, which can make the color of the covers you create in this template get lighter or darker, and the default opinion is \mode{normal}. + +\subsection{The \mode{font} mode} +This mode has two opinions, \mode{times} and \mode{libertinus}, which can deside which font the notebook will use: The default \emph{New Times Roman} font or the \emph{Libertinus} font. You can use Libertinus fonts if you've installed it on your computer, and the default opinion is \mode{times}. \section{Commands of \pkg{NoteBeamer}} \subsection{The \cmd{author}, \cmd{mail}, \cmd{flyleaf}, \cmd{sticker} and \cmd{logo} commands} \begin{verbatim} - \author{Your Name} \mail{Your Mail Address} - \flyleaf{titlepage.pdf} \sticker{sticker.png} + \author{Your Name} \mail{Your Mail Address} + \flyleaf{titlepage.pdf} \sticker{sticker.png} \logo[link]{logofile.pdf}[info] \end{verbatim} \begin{itemize} @@ -134,8 +139,6 @@ This mode can deside which font the notebook will use: The default \emph{New Tim There will be a sticker on the south east of the note paper after you add, and there will be a logo on the north west corner of the cover page and HDU note paper; otherwise it won't. The first and third variable of the command \cmd{logo} can assign the link and info of the logo, which are optional. - - \item The files corresponding to the commands \verb|sticker|, \verb|logo| and \verb|flyleaf| can be stored in a folder named \verb|figure(s)|, \verb|image(s)|, \verb|graphic(s)| or \verb|picture(s)|, and you needn't to write these directories again in these commands because this template has already set these directories as indexes. Just as shown in the file tree in the example in \nameref{dirtree}. \end{itemize} \paragraph{The commands above are all repeatable, which can reassign the values that these commands assigned before.} @@ -194,6 +197,9 @@ While considering the suggestions from friends, I am also thinking about how to \textsf{\bfseries Version 2.1a} was finished developing on 9 November, 2023. This version has fixed some bugs, and now supports inserting non-consecutive page numbers of the same file, and you can inserting a certain number of empty note papers with only one command. Also, this version has redesigned the top and bottom margins and the height between note lines in response to the suggestion from \href{https://qm.qq.com/q/OnHzbNvVAG}{QQ Group} member. What's more, this version supports the `Libertinus' font, which can make users have a better visual effect. +\textsf{\bfseries Version 2.2b} was finished developing on 11 November, 2023. This version has fixed some bugs, and partical commands in this version has changed to use \sffamily\LaTeX{2e} original commands. + +\newpage \datechange{01/11/2023}{Version 2.0a} \begin{itemize} \item Simplify the command of inserting 3 \& 4 images per page. @@ -202,7 +208,7 @@ While considering the suggestions from friends, I am also thinking about how to \item Add commands to create empty note paper with logo and info on the top. \end{itemize} -\datechange{\today}{Version 2.1a} +\datechange{09/11/2023}{Version 2.1a} \begin{itemize} \item Fixed the bug of page number errors when inserting the titlepage. \item Fixed the bug of picture string position when inserting the first page number of courseware when the page number is not 1. @@ -213,6 +219,12 @@ While considering the suggestions from friends, I am also thinking about how to \item Other detailed adjustments. \end{itemize} +\datechange{\today}{Version 2.2b} +\begin{itemize} + \item Fixed the image position error when inserting 3 and 4 images per note page. + \item Partially using \sffamily\LaTeX{2e} original commands. +\end{itemize} + \newpage \appendix \section{Document Example} @@ -223,22 +235,6 @@ While considering the suggestions from friends, I am also thinking about how to \label{dirtree} \begin{minipage}{0.48\textwidth} \dirtree{% - .1 doc/. - .2 images/. - .3 HDU.pdf. - .3 Inuyasa.jpg. - .3 titlepage1.pdf. - .3 titlepage2.pdf. - .3 newnotedemo.pdf. - .3 newnote3sdemo.pdf. - .3 newnote4sdemo.pdf. - .2 notebeamer-demo.tex. - .2 notebeamer-demo.pdf. - } -\end{minipage} -\hfill -\begin{minipage}{0.48\textwidth} - \dirtree{% .1 notebeamer/. .2 doc/. .3 images/. @@ -252,6 +248,22 @@ While considering the suggestions from friends, I am also thinking about how to .2 README.md. } \end{minipage} +\hfill +\begin{minipage}{0.48\textwidth} + \dirtree{% + .1 doc/. + .2 images/. + .3 HDU.pdf. + .3 Inuyasa.jpg. + .3 titlepage1.pdf. + .3 titlepage2.pdf. + .3 newnotedemo.pdf. + .3 newnote3sdemo.pdf. + .3 newnote4sdemo.pdf. + .2 notebeamer-demo.tex. + .2 notebeamer-demo.pdf. + } +\end{minipage} \includepdf[pages=-,nup=4x4]{notebeamer-demo.pdf} diff --git a/macros/latex/contrib/notebeamer/tex/notebeamer.cls b/macros/latex/contrib/notebeamer/tex/notebeamer.cls index 1827871355..e748552164 100644 --- a/macros/latex/contrib/notebeamer/tex/notebeamer.cls +++ b/macros/latex/contrib/notebeamer/tex/notebeamer.cls @@ -14,13 +14,13 @@ %% ************************************************************************************************************ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{notebeamer}[09/11/2023 v2.1a NoteBeamer document class] +\ProvidesClass{notebeamer}[11/11/2023 v2.2b NoteBeamer document class] %% Global opinions \RequirePackage{kvoptions} \RequirePackage{etoolbox} \SetupKeyvalOptions{family=NB, prefix=NB@, setkeys=\kvsetkeys} -\newcommand{\ekv}[1]{\kvsetkeys{NB}{#1}} +\def\ekv#1{\kvsetkeys{NB}{#1}} \DeclareStringOption[normal]{color} \DeclareVoidOption{lighter}{\ekv{color=lighter}} @@ -43,10 +43,10 @@ \RequirePackage{fontawesome5} %% Global definitions -\newcommand{\notewidth}{6.32} -\newcommand{\noteheight}{8.18} -\renewcommand{\author}[1]{\gdef\@author{#1}} -\newcommand{\mail}[1]{\gdef\@mail{\href{mailto:#1}{\nolinkurl{#1}}}} +\def\notewidth{6.32} +\def\noteheight{8.18} +\def\author#1{\gdef\@author{#1}} +\def\mail#1{\gdef\@mail{\href{mailto:#1}{\nolinkurl{#1}}}} \NewDocumentCommand\chapter{s o m}{ \IfBooleanTF{#1}{}{ \refstepcounter{chap} @@ -55,8 +55,8 @@ \gdef\@courseware{#3} \setcounter{note}{0} } -\newcommand{\flyleaf}[1]{\gdef\@flyleaf{#1}} -\newcommand{\sticker}[1]{\gdef\@sticker{#1}} +\def\flyleaf#1{\gdef\@flyleaf{#1}} +\def\sticker#1{\gdef\@sticker{#1}} \NewDocumentCommand\logo{O{https://www.hdu.edu.cn} m O{Hangzhou·Zhejiang}}{\gdef\@edu{#1}\gdef\@logo{#2}\gdef\@address{#3}} %% Fonts @@ -78,10 +78,10 @@ \definecolor{紺色}{HTML}{223A70} \newcounter{chap} \newcounter{note} -\newcommand{\chaptername}{\faIcon{seedling} Chapter} +\def\chaptername{\faIcon{seedling} Chapter} %%%% 1 note per page -\newcommand{\newnote}[2]{ +\def\newnote#1#2{ \refstepcounter{note} \addtocounter{note}{-1} \foreach \n in {#1,...,#2}{ @@ -116,7 +116,7 @@ } %%%% 3 beamers per page -\newcommand{\threebeamers}[3]{ +\def\threebeamers#1#2#3{ \refstepcounter{note} \begin{tikzpicture} \fill [lightyellow!50] (0,0) rectangle (\notewidth in,\noteheight in);% 边界 @@ -124,7 +124,7 @@ %%%%%% imput file \foreach \n in {#1,#2,#3} - \node [yshift=((27.5-(\n-#1)*11+\thenote*33)*0.028*\noteheight in),inner sep=0pt] at (0.3125*\notewidth in,0.038*\noteheight in) {\ifcsname @chapter\endcsname\includegraphics[height=2.40492 in,page=\n]{\@courseware}\fi}; + \node [yshift=(27.5-(\n-#1)*11)*0.028*\noteheight in,inner sep=0pt] at (0.3125*\notewidth in,0.038*\noteheight in) {\ifcsname @chapter\endcsname\includegraphics[height=2.40492 in,page=\n]{\@courseware}\fi}; %%%%%% draw lines & dots \foreach \a in {0,...,33} @@ -157,14 +157,14 @@ } %%%% 4 slides per page -\newcommand{\fourbeamers}[4]{ +\def\fourbeamers#1#2#3#4{ \refstepcounter{note} \begin{tikzpicture} \fill [lightyellow!50] (0,0) rectangle (\notewidth in,\noteheight in);% 边界 \ifcsname @sticker\endcsname\node [anchor=south east,opacity=0.24,inner sep=0pt] at (0.985*\notewidth in,0.012*\noteheight in) {\includegraphics[height=1.07158 in]{\@sticker}};\fi %%%%%% imput file \foreach \n in {#1,#2,#3,#4} - \node [yshift=((28.875-(\n-#1)*8.25+\thenote*33)*0.028*\noteheight in),inner sep=0pt] at (0.3125*\notewidth in,0.038*\noteheight in) {\ifcsname @chapter\endcsname\includegraphics[height=1.77506 in,page=\n]{\@courseware}\fi}; + \node [yshift=(28.875-(\n-#1)*8.25)*0.028*\noteheight in,inner sep=0pt] at (0.3125*\notewidth in,0.038*\noteheight in) {\ifcsname @chapter\endcsname\includegraphics[height=1.77506 in,page=\n]{\@courseware}\fi}; \foreach \a in {0,...,33} \foreach \b in {18,...,29} @@ -261,9 +261,9 @@ } %% covers -\ifdefstring{\NB@color}{lighter}{\newcommand{\@saturation}{.16}}{\relax} -\ifdefstring{\NB@color}{normal}{\newcommand{\@saturation}{.12}}{\relax} -\ifdefstring{\NB@color}{darker}{\newcommand{\@saturation}{.08}}{\relax} +\ifdefstring{\NB@color}{lighter}{\def\@saturation{.16}}{\relax} +\ifdefstring{\NB@color}{normal}{\def\@saturation{.12}}{\relax} +\ifdefstring{\NB@color}{darker}{\def\@saturation{.08}}{\relax} \definecolor{H1}{Hsb}{349,\@saturation,.9}% 海棠紅 (Hangzhou MTR L 1 ) \definecolor{H2}{Hsb}{23, \@saturation,.9}% 丹桂橙 (Hangzhou Metro 2 ) diff --git a/macros/latex/contrib/q-and-a/Q-and-A.cls b/macros/latex/contrib/q-and-a/Q-and-A.cls index 618b7128ec..184cde054b 100644 --- a/macros/latex/contrib/q-and-a/Q-and-A.cls +++ b/macros/latex/contrib/q-and-a/Q-and-A.cls @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplClass {Q-and-A} - {2023/11/09} {} + {2023/11/11} {} {Document class for typesetting Q&A conversation} \keys_define:nn { Q-and-A } @@ -282,6 +282,20 @@ \definecolor{QA-code-comment}{RGB}{128,128,128} \definecolor{QA-code-string }{RGB}{ 5,165,126} \lstdefinelanguage{plaintext}{} +\lstdefinelanguage{Markdown}{ + keywords={ + \#,\#\#,\#\#\#,\#\#\#\#,\#\#\#\#\#,\#\#\#\#\#\#, + >, + ---,----,-----,------,-------,--------,---------, + }, + alsoletter={\#,>,*,-,`}, + moredelim=[s][\color{QA-code-string}\ttfamily]{`}{`}, + moredelim=[s][\itshape]{*}{*}, + moredelim=[s][\bfseries]{**}{**}, + moredelim=[s][\bfseries\itshape]{***}{***}, + morecomment=[s]{<!--}{-->}, + sensitive=true +} \lstdefinelanguage{JavaScript}{% https://tex.stackexchange.com/q/89574 keywords={abstract, any, as, boolean, break, case, catch, class, console, const, continue, debugger, declare, default, delete, do, else, enum, export, @@ -1139,11 +1153,11 @@ \regex_replace_all:nnN { \*\*\* (.*?) \*\*\* } - { \c{textbf} { \c{emph} {\1} } } + { \c{QAEmph} { \c{emph} {\1} } } \l_QA_tmp_tl \regex_replace_all:nnN { \*\* (.*?) \*\* } - { \c{textbf} {\1} } + { \c{QAEmph} {\1} } \l_QA_tmp_tl \regex_replace_all:nnN { \* (.*?) \* } diff --git a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf Binary files differindex 71bd0de25a..4f5d79d7e6 100644 --- a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf +++ b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf diff --git a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex index 69b6dfea09..4043c4cb91 100644 --- a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex +++ b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex @@ -5,7 +5,7 @@ scroll, ]{Q-and-A} -\def\PackageVersion{2023/11/09} +\def\PackageVersion{2023/11/11} \def\PackageSubVersion{} \newcommand{\QApackage}{{\normalfont\textsf{Q-and-A}}} diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index 3373157bb6..2957d780bb 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 3.96 +## Babel 3.97 -2023-10-25 +2023-11-11 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 275 languages. The latest stable version is available on <https://ctan.org/pkg/babel>. -Changes in version 3.96 are described in: +Changes in version 3.97 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.96.html +https://latex3.github.io/babel/news/whats-new-in-babel-3.97.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,12 +48,9 @@ respective authors. ### Summary of latest changes ``` -3.96 2023-10-25 - * Added LGI to non-ASCII encodings. - * New macro: \asciiencoding. - * Removed OT1 in some ini files. - * Improved support for Odia (thanks to @avisekjena). - * Transform 'hyphen.repeat' in Croatian. +3.97 2023-11-11 + * Support for 'interchar' (xetex). + * New locale for Buriat, thanks to J. Khaganov. ``` ### 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 7d0d603a36..130befcb9e 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 8346f33f4b..4345b09198 100644 --- a/macros/latex/required/babel/base/babel.dtx +++ b/macros/latex/required/babel/base/babel.dtx @@ -32,7 +32,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2023/10/25 v3.96 The Babel package] +\ProvidesFile{babel.dtx}[2023/11/11 v3.97 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -271,10 +271,11 @@ are also some notes on its use with e-Plain and pdf-Plain \TeX. \item[\sffamily\color{messages}What if I’m interested only in the latest changes?] Changes and new features with relation to version 3.8 -are highlighted with \New{X.XX}\hspace{-.5em}, 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. +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. \item[\sffamily\color{messages}Can I help?] Sure! If you are interested in the \TeX{} multilingual support, please join the @@ -2852,7 +2853,6 @@ languages. They are (from \textsf{interface3.pdf}): \makebox[\linewidth][c]{*\qquad*\qquad*} \smallskip - A few options (only \luatex) set some properties of the writing system used by the language. These properties are \textit{always} applied to the script, no matter which language is active. Although somewhat @@ -3772,6 +3772,73 @@ This feature is activated with the first |\babelposthyphenation| or \New{3.85} Enables and disables the transform with the given label in the current language. +\subsection{Support for \xetex{} interchar} + +\New{3.97} A few macros are provided to deal with locale dependent +inter-character rules (aka ‘interchar’). + +\Describe{\babelcharclass}{\marg{locale}\marg{name}\marg{char-list}} + +Declares a new character class, which is assigned to the characters in +\marg{char-list}, entered either as characters or in macro form +(eg,~|\}|). If you need to enter them by their numeric value, use the +\TeX{} |^|-notation (eg,~|^^^^1fa0|). Ranges are allowed, with a +hyphen (eg,~|.,;a-zA-Z|). If you need the hyphen to be assigned a +class, write it at the very beginning of the list. + +There are several predefined ‘global’ classes, namely +|default|, |cjkideogram|, |cjkleftpunctuation|, |cjkrightpunctuation|, +|boundary|, and |ignore|, which are described in the \xetex{} manual +(currently CJK classes are ‘empty’, but they will be assigned in a +future release). + +\Describe{\babelinterchar}{\oarg{options}\marg{locale} + \marg{class-first}\marg{class-second}\marg{code}} + +\marg{class-first} and \marg{class-second} can be comma separated lists +of char classes, and all combinations are defined (so that 2 first +classes with 2 second classes, define 4 combinations). In the +\marg{options} field a key named |label| is available, which allows to +enable or to disable the rule with the following two commands. Like +prehyphenation transforms in \luatex{}, interchars are not applied if the +current hyphenation rules are |nohyphenation|. + +\Describe{\enablelocaleinterchar}{\marg{label}} +\DescribeOther{\disablelocaleinterchar}{\marg{label}} + +Enable or disable the interchar rules with the given label for the +current language. + +\begin{example} + Not very useful, but illustrative (taken from the unfortunately + obsolete \textsf{interchar} package, by Zou Ho), to colorize the + letters ‘x’ and ‘y’ (this way to group text is usually not a + good idea, however). +\begin{verbatim} +\usepackage{color} +\babelcharclass{english}{colored}{xy} +\babelinterchar{english}{default, boundary}{colored}{\bgroup\color{red}} +\babelinterchar{english}{colored}{default, boundary}{\egroup} +\end{verbatim} + A more realistic example follows, which inserts a thin space + between a digit and a percent sign. Note the former is entered as a + range, and the latter in command form: +\begin{verbatim} +\babelcharclass{english}{digit}{0-9} +\babelcharclass{english}{percent}{\%} +\babelinterchar[label=percent]{english}{digit}{percent}{\,} +\end{verbatim} +\end{example} + +\begin{warning} + Keep in mind two points: (1) a character can be assigned a single + class; this is a limitation in the interchar mechanims that often + leads to incompatibilities; (2) since the character classes set with + |\babelcharclass| are saved (so that they can be restored), there is a + limit in the number of characters in the \marg{char-list} (which, + however, must be large enough for many uses). +\end{warning} + \subsection{Selection based on BCP 47 tags} \label{bcp47} @@ -4462,7 +4529,7 @@ ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}. (\textsf{portuguese}), \textsf{brazil} (\textsf{brazilian}), \textsf{russianb} (\textsf{russian}), \textsf{usorbian} (\textsf{uppersorbian}), \textsf{vietnam} (\textsf{vietnamese}), - \textsf{northernsami} (\textsf{samin}), \textsf{ukraineb} + \textsf{samin} (\textsf{northernsami}), \textsf{ukraineb} (\textsf{ukrainian}). Deprecated names come in many cases from the times when they had to be shortened to 8 characters. \end{note} @@ -5563,8 +5630,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<<version=3.96>> -%<<date=2023/10/25>> +%<<version=3.97>> +%<<date=2023/11/11>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -5757,7 +5824,7 @@ wouldn’t exist. \bbl@trim{\expandafter\bbl@kvcmd\expandafter{\bbl@forkv@a}}{#2}{#4}} % \end{macrocode} % -% A \textit{for} loop. Each item (trimmed), is |#1|. It cannot be +% A \textit{for} loop. Each item (trimmed) is |#1|. It cannot be % nested (it's doable, but we don't need it). % % \begin{macrocode} @@ -13626,9 +13693,9 @@ wouldn’t exist. % % \subsection{XeTeX} % -% Unfortunately, the current encoding cannot be retrieved and -% therefore it is reset always to |utf8|, which seems a sensible -% default. +% Unfortunately, the current encoding cannot be retrieved and +% therefore it is reset always to |utf8|, which seems a sensible +% default. % % \begin{macrocode} %<<*Footnote changes>> @@ -13747,6 +13814,145 @@ wouldn’t exist. \DisableBabelHook{babel-fontspec} <@Font selection@> \def\bbl@provide@extra#1{} +% \end{macrocode} +% +% \section{Support for interchar} +% +% \xetex{} reserves some values for CJK (although they are not set in +% \textsc{xelatex}), so we make sure they are skipped. Define some user +% names for the global classes, too. +% +% \begin{macrocode} +\ifnum\xe@alloc@intercharclass<\thr@@ + \xe@alloc@intercharclass\thr@@ +\fi +\chardef\bbl@xeclass@default@=\z@ +\chardef\bbl@xeclass@cjkideogram@=\@ne +\chardef\bbl@xeclass@cjkleftpunctuation@=\tw@ +\chardef\bbl@xeclass@cjkrightpunctuation@=\thr@@ +\chardef\bbl@xeclass@boundary@=4095 +\chardef\bbl@xeclass@ignore@=4096 +% \end{macrocode} +% +% The machinery is activated with a hook (enabled only if actually +% used). Here |\bbl@tempc| is pre-set with |\bbl@usingxeclass|, defined +% below. The standard mechanism based on |\originalTeX| to save, set +% and restore values is used. |\count@| stores the previous char to be +% set, except at the beginning (0) and after |\bbl@upto|, which is the +% previous char negated, as a flag to mark a range. +% +% \begin{macrocode} +\AddBabelHook{babel-interchar}{beforeextras}{% + \@nameuse{bbl@xechars@\languagename}} +\DisableBabelHook{babel-interchar} +\protected\def\bbl@charclass#1{% + \ifnum\count@<\z@ + \count@-\count@ + \loop + \bbl@exp{% + \\\babel@savevariable{\XeTeXcharclass`\Uchar\count@}}% + \XeTeXcharclass\count@ \bbl@tempc + \ifnum\count@<`#1\relax + \advance\count@\@ne + \repeat + \else + \babel@savevariable{\XeTeXcharclass`#1}% + \XeTeXcharclass`#1 \bbl@tempc + \fi + \count@`#1\relax} +% \end{macrocode} +% +% Now the two user macros. Char classes are declared implicitly, and +% then the macro to be executed at the |babel-interchar| hook is +% created. The list of chars to be handled by the hook defined above +% has internally the form +% |\bbl@usingxeclass\bbl@xeclass@punct@english||\bbl@charclass{.}|% +% |\bbl@charclass{,}| (etc.), where |\bbl@usingxeclass| stores the class to be +% applied to the subsequent characters. The \cs{ifcat} part deals with +% the alternative way to enter characters as macros (eg, |\}|). As a +% special case, hyphens are stored as |\bbl@upto|, to deal with ranges. +% +% \begin{macrocode} +\newcommand\babelcharclass[3]{% + \EnableBabelHook{babel-interchar}% + \bbl@csarg\newXeTeXintercharclass{xeclass@#2@#1}% + \def\bbl@tempb##1{% + \ifx##1\@empty\else + \ifx##1-% + \bbl@upto + \else + \bbl@charclass{% + \ifcat\noexpand##1\relax\bbl@stripslash##1\else\string##1\fi}% + \fi + \expandafter\bbl@tempb + \fi}% + \bbl@ifunset{bbl@xechars@#1}% + {\toks@{% + \babel@savevariable\XeTeXinterchartokenstate + \XeTeXinterchartokenstate\@ne + }}% + {\toks@\expandafter\expandafter\expandafter{% + \csname bbl@xechars@#1\endcsname}}% + \bbl@csarg\edef{xechars@#1}{% + \the\toks@ + \bbl@usingxeclass\csname bbl@xeclass@#2@#1\endcsname + \bbl@tempb#3\@empty}} +\protected\def\bbl@usingxeclass#1{\count@\z@ \let\bbl@tempc#1} +\protected\def\bbl@upto{% + \ifnum\count@>\z@ + \advance\count@\@ne + \count@-\count@ + \else\ifnum\count@=\z@ + \bbl@charclass{-}% + \else + \bbl@error{Double hyphens aren't allowed in \string\babelcharclass\\% + because it's potentially ambiguous}% + {See the manual for further info}% + \fi\fi} +% \end{macrocode} +% +% And finally, the command with the code to be inserted. If the language +% doesn’t define a class, then use the global one, as defined above. +% For the definition there is a intermediate macro, which can be +% ‘disabled’ with |\bbl@ic@<label>@<lang>|. +% +% \begin{macrocode} +\newcommand\babelinterchar[5][]{% + \let\bbl@kv@label\@empty + \bbl@forkv{#1}{\bbl@csarg\edef{kv@##1}{##2}}% + \@namedef{\zap@space bbl@xeinter@\bbl@kv@label @#3@#4@#2 \@empty}% + {\ifnum\language=\l@nohyphenation + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {#5}}% + \bbl@csarg\let{ic@\bbl@kv@label @#2}\@firstofone + \bbl@exp{\\\bbl@for\\\bbl@tempa{\zap@space#3 \@empty}}{% + \bbl@exp{\\\bbl@for\\\bbl@tempb{\zap@space#4 \@empty}}{% + \XeTeXinterchartoks + \@nameuse{bbl@xeclass@\bbl@tempa @% + \bbl@ifunset{bbl@xeclass@\bbl@tempa @#2}{}{#2}} + \@nameuse{bbl@xeclass@\bbl@tempb @% + \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 + @#3@#4@#2 \@empty\endcsname}}}} +\DeclareRobustCommand\enablelocaleinterchar[1]{% + \bbl@ifunset{bbl@ic@#1@\languagename}% + {\bbl@error + {'#1' for '\languagename' cannot be enabled.\\% + Maybe there is a typo.}% + {See the manual for further details.}}% + {\bbl@csarg\let{ic@#1@\languagename}\@firstofone}} +\DeclareRobustCommand\disablelocaleinterchar[1]{% + \bbl@ifunset{bbl@ic@#1@\languagename}% + {\bbl@error + {'#1' for '\languagename' cannot be disabled.\\% + Maybe there is a typo.}% + {See the manual for further details.}}% + {\bbl@csarg\let{ic@#1@\languagename}\@gobble}} %</xetex> % \end{macrocode} % @@ -14227,7 +14433,7 @@ wouldn’t exist. end } \endgroup -\ifx\newattribute\@undefined\else +\ifx\newattribute\@undefined\else % Test for plain \newattribute\bbl@attr@locale \directlua{ Babel.attr_locale = luatexbase.registernumber'bbl@attr@locale' } \AddBabelHook{luatex}{beforeextras}{% @@ -14779,7 +14985,7 @@ function Babel.arabic.justify_hlist(head, line, gc, size, pack) width = node.dimensions(line.head) % The 'natural' width k_curr = #k_list % Traverse backwards, from the end wt_pos = 1 - + while width < goal do subst_done = true k_item = k_list[k_curr].node @@ -15007,14 +15213,14 @@ end \else \bbl@error{\string\babelcharproperty\space can be used only in\\% vertical mode (preamble or between paragraphs)}% - {See the manual for futher info}% + {See the manual for further info}% \fi} \newcommand\bbl@chprop[3][\the\count@]{% \@tempcnta=#1\relax \bbl@ifunset{bbl@chprop@#2}% {\bbl@error{No property named '#2'. Allowed values are\\% direction (bc), mirror (bmg), and linebreak (lb)}% - {See the manual for futher info}}% + {See the manual for further info}}% {}% \loop \bbl@cs{chprop@#2}{#3}% diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index b08918afa2..b47775f117 100644 --- a/macros/latex/required/babel/base/babel.ins +++ b/macros/latex/required/babel/base/babel.ins @@ -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/10/25} +\def\filedate{2023/11/11} \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 4d1628d7d1..da4b04f928 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 e534dab18f..61e273e2f5 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/10/25 v3.96] +\ProvidesFile{bbcompat.dtx}[2023/11/11 v3.97] %</dtx> % %% File 'bbcompat.dtx' |