diff options
author | Norbert Preining <norbert@preining.info> | 2024-07-29 03:01:19 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-07-29 03:01:19 +0000 |
commit | 723685b9d932580ab9c4eebbd5693ae0fbae7852 (patch) | |
tree | f8730d4e8eb0570ac7ac98e98f02919d35cdadda /macros/latex/contrib | |
parent | a69671a9e730947e3a8f7a8038f9684c6600ce74 (diff) |
CTAN sync 202407290301
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r-- | macros/latex/contrib/doibanner/CHANGELOG.md | 51 | ||||
-rw-r--r-- | macros/latex/contrib/doibanner/README.md | 79 | ||||
-rw-r--r-- | macros/latex/contrib/doibanner/doibanner.dtx | 313 | ||||
-rw-r--r-- | macros/latex/contrib/doibanner/doibanner.ins | 23 | ||||
-rw-r--r-- | macros/latex/contrib/doibanner/doibanner.pdf | bin | 375402 -> 297278 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/README.md | 2 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 129 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.pdf | bin | 626752 -> 627459 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.tex | 7 |
9 files changed, 368 insertions, 236 deletions
diff --git a/macros/latex/contrib/doibanner/CHANGELOG.md b/macros/latex/contrib/doibanner/CHANGELOG.md deleted file mode 100644 index 0da2ac7be3..0000000000 --- a/macros/latex/contrib/doibanner/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -# Changelog - -All notable changes to the project `doibanner` are documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project does __not__ adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - - -<!-- ## [Unreleased] --> - - -## [0.2] - \[2024-07-23\] - -Initial release of [this package on the Comprehensive TeX Archive Network (CTAN)](https://www.ctan.org/pkg/doibanner) - -The package contains a revised version of the `doi.sty` and `tutorial/doi.tex` -files. Since the previous material was not publicly available, the changes -listed below are mainly to ensure that I myself do not forget how the structure -of the package has changed. - -### Added - -- `CHANGELOG.md` file to document all notable changes to this project. -- `example/doibanner_example.tex` and resulting standalone as `png` to act as teaser. -- `build.lua` script to install and manage this package via `i3build`. -- `doibanner.dtx` and `doibanner.ins`, which contains a revised melange of the - files `src/doi.sty` and `tutorial/doi.tex` - -### Fixed - -- trailing whitespace from banner and link generated by doibanner and doiurl, respectively -- definition of `urlbase` as package option - -### Removed - -- `\doi` macro, `\doiurl` and `\doibanner` have a mandatory argument beginning - with this version (breaking change) -- `src/doi.sty` and `tutorial/doi.tex` files, the package was converted into - `doibanner.dtx`, which allows unpacking the `doibanner.sty` file from it, - and can be compiled in order to obtain a package documentation. - - -## [0.1] - \[2021/05/09\] - -Initial version of this package. - - -<!-- [unreleased]: https://codeberg.org/Cs137/doibanner/compare/v0.2...HEAD --> -[0.2]: https://codeberg.org/Cs137/doibanner/releases/tag/v0.2 -[0.1]: https://codeberg.org/Cs137/doibanner/releases/tag/v0.1 - diff --git a/macros/latex/contrib/doibanner/README.md b/macros/latex/contrib/doibanner/README.md index 4630c567f4..a28fd46abd 100644 --- a/macros/latex/contrib/doibanner/README.md +++ b/macros/latex/contrib/doibanner/README.md @@ -2,15 +2,79 @@ A LaTeX package to generate DOI banners and links. -![_Screenshot of example output generated with `\doibanner`_](./example/doibanner_example.png "Example output generated with doibanner") +The `doibanner` package allows to generate a banner for a declared [digital +object identifier](https://www.doi.org/the-identifier/what-is-a-doi/) (DOI). +It provides the `\doibanner` macro, which draws the banner using +[`TikZ`](https://www.ctan.org/pkg/tikz) and adds a link via +[`hyperref`](https://www.ctan.org/pkg/hyperref), if desired. Its output can +be scaled by [`adjustbox`](https://www.ctan.org/pkg/adjustbox) and it might +look as follows: +![_DOI banner generated with `\doibanner`_](./example/doibanner_example.png "Example generated with doibanner") -This package includes an updated version of `doi.sty`, initially created for -personal use to enhance scientific documents with DOI banners and links. I've -converted it into `doibanner.dtx` and added documentation, allowing you to -benefit from the package as well. +Latest release: 2024-07-28 v0.3 -Latest release: 2024-07-23 v0.2 + +## Installation + +Skip this section, if `doibanner` is already provided in your TeX distribution. +You should be able to install it [from the CTAN](https://www.ctan.org/pkg/doibanner) +via your distribution's utility (e.g. the TeX Live Utility). + +### Manual installation + +You can get the package's source code from the +[project repository on Codeberg](https://codeberg.org/Cs137/doibanner). +The repository contains a build script, which allows you to build the required +files for the `doibanner` package and copy them into your _TeX Directory Structure_ +(TDS) using `l3build`. Ensure that `l3build` is installed on your system and run +it from the repository's root directory as follows: + +```bash +l3build install --full +``` + +The `--full` option ensures that all necessary files are built and installed. + +If you do not want to install the package into your TDS, but use it in a +particular LaTeX project, follow the steps listed below. + +1. unpack `doibanner.sty` from the `doibanner.dtx` file + - using `l3build` and the `build.lua` script: `l3build unpack`, __or__ + - directly via the installer file: `pdflatex doibanner.ins` +2. copy the extracted `doibanner.sty` file into the same directory as your LaTeX sources. + + +## Usage + +Please consult the [package documentation](http://mirrors.ctan.org/macros/latex/contrib/doibanner/doibanner.pdf) +for detailed usage information. + +If you have any questions or need assistance, feel free to +[open an issue on the repository](https://codeberg.org/Cs137/doibanner/issues). + + +## Contributing + +Contributions to the `doibanner` package are very welcomed. Feel free to submit +a [pull request (PR)](https://codeberg.org/Cs137/doibanner/pulls), if you would +like to contribute to the project. In case you are unfamiliar with the process, +consult the [forgejo documentation](https://forgejo.org/docs/latest/user/pull-requests-and-git-flow/) +and follow the steps using this repository instead of the `example` repository. + +Create your [pull request (PR)](https://codeberg.org/Cs137/doibanner/pulls) to +inform that you started working on a contribution. Provide a clear description +of your envisaged changes and the motivation behind them, prefix the PR's title +with ``WIP: `` until your changes are finalised. + +All kind of contributions are appreciated, whether they are +bug fixes, new features, or improvements to the documentation. + + +### Contributors + +- [Christian Schreinemachers](https://codeberg.org/Cs137) +- [Marei Peischl](https://chaos.social/@TeXhackse) ## Changes @@ -23,4 +87,5 @@ All notable changes to this project are documented in the file This package was created and is maintained by Christian Schreinemachers, (C) 2024. The source code is hosted on [Codeberg](https://codeberg.org/Cs137/doibanner). -This material is subject to the [LaTeX Project Public License 1.3c](https://www.ctan.org/license/lppl1.3). +It is subject to the [LaTeX Project Public License 1.3c](https://www.ctan.org/license/lppl1.3). + diff --git a/macros/latex/contrib/doibanner/doibanner.dtx b/macros/latex/contrib/doibanner/doibanner.dtx index 099cfb6196..e004b53e31 100644 --- a/macros/latex/contrib/doibanner/doibanner.dtx +++ b/macros/latex/contrib/doibanner/doibanner.dtx @@ -14,12 +14,12 @@ % % This work has the LPPL maintenance status `maintained'. % -% The current maintainer of this work is -% Christian Schreinemachers. +% The current maintainer of this work is Christian Schreinemachers. % % This work consists of the files % doibanner.dtx % doibanner.ins +% README.md % and the derived files % doibanner.sty % doibanner.pdf @@ -30,11 +30,16 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{doibanner} -%<package> [2024-07-23 v0.2 Generate DOI banners and links] +%<package> [2024-07-28 v0.3 Generate DOI banners and links] % %<*driver> \documentclass[a4paper]{ltxdoc} -\usepackage[T1]{fontenc} +\usepackage[% + pdfusetitle,% + hyperindex=false,% + pdfsubject={LaTeX package documentation},% + pdfkeywords={doibanner, latex, documentation}% +]{hyperref} \usepackage{doibanner} \usepackage[toc]{multitoc} \usepackage{geometry} @@ -42,10 +47,11 @@ \EnableCrossrefs \CodelineIndex \RecordChanges -\DoNotIndex{\def,\definecolor,\adjustbox,\begin,\bfseries,\DeclareStringOption, - \end,\endinput,\fill,\fontfamily,\href,\hspace,\IfBooleanTF,\Large, - \NewDocumentCommand,\node,\ProcessKeyvalOptions,\RequirePackage, - \SetupKeyvalOptions,\selectfont,\sfdefault,\vspace} +\DoNotIndex{\adjustbox,\begin,\bfseries,\DeclareKeys,\definecolor,\end,\fill, + \fontfamily,\href,\IfBooleanTF,\Large,\NewDocumentCommand,\node, + \ProcessKeyOptions,\RequirePackage,\relax,\selectfont,\SetKeys, + \sfdefault,\tikzstyle} +\setcounter{IndexColumns}{2} \setlength{\IndexMin}{40ex} \setlength{\columnseprule}{.4pt} \addtolength{\oddsidemargin}{2cm} @@ -55,31 +61,6 @@ \end{document} %</driver> % \fi -% \CheckSum{60} -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% -% \changes{v0.2}{2024-07-23}{Add documentation} -% \changes{v0.2}{2024-07-23}{Convert into dtx} -% \changes{v0.1}{2021/05/09}{Initial version} -% -% \GetFileInfo{doibanner.sty} -% -% -% ^^A ----------------------------- % % \pagestyle{headings} % @@ -90,6 +71,23 @@ % % ^^A ----------------------------- % +% \changes{v0.3}{2024-07-28}{% +% Add package options \opt{width} and \opt{label}, +% fix mistakes, +% improve documentation, +% remove unnecessary dependencies} +% \changes{v0.2}{2024-07-23}{% +% Initial release, +% convert into dtx, +% add documentation, +% add \opt{urlbase} package option} +% \changes{v0.1}{2021/05/09}{Initial version} +% +% \GetFileInfo{doibanner.sty} +% +% +% ^^A ----------------------------- +% % \title{The \package{doibanner} package} % \author{Christian Schreinemachers} % \date{% @@ -97,23 +95,18 @@ % \package{doibanner}~\fileversion % ~(\href{https://codeberg.org/Cs137/doibanner/releases/tag/\fileversion}{source code})}% % } -% \hypersetup{% -% pdfauthor={Christian Schreinemachers},% -% pdftitle={The doibanner package},% -% pdfsubject={LaTeX package documentation},% -% pdfkeywords={doibanner, latex, documentation}% -% } % \maketitle % % % ^^A ----------------------------- % % \begin{abstract} -% The \package{doibanner} package allows to generate a banner for a -% declared DOI. It provides the \cs{doibanner} macro, which draws the -% banner using \package{TikZ} and adds a link via \package{hyperref}, -% if desired. Its output might look as follows: -% \par\medskip\centering{\doibanner*{xx.xxxx/yyyyyy.zzzzzzzz}} +% The \package{doibanner} package allows to generate a banner for a declared +% \href{https://www.doi.org/the-identifier/what-is-a-doi/}{digital object identifier} +% (DOI). It provides the \cs{doibanner} macro, which draws the banner using +% \package{TikZ} and adds a link via \package{hyperref}, if desired. Its +% output can be scaled by \package{adjustbox} and it might look as follows: +% \par\medskip\centering{\doibanner*[width=5cm]{xx.xxxx/yyyyyy.zzzzzzzz}} % \end{abstract} % % @@ -126,21 +119,27 @@ % % \section{Introduction} % ^^A -% I published several documents on \href{https://zenodo.org/}{\textit{Zenodo}}, -% a general-purpose open repository. They offer to register a DOI for an -% entry and download a banner of it. The latter can be added to contents -% foreseen for the entry, or when referring to it. +% I published several documents on \href{https://zenodo.org/}{\emph{Zenodo}}, +% a general-purpose open repository. They offer to register a +% \href{https://www.doi.org/the-identifier/what-is-a-doi/}{digital object identifier} +% (DOI) for an entry and download a banner of it. The latter can be added to +% contents foreseen for the entry, or e.g. when referring to the entry in a +% slide deck. +% +% Since I frequently use such banners in \LaTeX{} documents, I decided to +% create a package that generates a similar banner and includes a link to the +% corresponding URL. Additionally, this package eliminates the need to +% manually download the banner and manage a file that might be used across +% multiple documents. % -% In order to avoid the manual step of downloading a banner to add to -% my material, I decided to create a \LaTeX{} package that draws a comparable -% banner and includes a link to the corresponding URL. Due to the motivation, -% the resulting banner is heavily inspired by the design applied in the -% banner offered by \textit{Zenodo}. It is drawn using the \package{tikz} -% package the link is included with \package{hyperref}. +% Due to the motivation, the resulting banner is heavily inspired by the +% design applied in the banner offered by \emph{Zenodo}. It is drawn using +% the \package{tikz} package, a link to its URL can be included with +% \package{hyperref}, and it can be scaled using \package{adjustbox}. % -% The application of this package is not limited to \textit{Zenodo} -% depositions, it can be used to create a banner from a DOI string that -% can be included in any \LaTeX{} document. +% The application of this package is not limited to \emph{Zenodo} +% depositions, it can be used to create a banner for a DOI that can +% be included in any \LaTeX{} document. % % % ^^A ----------------------------- @@ -159,43 +158,63 @@ % % \subsection{Options} % ^^A +% In order to change the default behaviour of this package, declare one +% or more of the options described in this subsection with your desired +% value. +% +% \DescribeMacro{label=\meta{string}} +% \default{DOI} specifies the label (left part) of the DOI banner generated +% by \cs{doibanner}. The widths of the left and right part of the banner +% are fixed and do currently not take the length of the text displayed on +% top into account. Consequently, only a short expression should be declared +% as value for the option \opt{label}. +% % \DescribeMacro{urlbase=\meta{string}} -% \default{https://doi.org/} specifies the prefix to convert a DOI string -% into an URL, for normal usecases this does not require any adjustment. +% \default{https://doi.org/} specifies the base URL to convert a DOI string +% into its URL, for normal use cases this does not require any adjustment. +% +% \DescribeMacro{width=\meta{dimen}} +% \default{3.6cm} specifies the total width of the DOI banner generated by +% \cs{doibanner}. The widths of the individual parts of the banner are +% fixed and can currently not be changed. % % % ^^A ----------------------------- % % \subsection{Macros} % ^^A -% The following subsections list the content that can be generated with this package. +% \subsubsection*{\cs{doibanner}\oarg{dimen}\marg{string}} % -% \subsubsection*{doibanner} -% ^^A -% \DescribeMacro{\doibanner\marg{string}} -% A DOI banner can be created using the command \cs{doibanner}, which -% requires a DOI string as argument. -% An execiton of \cs{doibanner\{xx.xxxx/yyyyyy.zzzzzzzz\}}, generates the -% following banner: \doibanner{xx.xxxx/yyyyyy.zzzzzzzz} +% A DOI banner can be created using the command \cs{doibanner}, which requires +% a DOI string as argument. Moreover, a \oarg{dimen} option can be defined. +% The latter specifies the banner's width. If it is not declared, the value +% of the \opt{width} package option is taken into account \default{3.6cm}. +% +% \DescribeMacro{\doibanner} +% An execution of \cs{doibanner\{xx.xxxx/yyyyyy.zzzzzzzz\}} results in this +% banner: \doibanner{xx.xxxx/yyyyyy.zzzzzzzz} If a banner with a width of +% let's say 3\,cm is desired, it can be achieved by specifying the macro option +% \opt{width} accordingly (\cs{doibanner}\opt{[width=3cm]\{xx.xxxx/yyyyyy.zzzzzzzz\}}): +% \doibanner[width=3cm]{xx.xxxx/yyyyyy.zzzzzzzz} % -% \DescribeMacro{\doibanner*\marg{string}} +% \DescribeMacro{\doibanner*} % The starred version of the command leads to the same banner, but it does % not contain a link to the DOI's URL: % \doibanner*{xx.xxxx/yyyyyy.zzzzzzzz} % -% \subsubsection*{doiurl} +% \subsubsection*{\cs{doiurl}\marg{string}} % ^^A -% \DescribeMacro{\doiurl\marg{string}} +% \DescribeMacro{\doiurl} % An URL is generated by appending the provided \emph{string} to the string % defined as the package option \opt{urlbase}. The resulting link is labelled % with the DOI string. % A call of \cs{doiurl\{xx.xxxx/yyyyyy.zzzzzzzz\}} results in % \doiurl{xx.xxxx/yyyyyy.zzzzzzzz}. % -% \DescribeMacro{\doiurl*\marg{string}} +% \DescribeMacro{\doiurl*} % The command is also available as starred version, which prints the full % URL instead of the DOI string and does not include a link. Its output for -% the aforementioned example will be as follows: +% the aforementioned example is as follows: % \doiurl*{xx.xxxx/yyyyyy.zzzzzzzz}. % % @@ -212,14 +231,25 @@ % % \MaybeStop{ % +% \IndexPrologue{% +% \section{Index} +% Numbers written in italic refer to the page where the corresponding entry +% is described; numbers underlined refer to the code line of the definition; +% numbers in roman refer to the code lines where the entry is used. +% } % \PrintIndex % +% \GlossaryPrologue{% +% \section{Change History} +% The changes listed in this section aim to provide a brief overview of the +% changes introduced into the package \package{doibanner}. The +% \href{https://codeberg.org/Cs137/doibanner/}{package repository on Codeberg} +% contains a +% \href{https://codeberg.org/Cs137/doibanner/src/branch/main/CHANGELOG.md}{changelog file}, +% consult it to read a detailed description of the changes introduced into +% this package. +% } % \PrintChanges -% \par\noindent -% The -% \href{https://codeberg.org/Cs137/doibanner/}{package repository on Codeberg} -% contains a detailed -% \href{https://codeberg.org/Cs137/doibanner/src/branch/main/CHANGELOG.md}{changelog file}. % % } % @@ -232,11 +262,9 @@ % ^^A % In order to use \package{doibanner}, the packages % \href{https://www.ctan.org/pkg/adjustbox}{\package{adjustbox}}, -% \href{https://www.ctan.org/pkg/hyperref}{\package{hyperref}}, -% \href{https://www.ctan.org/pkg/kvoptions}{\package{kvoptions}}, -% \href{https://www.ctan.org/pkg/tikz}{\package{tkiz}}, and -% \href{https://www.ctan.org/pkg/xparse}{\package{xparse}} -% are required as dependencies. +% \href{https://www.ctan.org/pkg/hyperref}{\package{hyperref}}, and +% \href{https://www.ctan.org/pkg/tikz}{\package{tkiz}} +% are required as package dependencies. % % \iffalse %<*package> @@ -244,9 +272,30 @@ % \begin{macrocode} \RequirePackage{adjustbox} \RequirePackage{hyperref} -\RequirePackage{kvoptions} \RequirePackage{tikz} -\RequirePackage{xparse} +% \end{macrocode} +% +% +% ^^A ----------------------------- +% +% \subsection{Constants} +% ^^A +% Definition of colours for the banner areas and labels, custom colour +% definitions are currently not supported. +% \begin{macrocode} +\definecolor{leftcolor}{RGB}{82,82,82} +\definecolor{rightcolor}{RGB}{6,119,183} +% +\definecolor{toptextcolor}{RGB}{235,235,235} +\definecolor{bottomtextcolor}{RGB}{59,59,59} +% \end{macrocode} +% ^^A +% Definition of font and colour for the banner's top and bottom text layers. +% \begin{macrocode} +\tikzstyle{toptextstyle} = [ + font=\fontfamily{\sfdefault}\selectfont\bfseries\Large,toptextcolor] +\tikzstyle{bottomtextstyle} = [ + font=\fontfamily{\sfdefault}\selectfont\bfseries\Large,bottomtextcolor] % \end{macrocode} % % @@ -254,15 +303,31 @@ % % \subsection{Options} % ^^A -% \begin{macro}{\doibanner@urlbase} -% \changes{v0.2}{2024-07-23}{Add \opt{urlbase} option} -% The package options and are internally available as \cs{doibanner@}\meta{option}. +% The package options are internally available as \cs{@doibanner@}\meta{option}. % \begin{macrocode} -\SetupKeyvalOptions{family=doibanner,prefix=doibanner@} -\DeclareStringOption[https://doi.org/]{urlbase} -\ProcessKeyvalOptions{doibanner} +\DeclareKeys[@doibanner]{ + label.store = \@doibanner@label, + label.usage = load, + urlbase.store = \@doibanner@urlbase, + urlbase.usage = load, + width.store = \@doibanner@width, + width.usage = load, +} +% \end{macrocode} +% +% \subsubsection*{Assignement of default values} +% \begin{macrocode} +\SetKeys[@doibanner]{ + label=DOI, + urlbase=https://doi.org/, + width=3.6cm, +} +% \end{macrocode} +% +% \subsubsection*{Processing of package options} +% \begin{macrocode} +\ProcessKeyOptions[@doibanner]\relax % \end{macrocode} -% \end{macro} % % % ^^A ----------------------------- @@ -272,28 +337,29 @@ % \changes{v0.2}{2024-07-23}{Remove \cs{doi} macro} % % \begin{macro}{\doiurl} -% \changes{v0.2}{2024-07-23}{Remove trailing whitespace} -% The \meta{string} is appended to the option \opt{urlbase} to -% generate an URL. +% \changes{v0.2}{2024-07-23}{Remove trailing space} +% \oarg{dimen}\\ +% The \meta{string} is appended to the package option \opt{urlbase} to +% generate the URL. % \begin{macrocode} \NewDocumentCommand\doiurl{s m}{% \IfBooleanTF#1 - {\doibanner@urlbase#2}% - {\href{\doibanner@urlbase#2}{#2}}% + {\@doibanner@urlbase#2}% + {\href{\@doibanner@urlbase#2}{#2}}% } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doibanner@draw} -% Draw the DOI banner including its \meta{string}. +% \begin{macro}{\@doibanner@draw} +% \changes{v0.3}{2024-07-28}{Rename macro, remove top part} +% \oarg{dimen}\marg{string}\\ +% Draw the DOI banner including its \opt{label} and \meta{string}, provide +% \opt{width=\meta{dimen}} to define the banners width as well. % \begin{macrocode} -\definecolor{leftcolor}{RGB}{85,85,85} -\definecolor{rightcolor}{RGB}{0,126,198} -\definecolor{topcolor}{RGB}{59,59,59} -\definecolor{bottomtextcolor}{RGB}{60,60,60} -\NewDocumentCommand\doibanner@draw{ O{width=3.6cm} m}{% +\NewDocumentCommand\@doibanner@draw{o m}{% \adjustbox{#1}{% \begin{tikzpicture} +% left part \fill [leftcolor,draw] (1.5,0) -- ++(0,.8) {[rounded corners=5] -- @@ -301,8 +367,9 @@ ++(0,-.8)} -- cycle {}; - \node[bottomtextcolor] at (.75,.35) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large DOI}}; - \node[white] at (.75,.4) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large DOI}}; + \node[bottomtextstyle] at (.75,.35) {\@doibanner@label}; + \node[toptextstyle] at (.75,.4) {\@doibanner@label}; +% right part \fill [rightcolor,draw] (1.5,0) {[rounded corners=5] -- ++(6.5,0) -- @@ -310,38 +377,30 @@ ++(-6.5,0) -- cycle {}; - \node[bottomtextcolor] at (4.75,.35) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large #2}}; - \node[white] at (4.75,.4) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large #2}}; - \fill [topcolor,draw,opacity=0.1] - (0,0) [rounded corners=5] -- - ++(8,0) -- - ++(0,.8) -- - ++(-8,0) -- - cycle - {}; - \end{tikzpicture} - \hspace{-4mm} - \vspace{-4mm} - } + \node[bottomtextstyle] at (4.75,.35) {#2}; + \node[toptextstyle] at (4.75,.4) {#2}; + \end{tikzpicture}% + }% } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doibanner@draw} -% \changes{v0.2}{2024-07-23}{Remove trailing whitespace} -% Display the DOI banner with or without (*) a link to its URL. +% \begin{macro}{\doibanner} +% \changes{v0.3}{2024-07-28}{Add \opt{width} option} +% \changes{v0.2}{2024-07-23}{Remove trailing space} +% \oarg{dimen}\marg{string}\\ +% Display the DOI banner with or without (*) a link to its URL. Specify a +% \oarg{dimen}, if you want a banner width deviating from the one defined +% as \opt{width} package option. % \begin{macrocode} -\NewDocumentCommand\doibanner{s m}{% +\NewDocumentCommand\doibanner{s O{width=\@doibanner@width} m}{% \IfBooleanTF#1 - {\doibanner@draw{#2}}% - {\href{\doibanner@urlbase#2}{\doibanner@draw{#2}}}% + {\@doibanner@draw[#2]{#3}}% + {\href{\@doibanner@urlbase#3}{\@doibanner@draw[#2]{#3}}}% } % \end{macrocode} % \end{macro} % -% \begin{macrocode} -\endinput -% \end{macrocode} % \iffalse %</package> % \fi diff --git a/macros/latex/contrib/doibanner/doibanner.ins b/macros/latex/contrib/doibanner/doibanner.ins index 177fe7e6f6..97cfbb3fbb 100644 --- a/macros/latex/contrib/doibanner/doibanner.ins +++ b/macros/latex/contrib/doibanner/doibanner.ins @@ -11,6 +11,29 @@ %% and version 1.3c or later is part of all distributions of %% LaTeX version 2008-05-04 or later. %% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The current maintainer of this work is Christian Schreinemachers. +%% +%% This work consists of the files +%% doibanner.dtx +%% doibanner.ins +%% README.md +%% and the derived files +%% doibanner.sty +%% doibanner.pdf +%% +This work has the LPPL maintenance status `maintained'. + +The current maintainer of this work is Christian Schreinemachers. + +This work consists of the files + doibanner.dtx + doibanner.ins + README.md +and the derived files + doibanner.sty + doibanner.pdf \input docstrip.tex \keepsilent diff --git a/macros/latex/contrib/doibanner/doibanner.pdf b/macros/latex/contrib/doibanner/doibanner.pdf Binary files differindex e44caf66be..546b0c9de1 100644 --- a/macros/latex/contrib/doibanner/doibanner.pdf +++ b/macros/latex/contrib/doibanner/doibanner.pdf diff --git a/macros/latex/contrib/easybook/README.md b/macros/latex/contrib/easybook/README.md index 1e4a07e45a..78d3bea3a8 100644 --- a/macros/latex/contrib/easybook/README.md +++ b/macros/latex/contrib/easybook/README.md @@ -1,5 +1,5 @@ # The `easybook` document class -Easily typesetting Chinese theses or books (v2024cw) +Easily typesetting Chinese theses or books (v2024cx) ## Abstract `easybook` is a pure academic template created based on the `ctexbook` book document class. It also has the functions of `book` and `article` document class. Combined with the general framework design of the theses of many universities in China, providing multiple commands and interfaces allows users to easily customize the theses templates. Its basic macro package `easybase` can also be used with `ctex` and standard document classes. diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 0c58d9d4f0..c091ac2f01 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -14,7 +14,7 @@ % This work has the LPPL maintenance status `maintained'. %<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15] %<*class> -\ProvidesExplClass{easybook}{2024/07/23}{2024cw} +\ProvidesExplClass{easybook}{2024/07/28}{2024cx} {Easily typesetting Chinese theses or books} \bool_new:N \l__eb_compile_draft_bool @@ -301,7 +301,7 @@ %</class> %<*package> \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2024/07/23}{2024cw} +\ProvidesExplPackage{easybase}{2024/07/28}{2024cx} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -878,7 +878,7 @@ \str_case:nnF {#1} { { bottom } - { \bool_set_true:N \l__eb_fnpara_bottom_bool } + { \PushFntBottom } { flush } { \tl_set:Nn \l__eb_footnote_value_tl { plain } @@ -911,7 +911,6 @@ } } -\bool_new:N \l__eb_fnpara_bottom_bool \tl_new:N \l__eb_fnmarktext_format_tl \tl_new:N \l__eb_fncustom_format_tl \clist_new:N \l__eb_footnote_value_clist @@ -969,58 +968,91 @@ { page } { \counterwithin*{footnote}{page} } } { \counterwithout*{footnote}{chapter} } - \eb_fnpara_if_pos_bottom: } -\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont } -\cs_new:Npn \eb@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi } -\cs_new_protected:Npn \eb_fnpara_if_pos_bottom: + +\def\@if@footnotes@TF #1#2 {\ifvoid\footins #2\else #1\fi} +\def\@outputbox@removebskip + { + \ifx\@textbottom\relax\else + \@outputbox@append + { + \@tempskipa\lastskip + \ifnum\gluestretchorder\@tempskipa>\z@ + \vskip -\@tempskipa + \xdef\@outputbox@reinsertbskip + {\noexpand\@outputbox@append{\vskip\the\@tempskipa}} + \else + \global\let\@outputbox@reinsertbskip\relax + \fi + } + \fi + } +\let\@outputbox@reinsertbskip\relax +\def\@outputbox@append #1 + { + \setbox\@outputbox\vbox + { + \boxmaxdepth\@maxdepth + \dimen@\dp\@outputbox + \unvbox\@outputbox + #1 + } + } +\def\@outputbox@attachfloats{\@combinefloats} +\NewHook{makecol/footins/before} +\NewHook{makecol/footins/begin} +\def\@outputbox@appendfootnotes { - \bool_if:NT \l__eb_fnpara_bottom_bool + \@if@footnotes@TF { - \IfPackageLoadedTF{footmisc} - {\msg_warning:nn { easybase } { bottom-not-compatible }} + \UseHook{makecol/footins/before} + \@outputbox@append { - \cs_set:Npn \@makecol - { - \setbox\@outputbox\box\@cclv - \let\@elt\relax - \xdef\@freelist{\@freelist\@midlist} - \global\let\@midlist\@empty - \@combinefloats - \eb@ifvoid\footins{} - { - \setbox\@outputbox\vbox - { - \boxmaxdepth\@maxdepth - \unvbox\@outputbox - \vfill\relax - \vskip\skip\footins - \color@begingroup - \normalcolor\footnoterule - \unvbox\footins - \color@endgroup - } - } - \eb@ifvoid\@kludgeins - {\@makespecialcolbox} - { - \setbox\@outputbox\vbox to\@colht - { - \@texttop\dimen@\dp\@outputbox - \unvbox\@outputbox - \vskip -\dimen@\@textbottom - } - } - \global\maxdepth\@maxdepth - } + \vskip\skip\footins + \UseHook{makecol/footins/begin} + \color@begingroup + \normalcolor + \footnoterule + \@nameuse{pdfcolfoot@current} + \unvbox\footins + \color@endgroup } + }{} + } +\def\@makenormalcolbox + { + \setbox\@outputbox\vbox to\@colht + { + \@texttop + \dimen@\dp\@outputbox + \unvbox\@outputbox + \vskip -\dimen@ + \@textbottom } } -\msg_new:nnn { easybase } { bottom-not-compatible } +\cs_new_protected:Npn \PushFntBottom { - Not~compatible~with~the~'footmisc'~package. \\ - Please~use~the~'bottom'~option~of~'footmisc'~package. + \cs_set:Npn \@makecol + { + \setbox\@outputbox\box\@cclv + \@outputbox@removebskip + \let\@elt\relax + \xdef\@freelist{\@freelist\@midlist} + \global\let\@midlist\@empty + \@outputbox@attachfloats + \@if@footnotes@TF + {\@outputbox@append{\vfill}} + {\@outputbox@reinsertbskip} + \@outputbox@appendfootnotes + \ifvbox\@kludgeins + \@makespecialcolbox + \else + \@makenormalcolbox + \fi + \global\maxdepth\@maxdepth + } } +\@onlypreamble\PushFntBottom \cs_new_protected:Npn \eb_footnote_direct_hang: { @@ -1076,6 +1108,7 @@ \l__eb_fnpara_format_tl{#1} \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } } +\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont } \clist_map_inline:nn { \@footnotetext,\@mpfootnotetext } { \eb_patch_cmd:Nnn #1 @@ -2698,7 +2731,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/07/23}{2024cw} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/07/28}{2024cx} {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 3a024e81c2..89d4294355 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 41a18b12ca..3b783b8676 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 = v2024cw, - date = 2024/07/23, + version = v2024cx, + date = 2024/07/28, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -710,6 +710,8 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \ebhdrset{footnotetype = plain,footnotetype = bottom} \ebhdrset{footnotetype = {hang,bottom}} \end{ctexexam} + \command{PushFntBottom}\newtagv{2024cx}% + 默认情况下当具有 \code{b} 参数的底部浮动体与脚注同时存在时,脚注将位于浮动体上部。此命令可使脚注始终位于页面底部,与 \keyis{footnotetype}{bottom} 作用相同,只能在导言区全局使用。 \keyval{fnfirstindent}{刚性长度}\Default{1em} 每个脚注首段的首行缩进(悬挂缩进 \code{hang} 为整段缩进),等于长度 \cs{fnfirstindent} 的值。 \keyval{fnafterindent}{刚性长度}\Default{2em} @@ -1461,6 +1463,7 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \shortversion{v = 2024co,date = 2024/07/06,changes = 目录命令的可选参数支持 \CTeX 键值列表所有路径的章节标题样式选项。} \shortversion{v = 2024cq,date = 2024/07/12,changes = 新增章节标题格式复制命令 \cs{CopyTitleFormat}。} \shortversion{v = 2024cu,date = 2024/07/20,changes = 修复无编号的定理环境标签命令 \cs*{p@}\meta{定理名} 缺失导致报错的问题。} + \shortversion{v = 2024cx,date = 2024/07/28,changes = 新增将脚注置于页面底部的命令 \cs{PushFntBottom}。} \end{changelog} \nocite{*} % \AddToHook{cmd/printindex/before}{\clearpage} |