summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-08-30 03:01:31 +0000
committerNorbert Preining <norbert@preining.info>2022-08-30 03:01:31 +0000
commita77b48e45a7d631d231a8eee66703ce9c02c44c9 (patch)
tree7850cc2376ad8a70365c34f328e444fde3cd3e24 /macros/latex
parent7608bc5b1a3303bcbcbc8f677d3562d6da3a9674 (diff)
CTAN sync 202208300301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md2
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty57
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-1.pdfbin32138 -> 0 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-2.pdfbin13501 -> 0 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-3.pdfbin13736 -> 0 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdfbin164900 -> 180151 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex15
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md4
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdfbin1685602 -> 1689051 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex23
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx122
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx17
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx138
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx14
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx120
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx113
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx39
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-CCNU.bbx4
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-NWAFU.bbx48
-rw-r--r--macros/latex/contrib/hereapplies/ChangeLog.md12
-rw-r--r--macros/latex/contrib/hereapplies/README.md74
-rw-r--r--macros/latex/contrib/hereapplies/hereapplies-example.pdfbin49778 -> 49764 bytes
-rw-r--r--macros/latex/contrib/hereapplies/hereapplies-example.tex17
-rw-r--r--macros/latex/contrib/hereapplies/hereapplies.sty585
-rw-r--r--macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx20
-rw-r--r--macros/latex/contrib/hereapplies/package.json2
-rw-r--r--macros/latex/required/babel/base/README.md20
-rw-r--r--macros/latex/required/babel/base/babel.dtx444
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin883440 -> 883632 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
31 files changed, 1126 insertions, 768 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
index 5049c78a1d..20a504e5a1 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
@@ -2,7 +2,7 @@
A beamer inner theme which reproduces standard beamer blocks using tcolorboxes
-Current version: 2022/08/27 version v0.2
+Current version: 2022/08/29 version v0.3
This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
index 3d5aaf5e93..751c2754b4 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
@@ -12,7 +12,7 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{beamerinnerthemetcolorbox}[2022/08/27 version v0.2 Beamer blocks with tcolorboxes]
+\ProvidesPackage{beamerinnerthemetcolorbox}[2022/08/29 version v0.3 Beamer blocks with tcolorboxes]
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,hooks}
@@ -24,17 +24,21 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifbeamer@tcb@rounded
\newif\ifbeamer@tcb@shadow
+\newif\ifbeamer@tcb@shaded
\def\beamer@tcb@true{true}
\DeclareOptionBeamer{shadow}[true]{\csname beamer@tcb@shadow#1\endcsname}
-\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname}
+\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname\csname beamer@tcb@shaded#1\endcsname}
+\DeclareOptionBeamer{shaded}[true]{\csname beamer@tcb@shaded#1\endcsname}
\ExecuteOptionsBeamer{shadow=false}
\ExecuteOptionsBeamer{rounded=false}
+\ExecuteOptionsBeamer{shaded=false}
% check options from other themes
\ifdefined\beamer@themerounded@shadow
\beamer@tcb@roundedtrue
+ \beamer@tcb@shadedtrue
\ifx\beamer@themerounded@shadow\beamer@tcb@true
\beamer@tcb@shadowtrue
\fi
@@ -49,14 +53,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\beamer@tcb@colini}[1][]{
- \usebeamercolor[bg]{block body#1}
+ \usebeamercolor{block body#1}
\colorlet{beamer@tcb@bodybg}{block body#1.bg}
- \usebeamercolor[fg]{block body#1}
\colorlet{beamer@tcb@bodyfg}{block body#1.fg}
- \usebeamercolor[bg]{block title#1}
+ \usebeamercolor{block title#1}
\colorlet{beamer@tcb@titlebg}{block title#1.bg}
- \usebeamercolor[fg]{block title#1}
- \colorlet{beamer@tcb@titlefg}{block title#1.fg}
+ \colorlet{beamer@tcb@titlefg}{block title#1.fg}
+ \usebeamercolor{normal text}
}
\beamer@tcb@colini
@@ -66,7 +69,10 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tcbset{
- oversize=0mm,
+ oversize=0mm
+}
+
+\tcbsetforeverylayer{
left=0.05cm,
right=0.05cm,
enhanced,
@@ -82,21 +88,26 @@
% optional settings
\ifbeamer@tcb@rounded
- \tcbset{
+ \tcbsetforeverylayer{
arc=1.3mm,
top=0.8mm,
toptitle=0.2mm,
bottom=0mm,
+ }
+\else
+ \tcbsetforeverylayer{sharpish corners}
+\fi
+
+\ifbeamer@tcb@shaded
+ \tcbsetforeverylayer{
title code app={
\shade[top color=beamer@tcb@titlebg,bottom color=beamer@tcb@bodybg] (title.south west) rectangle ([yshift=-0.5mm]title.south east);
- }
+ }
}
-\else
- \tcbset{sharpish corners}
\fi
\ifbeamer@tcb@shadow
- \tcbset{drop fuzzy shadow=black!90}
+ \tcbsetforeverylayer{drop fuzzy shadow=black!90}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -110,10 +121,10 @@
\setbeamertemplate{block begin}{%
\beamer@tcb@colini
\unless\ifbeamer@tcb@rounded
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\ifx\insertblocktitle\@empty\else
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\begin{tcolorbox}[
colback=beamer@tcb@bodybg,
@@ -121,7 +132,7 @@
coltext=beamer@tcb@bodyfg,
coltitle=beamer@tcb@titlefg,
before title={\usebeamerfont{block title}},
- before upper={\usebeamerfont{block body}},
+ before upper={\usebeamercolor{block body}\usebeamerfont{block body}},
]
}
\setbeamertemplate{block end}{\end{tcolorbox}}
@@ -130,10 +141,10 @@
\setbeamertemplate{block alerted begin}{%
\beamer@tcb@colini[ alerted]
\unless\ifbeamer@tcb@rounded
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\ifx\insertblocktitle\@empty\else
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\begin{tcolorbox}[
colback=beamer@tcb@bodybg,
@@ -141,19 +152,19 @@
coltext=beamer@tcb@bodyfg,
coltitle=beamer@tcb@titlefg,
before title={\usebeamerfont{block title alerted}},
- before upper={\usebeamerfont{block body alerted}},
+ before upper={\usebeamercolor{block body alerted}\usebeamerfont{block body alerted}},
]
}
\setbeamertemplate{block alerted end}{\end{tcolorbox}}
% example block
\setbeamertemplate{block example begin}{%
-\beamer@tcb@colini[ example]
+ \beamer@tcb@colini[ example]
\unless\ifbeamer@tcb@rounded
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\ifx\insertblocktitle\@empty\else
- \tcbset{title={\insertblocktitle}}
+ \tcbsetforeverylayer{title={\insertblocktitle}}
\fi
\begin{tcolorbox}[
colback=beamer@tcb@bodybg,
@@ -161,7 +172,7 @@
coltext=beamer@tcb@bodyfg,
coltitle=beamer@tcb@titlefg,
before title={\usebeamerfont{block title example}},
- before upper={\usebeamerfont{block body example}},
+ before upper={\usebeamercolor{block body example}\usebeamerfont{block body example}},
]
}
\setbeamertemplate{block example end}{\end{tcolorbox}}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-1.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-1.pdf
deleted file mode 100644
index b31b6f1688..0000000000
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-1.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-2.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-2.pdf
deleted file mode 100644
index 6e192a7254..0000000000
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-2.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-3.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-3.pdf
deleted file mode 100644
index 5b91d47c62..0000000000
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc-listing-3.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
index 2dcbeb4d6a..754ac99b4e 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
index f4ff59f91c..2ec15bdaaf 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
@@ -78,7 +78,7 @@
\url{https://github.com/samcarter/beamertheme-tcolorbox}\\
\url{https://www.ctan.org/pkg/beamertheme-tcolorbox}
}{samcarter}}
-\date{Version v0.2 \textendash{} 2022/08/27}
+\date{Version v0.3 \textendash{} 2022/08/29}
\begin{document}
\maketitle
@@ -138,13 +138,20 @@ In this simple configuration, the look and feel of the new blocks will be taken
\section{Options}
-In addition to automatically adopting settings from the other themes, one can also influence the look and feel via the two options \lstinline|rounded| and \lstinline|shadow|, which can be set to \lstinline|true| or \lstinline|false| (calling either option without explicit \lstinline|true| or \lstinline|false| will set it to \lstinline|true|).
+In addition to automatically adopting settings from the other themes, one can also influence the look and feel via these options:
+\begin{description}
+\item[rounded] controls if corners are rounded or sharp (default: \lstinline|false|)
+\item[shadow] controls if the block has a shadow (default: \lstinline|false|)
+\item[shaded] controls if there is a short colour gradient between the title and the body or if there is a sharp border between the colours (Default: \lstinline|false|; if rounded corners are activated, it is \lstinline|true|)
+\end{description}
+These options can be set to \lstinline|true| or \lstinline|false| (calling either option without explicit \lstinline|true| or \lstinline|false| will set it to \lstinline|true|).
\begin{tcolorbox}[title={}]
\begin{lstlisting}
\useinnertheme[
rounded
- shadow=false
+ shadow=false,
+ shaded
]{tcolorbox}
\end{lstlisting}
\end{tcolorbox}
@@ -190,7 +197,7 @@ Beyond these two options, the users also has the myriads of options of the tcolo
\documentclass{beamer}
\usetheme{Ilmenau}
\useinnertheme{tcolorbox}
-\tcbset{
+\tcbsetforeverylayer{
boxrule=3pt,
borderline={1pt}{0pt}{pink,dashed},
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
index 004f888587..1fd012bf04 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
@@ -1,4 +1,4 @@
-<b>Date of last change: 2022-05-17 to version v1.1i</b>
+<b>Date of last change: 2022-08-29 to version v1.1j</b>
# biblatex-gb7714-2015: a biblatex style package
@@ -65,7 +65,6 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
* [nputhesis(NPU 博士、硕士学位论文 \LaTeX 模板)](https://github.com/NPUSCG/nputhesis)
* [nuaa-thesis(南京航空航天大学本科、硕士和博士学位论文的样式模板)](https://github.com/nuaa803/nuaa-thesis)
* [nudtpaper(nudt学位论文模板)](https://github.com/liubenyuan/nudtpaper)
-* [nwafuthesis(西北农林科技大学学位论文LaTeX文档类)](https://github.com/registor/nwafuthesis)
* [shtthesis (ShangHaiTech university THESIS)](https://github.com/lirundong/shtthesis)
* [SHMTUThesis(上海海事大学 LaTeX 学位论文模板)](https://github.com/hellckt/SHMTUThesis)
* [SJTUThesis(上海交通大学学位论文模板)](https://github.com/sjtug/SJTUThesis) (母校的论文模板,不得不说缘分真的很神奇,16年一出来就用上)
@@ -1592,6 +1591,7 @@ please see the file 'biblatex-gb7714-2015.pdf' for further information!
* 2022/04/03 v1.1g,ctan,github
* 2022/04/16 v1.1h,ctan,github
* 2022/05/17 v1.1i,ctan,github
+* 2022/08/29 v1.1j,ctan,github
---------------------------------------------------------
## Update history:
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
index eabdc8f03f..7c1e2439bd 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
index 8895c17937..3de096d3f9 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
@@ -401,7 +401,8 @@ perl gb7714texttobib.pl in=textfilename out=bibfilename
\subsubsection{新增选项}\label{sec:added:opt}
-样式包新增了一些选项,用于标签对齐方式、出版项缺省处理、责任者(作者)缺省处理等功能的控制,其使用方式与biblatex宏包选项完全相同:
+样式包新增了一些选项和命令,新增选项更常用一些,所以在本节集中介绍,而新增命令往往涉及更细节的修改,所以在后面介绍各类格式调整的内容中介绍。
+新增选项用于标签对齐方式、出版项缺省处理、责任者(作者)缺省处理等功能的控制,其使用方式与biblatex宏包选项完全相同:
\begin{description}
\pdfbookmark[4]{gbalign}{gbalign}
@@ -965,6 +966,16 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
对于表格环境中的引用无法产生脚注文献表的问题,可以将其置于小页环境中实现或者采用前述图标标题中的类似处理方式。
注意:latex核心代码参考latex.ltx,而hyperref代码参考hyperref.STY。
+ \pdfbookmark[4]{gbfootbibfmt}{gbfootbibfmt}
+ \item[gbfootbibfmt]=true,\textbf{false}. \hfill default is false
+
+ 如果要实现脚注文献表,但不想要国标要求的脚注符号和缩进,但要求相同文献用标签替代,则可使用gbfootbibfmt代替上面的gbfootbib选项。
+ \begin{itemize}
+ \item gbfootbibfmt=true,处理使脚注文献表中的相同的文献用标签代替。
+ \item gbfootbibfmt=false,不做任何附加处理。
+ \end{itemize}
+
+
\pdfbookmark[4]{gbfnperpage}{gbfnperpage}
\item[gbfnperpage]=true,\textbf{false}. \hfill default is false
@@ -1348,7 +1359,7 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
\subsubsection{段落格式控制}
\paragraph{\heiti 文献表字体、颜色} 为方便用户改变文献表段落格式、内容字体和颜色等,在 biblatex 提供的 \verb|\bibfont| 命令基础上,
-增加了\verb|\bibauthorfont|、\verb|\bibtitlefont|、\verb|\bibpubfont| 等命令用于控制文献部分著录项的格式,比如作者,标题,出版项等。
+增加了\verb|\bibauthorfont|、\verb|\bibtitlefont|、\verb|\bibpubfont| 等命令用于控制文献部分著录项的格式,比如作者,标题,出版项等。增加了\verb|\SlashFont|
用法具体见例\ref{eg:biblist:fontset},结果如图\ref{fig:par:fmt}所示。
测试用例见\href{run:example/testfontinbiblio.tex}{testfontinbiblio.tex}。
@@ -1366,7 +1377,9 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
\renewcommand{\bibtitlefont}{\ttfamily\color{blue}}%
\renewcommand{\bibpubfont}{\itshape\color{violet}}%
% url和doi字体
-\def\UrlFont{\ttfamily} %\urlstyle{sf} %\def\UrlFont{\bfseries}
+\def\UrlFont{\ttfamily}%\rmfamily %\urlstyle{sf} %\def\UrlFont{\bfseries}
+ %斜杠的字体,比如[J/OL]中的斜杠
+\def\SlashFont{\ttfamily}%\rmfamily等
\end{texlist}
\end{example}
@@ -1382,7 +1395,7 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
\end{figure}
\paragraph{\heiti 文献表竖直间距控制}
-文献表各条目之间的竖直间距控制如例\ref{eg:biblist:vspace}所示:
+文献表各条目之间的竖直间距控制如例\ref{eg:biblist:vspace}所示,此外,还可以调整方括号和圆括号的竖直位置,使其与无基线以下部分的字体的文本相配合。
\begin{example}{文献表竖直间距控制}{eg:biblist:vspace}
\begin{texlist}
@@ -1390,6 +1403,8 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
\setlength{\bibitemsep}{0ex}
\setlength{\bibnamesep}{0ex}
\setlength{\bibinitsep}{0ex}
+% 调整方括号和圆括号的竖直位置
+\setlength{\BracketLift}{0ex}
\end{texlist}
\end{example}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
index cc70cc84ad..e7cd2c5000 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2022/05/17 v1.1i}
+\def\versionofgbtstyle{2022/08/29 v1.1j}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -200,6 +200,7 @@
\DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle}
\DeclareDatamodelFields[type=field,datatype=literal]{lansortorder}
\DeclareDatamodelFields[type=field,datatype=literal]{languageid}
+ \DeclareDatamodelFields[type=field,datatype=integer]{refnumber}
%因为biblatex更新3.14版本以后,biber对于为声明数据模型的条目类型
%不再默认读取,而是以空字符串作为条目类型名,自然在条目定义alias时
@@ -209,6 +210,19 @@
\DeclareDatamodelEntrytypes{newspaper}%
}{}
+%%
+%%符号的垂直位置调整一下
+%% 20220625,hzz,v1.1i
+\newlength{\BracketLift}
+\setlength{\BracketLift}{0.0ex}
+\renewcommand*{\bibleftparen}{\blx@postpunct\raise\BracketLift\hbox{(}}
+\renewcommand*{\bibrightparen}{\blx@postpunct\raise\BracketLift\hbox{)}\midsentence}
+\renewcommand*{\bibleftbracket}{\blx@postpunct\raise\BracketLift\hbox{[}}
+\renewcommand*{\bibrightbracket}{\blx@postpunct\raise\BracketLift\hbox{]}\midsentence}
+\newcommand*{\gbleftparen}{\raise\BracketLift\hbox{(}}
+\newcommand*{\gbrightparen}{\raise\BracketLift\hbox{)}}
+\newcommand*{\gbleftbracket}{\raise\BracketLift\hbox{[}}
+\newcommand*{\gbrightbracket}{\raise\BracketLift\hbox{]}}
%=====================================================================
@@ -282,7 +296,7 @@
%用于在文献条目后面输出注释信息的宏
%FieldFormat{annotation}用于设置注释信息的格式
\DeclareFieldFormat{annotation}{%
- \printtext{\addspace(#1)}%
+ \printtext{\addspace\gbleftparen#1\gbrightparen}%
}
\renewbibmacro*{annotation}{%
\iftoggle{bbx:gbannote}%
@@ -316,20 +330,25 @@
% 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式
% 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题
\DeclareBibliographyOption{gbfootbib}[false]{%
- \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ifstrequal{#1}{false}{}{\execgbfootbib\execgbfootbibfmt}}
\ExecuteBibliographyOptions{gbfootbib}
+ %
+ % 增加一个选项,用于控制分离后的脚注的格式
+ % 20220829,v1.1j,hzz
+ % 将原来的一个gbfootbib选项控制所有格式分离为由两个选项gbfootbib和gbfootbibfmt控制
+ % 分离后,gbfootbibfmt实现同(4)这样的方式,gbfootbib则实现全部的格式
+ \DeclareBibliographyOption{gbfootbibfmt}[false]{%
+ \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ExecuteBibliographyOptions{gbfootbibfmt}
%%
\newlength{\footbibmargin}
\newlength{\footbiblabelsep}
\setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
\setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
- \def\execgbfootbib%
- {%
- %开启引用跟踪计数器,为使用\ifciteseen等测试命令
- \ExecuteBibliographyOptions{citetracker=true}
- %
- %利用footmisc宏包来实现脚注文献的悬挂对齐
+
+ \def\execgbfootbibfmt%
+ {%利用footmisc宏包来实现脚注文献的悬挂对齐
\AtEndPreamble{
\@ifclassloaded{beamer}{}{
%beamer类因为其特殊性,为避免冲突不调footmisc。
@@ -345,7 +364,7 @@
\iftoggle{bbx:gbfnperpage}%
{\@addtoreset{footnote}{page}}{}%重设计数器
-\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
+ \@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
\long\def\H@@footnotetext##1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
@@ -422,6 +441,12 @@
}%
}{}{}
}
+ }
+
+ \def\execgbfootbib%
+ {%
+ %开启引用跟踪计数器,为使用\ifciteseen等测试命令
+ \ExecuteBibliographyOptions{citetracker=true}
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
@@ -461,7 +486,6 @@
}%
{\multicitedelim}%
{\usebibmacro{postnote}}
-
}
%
@@ -2190,7 +2214,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\addvspace{\bibitemsep}%恢复\bibitemsep的作用
%\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid
-\mkgbnumlabel{\printfield{labelnumber}}%
+\leavevmode\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}}
%
% 简单的段落环境
@@ -2247,14 +2271,14 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
}%
{\ifentrytype{online}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\gbrightbracket}}%
}
%
@@ -2264,11 +2288,11 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak N\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -2278,11 +2302,11 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak S\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -2306,6 +2330,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{title}{#1}%\nopunct\unspace
\DeclareFieldFormat{url}{\url{#1}} %%url相关输出,url域修改如本行,源来自biblatex.def
\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily
+\def\SlashFont{\ttfamily}%设置斜杠的字体,比如:[J/OL]中的斜杠;\rmfamily
%\urlstyle{rm} %使用这句也一样
\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行
\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行
@@ -2971,9 +2996,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
%
\defversion{3.4}{date}{
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printfield{urlyear}%
+ \addthinspace\printtext{\gbleftbracket}\printfield{urlyear}%
\iffieldundef{urlmonth}{}{\bibrangedash\printfield{urlmonth}}%
- \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{]}}
+ \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{\gbrightbracket}}
\newbibmacro*{newsdate}{%%新增加一个公告日期,公开日期或新闻日期
\iffieldundef{year}{}{\printfield{year}%
@@ -3014,7 +3039,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\defversion{3.7}{date}{
\DeclareFieldFormat{urldate}{##1}
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+ \addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 专利的公告日期、或报纸的日期的输出宏
@@ -3033,10 +3058,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@edtfdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@edtfdate{}{}\printtext{\gbrightparen}}%
}%
}}%
}
@@ -3047,7 +3072,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\defversion{3.10}{date}{
\DeclareFieldFormat{urldate}{##1}
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+ \addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 专利的公告日期、或报纸的日期的输出宏
@@ -3069,10 +3094,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@gbdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@gbdate{}{}\printtext{\gbrightparen}}%
}%
}}%
}
@@ -3240,14 +3265,15 @@ test{\iftoggle{iftlnine}}
{\testCJKfirst{userd}%
\ifboolexpr{%
test {\iflistundef{location}} and test {\iflistundef{institution}}%
-}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}%
-{\printtext{[S.l.\space :\space s.n.\adddot]}}%
+}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}%
+{\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}%
}{%
-\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
+\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}}%
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}}}%
{\printlist{location}}%
\publocpunct%
\iflistundef{institution}{%
-\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}%
+\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}}{\printtext{\mkbibbrackets{s.n.}}}}%
{\printlist{institution}}}%
\setunit{\addcomma\addspace}%
%\usebibmacro{date}%
@@ -3274,14 +3300,17 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
\iftoggle{bbx:gbpub}%
{\testCJKfirst{userd}%
\ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
- {\iffieldequalstr{entrysubtype}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}%
+ {\iffieldequalstr{entrysubtype}{standard}{}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}
+ {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}}%
{\iflistundef{location}{%\adddot
\iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}\addcolon\addspace}%
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}}% \bibstring{noaddress}
{\printlist{location}\publocpunct}%%\addcolon\addspace%
\iflistundef{publisher}{%
\iffieldequalstr{entrysubtype}{standard}{}%
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
{\printlist{publisher}}}%
\setunit*{\addcomma\addspace}%\addcomma\addspace%
@@ -3387,10 +3416,11 @@ incollection,proceedings,inproceedings]{number}{%
% 调整期刊名的格式
%
% v1.0k,20180425,增加了字体控制命令,hzz
+% v1.1j,20220527,修复期刊名不存在时多余的标点
\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx
\usebibmacro{journal}%
%\setunit*{\addspace}%
- \setunit*{\addcomma\addspace}%修改为增加一个逗号
+ \iffieldundef{journaltitle}{}{\setunit*{\addcomma\addspace}}%修改为增加一个逗号
\iffieldundef{series}
{}
{\newunit
@@ -3398,9 +3428,9 @@ incollection,proceedings,inproceedings]{number}{%
\setunit{\addspace}}%
%\usebibmacro{volume+number+eid}%
%\setunit{\addspace}%
- \usebibmacro{issue+date}%
+ \printtext{\usebibmacro{issue+date}}%使用printtext配合后面的\setunit*来实现后面的逗号的自动处理
%\setunit{\addcolon\space}%
- \iffieldundef{volume}{}{\setunit{\addcomma\space}}%
+ \iffieldundef{volume}{}{\setunit*{\addcomma\space}}%
%换成逗号和空格
\usebibmacro{issue}%
\usebibmacro{volume+number+eid}%把卷期放到年份后面
@@ -3703,7 +3733,7 @@ incollection,proceedings,inproceedings]{number}{%
% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。
% 需要注意\bibstring命令会把首字母大写的。
\renewbibmacro*{in:}{%
- \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak\texttt{//}\allowbreak}}%\addthinspace
+ \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak{\SlashFont//}\allowbreak}}%\addthinspace
{\setunit{\adddot\addspace}%
\iffieldequalstr{userd}{chinese}%
{\printtext{\bibstring{incn}}}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
index 597820363a..6279c92567 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
@@ -35,8 +35,8 @@
% 增加标签包围符号格式处理选项
% 20211030,1.1a,hzz
%
-\newrobustcmd{\mkbibleftborder}{[}
-\newrobustcmd{\mkbibrightborder}{]}
+\newrobustcmd{\mkbibleftborder}{\gbleftbracket}
+\newrobustcmd{\mkbibrightborder}{\gbrightbracket}
\DeclareBibliographyOption[string]{gbcitelabel}[bracket]{%
\csuse{gbcitelabelopt@#1}
}
@@ -51,12 +51,12 @@
#1\endgroup}\kern\z@}%
\def\gbcitelabelopt@bracket{%
-\renewrobustcmd{\mkbibleftborder}{[}%
-\renewrobustcmd{\mkbibrightborder}{]}%
+\renewrobustcmd{\mkbibleftborder}{\gbleftbracket}%
+\renewrobustcmd{\mkbibrightborder}{\gbrightbracket}%
}
\def\gbcitelabelopt@parens{%
-\renewrobustcmd{\mkbibleftborder}{(}%
-\renewrobustcmd{\mkbibrightborder}{)}%
+\renewrobustcmd{\mkbibleftborder}{\gbleftparen}%
+\renewrobustcmd{\mkbibrightborder}{\gbrightparen}%
}
\def\gbcitelabelopt@dot{%
\renewrobustcmd{\mkbibleftborder}{}%
@@ -243,13 +243,12 @@
% 重定义parencite命令,以满足标签带页码的国标要求
%
\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
- {\mkbibleftborder\usebibmacro{cite:init}%
+ {\addspace\mkbibleftborder\usebibmacro{cite:init}%
\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {%[
- \usebibmacro{cite:dump}\mkbibrightborder%
+ {\usebibmacro{cite:dump}\mkbibrightborder%
\mkbibsuperscriptusp{\printfield{postnote}}}
%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
index 1504d40265..c1aa141644 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
@@ -10,7 +10,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2022/05/17 v1.1i}
+\def\versionofgbtstyle{2022/08/29 v1.1j}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -197,6 +197,7 @@
\DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle}
\DeclareDatamodelFields[type=field,datatype=literal]{lansortorder}
\DeclareDatamodelFields[type=field,datatype=literal]{languageid}
+ \DeclareDatamodelFields[type=field,datatype=integer]{refnumber}
%因为biblatex更新3.14版本以后,biber对于为声明数据模型的条目类型
%不再默认读取,而是以空字符串作为条目类型名,自然在条目定义alias时
@@ -206,6 +207,21 @@
\DeclareDatamodelEntrytypes{newspaper}%
}{}
+%%
+%%符号的垂直位置调整一下
+%% 20220625,hzz,v1.1i
+\newlength{\BracketLift}
+\setlength{\BracketLift}{0.0ex}
+\renewcommand*{\bibleftparen}{\blx@postpunct\raise\BracketLift\hbox{(}}
+\renewcommand*{\bibrightparen}{\blx@postpunct\raise\BracketLift\hbox{)}\midsentence}
+\renewcommand*{\bibleftbracket}{\blx@postpunct\raise\BracketLift\hbox{[}}
+\renewcommand*{\bibrightbracket}{\blx@postpunct\raise\BracketLift\hbox{]}\midsentence}
+\newcommand*{\gbleftparen}{\raise\BracketLift\hbox{(}}
+\newcommand*{\gbrightparen}{\raise\BracketLift\hbox{)}}
+\newcommand*{\gbleftbracket}{\raise\BracketLift\hbox{[}}
+\newcommand*{\gbrightbracket}{\raise\BracketLift\hbox{]}}
+
+
%=====================================================================
% 设置宏包选项
%=====================================================================
@@ -228,7 +244,7 @@
%用于在文献条目后面输出注释信息的宏
%FieldFormat{annotation}用于设置注释信息的格式
\DeclareFieldFormat{annotation}{%
- \printtext{\addspace(#1)}%
+ \printtext{\addspace\gbleftparen#1\gbrightparen}%
}
\renewbibmacro*{annotation}{%
\iftoggle{bbx:gbannote}%
@@ -262,20 +278,25 @@
% 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式
% 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题
\DeclareBibliographyOption{gbfootbib}[false]{%
- \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ifstrequal{#1}{false}{}{\execgbfootbib\execgbfootbibfmt}}
\ExecuteBibliographyOptions{gbfootbib}
+ %
+ % 增加一个选项,用于控制分离后的脚注的格式
+ % 20220829,v1.1j,hzz
+ % 将原来的一个gbfootbib选项控制所有格式分离为由两个选项gbfootbib和gbfootbibfmt控制
+ % 分离后,gbfootbibfmt实现同(4)这样的方式,gbfootbib则实现全部的格式
+ \DeclareBibliographyOption{gbfootbibfmt}[false]{%
+ \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ExecuteBibliographyOptions{gbfootbibfmt}
- %%
+ %%
\newlength{\footbibmargin}
\newlength{\footbiblabelsep}
\setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
\setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
- \def\execgbfootbib%
- {%
- %开启引用跟踪计数器,为使用\ifciteseen等测试命令
- \ExecuteBibliographyOptions{citetracker=true}
- %
- %利用footmisc宏包来实现脚注文献的悬挂对齐
+
+ \def\execgbfootbibfmt%
+ {%利用footmisc宏包来实现脚注文献的悬挂对齐
\AtEndPreamble{
\@ifclassloaded{beamer}{}{
%beamer类因为其特殊性,为避免冲突不调footmisc。
@@ -291,7 +312,7 @@
\iftoggle{bbx:gbfnperpage}%
{\@addtoreset{footnote}{page}}{}%重设计数器
-\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
+ \@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
\long\def\H@@footnotetext##1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
@@ -307,6 +328,7 @@
\rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox%
}%
\color@endgroup}}%
+
\long\def\H@@mpfootnotetext##1{%
\global\setbox\@mpfootins\vbox{%
\unvbox\@mpfootins
@@ -367,6 +389,12 @@
}%
}{}{}
}
+ }
+
+ \def\execgbfootbib%
+ {%
+ %开启引用跟踪计数器,为使用\ifciteseen等测试命令
+ \ExecuteBibliographyOptions{citetracker=true}
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
@@ -395,7 +423,7 @@
{\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器
\defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。
\usebibmacro{prenote}%
- \renewbibmacro*{postnote}{%
+ \renewbibmacro*{postnote}{%
\iffieldundef{postnote}%
{}{\setunit{\addcolon\addspace}\printtext{\thefield{postnote}}}}%由于ay样式中没有修改postnote域,此处因为格式需要不使用默认域格式
}%
@@ -406,9 +434,9 @@
}%
{\multicitedelim}%
{\usebibmacro{postnote}}
-
}
+
%
% 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式
% 20180814,v1.0m,hzz
@@ -2062,7 +2090,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\addvspace{\bibitemsep}%恢复\bibitemsep的作用
%\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid
-\mkgbnumlabel{\arabic{refnumeric}}%
+\leavevmode\mkgbnumlabel{\arabic{refnumeric}}%
\hspace{\biblabelsep}}
%
% 简单的段落环境
@@ -2102,14 +2130,14 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
}%
{\ifentrytype{online}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\gbrightbracket}}%
}
%
@@ -2119,11 +2147,11 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak N\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -2133,11 +2161,11 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak S\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -2160,6 +2188,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{title}{#1}%\nopunct\unspace
\DeclareFieldFormat{url}{\url{#1}} %url域修改如本行%url相关输出,源来自biblatex.def
\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily
+\def\SlashFont{\ttfamily}%设置斜杠的字体,比如:[J/OL]中的斜杠;\rmfamily
%\urlstyle{rm} %使用这句也一样
\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行
\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行
@@ -2820,9 +2849,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
%
\defversion{3.4}{date}{
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printfield{urlyear}%
+ \addthinspace\printtext{\gbleftbracket}\printfield{urlyear}%
\iffieldundef{urlmonth}{}{\bibrangedash\printfield{urlmonth}}%
- \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{]}}
+ \iffieldundef{urlday}{}{\bibrangedash\printfield{urlday}}\printtext{\gbrightbracket}}
\newbibmacro*{newsdate}{%%新增加一个公告日期,公开日期或新闻日期
\iffieldundef{year}{}{\printfield{year}%
@@ -2863,7 +2892,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\defversion{3.7}{date}{
\DeclareFieldFormat{urldate}{##1}
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+ \addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 专利的公告日期、或报纸的日期的输出宏
@@ -2882,10 +2911,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@edtfdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@edtfdate{}{}\printtext{\gbrightparen}}%
}%
}}%
}
@@ -2896,7 +2925,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
\defversion{3.10}{date}{
\DeclareFieldFormat{urldate}{##1}
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+ \addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 专利的公告日期、或报纸的日期的输出宏
@@ -2917,10 +2946,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@gbdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@gbdate{}{}\printtext{\gbrightparen}}%
}%
}}%
}
@@ -3061,14 +3090,15 @@ test{\iftoggle{iftlnine}}
{\testCJKfirst{userd}%
\ifboolexpr{%
test {\iflistundef{location}} and test {\iflistundef{institution}}%
-}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}%
-{\printtext{[S.l.\space :\space s.n.\adddot]}}%
+}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}%
+{\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}%
}{%
-\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
+\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}}%
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}}}%
{\printlist{location}}%
\publocpunct%
\iflistundef{institution}{%
-\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot]
+\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}}{\printtext{\mkbibbrackets{s.n.}}}}%
{\printlist{institution}}}%
\setunit{\addcomma\addspace}%
%\usebibmacro{date}%
@@ -3076,7 +3106,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
\bibrangedash%
\iffieldundef{endyear}{}{\printfield{endyear}}%
\newunit}%
-{ \printlist{location}%
+{\printlist{location}%
\iflistundef{institution}%
{\setunit*{\addcomma\space}}
{\setunit*{\publocpunct}}%
@@ -3095,14 +3125,17 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
\iftoggle{bbx:gbpub}%
{\testCJKfirst{userd}%
\ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
- {\iffieldequalstr{entrysubtype}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}%
+ {\iffieldequalstr{entrysubtype}{standard}{}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}
+ {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}}%
{\iflistundef{location}{%\adddot
\iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}\addcolon\addspace}%
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}}% \bibstring{noaddress}
{\printlist{location}\publocpunct}%%\addcolon\addspace%
\iflistundef{publisher}{%
\iffieldequalstr{entrysubtype}{standard}{}%
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
{\printlist{publisher}}}%
\setunit*{\addcomma\addspace}%\addcomma\addspace%
@@ -3314,7 +3347,6 @@ incollection,proceedings,inproceedings]{number}{%
\renewbibmacro*{bbx:ifmergeddate}{\@secondoftwo}%这一句用于3.12版本
\renewbibmacro*{date}{\printdate}%这一句用于biblatex3.11以下版本
\renewbibmacro*{issue+date}{%去掉括号
-\setunit{\addcomma\addspace}%
\printtext{%去掉了[parens]
\iffieldundef{issue}
{%\usebibmacro{date}
@@ -3363,10 +3395,11 @@ incollection,proceedings,inproceedings]{number}{%
%
% 原理方法:因为作者年制年份提到前面,因此涉及到期刊名与后面的卷期的关系。
% v1.0k,20180425,增加了字体控制命令,hzz
+% v1.1j,20220527,修复期刊名不存在时多余的标点
\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx
\usebibmacro{journal}%
%\setunit*{\addspace}%
- %\setunit*{\addcomma\addspace}%修改为增加一个逗号
+ \iffieldundef{journaltitle}{}{\setunit*{\addcomma\addspace}}%修改为增加一个逗号
\iffieldundef{series}%
{}%
{\newunit%
@@ -3374,11 +3407,11 @@ incollection,proceedings,inproceedings]{number}{%
\setunit{\addspace}}%
%\usebibmacro{volume+number+eid}%
%\setunit{\addspace}%
- \usebibmacro{issue+date}%
+ \printtext{\usebibmacro{issue+date}}%使用printtext配合后面的\setunit*来实现后面的逗号的自动处理
%\setunit{\addcolon\space}%
- \iffieldundef{volume}{}{\setunit{\addcomma\space}}%
+ \iffieldundef{volume}{}{\setunit*{\addcomma\space}}%
%换成逗号和空格
- \usebibmacro{issue}%
+ %\usebibmacro{issue}%
\usebibmacro{volume+number+eid}%把卷期放到年份后面
%\newunit
}
@@ -3387,7 +3420,7 @@ incollection,proceedings,inproceedings]{number}{%
% 增加一个number带括号的格式,避免使用mkbibparens而引入一个不必要的空格
%
\DeclareFieldFormat{addnumflag}{%
-\nobreak\printtext{(}\nobreak #1\nobreak\printtext{)}}
+\nobreak\printtext{\gbleftparen}\nobreak #1\nobreak\printtext{\gbrightparen}}
%
% 调整journal输出
@@ -3716,8 +3749,9 @@ test {\ifentrytype{conference}}
% 20190212,v1.0q,增加中英文区分,by hzz
%
% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。
+% 需要注意\bibstring命令会把首字母大写的。
\renewbibmacro*{in:}{%
- \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak\texttt{//}\allowbreak}}%\addthinspace
+ \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak{\SlashFont//}\allowbreak}}%\addthinspace
{\setunit{\adddot\addspace}%
\iffieldequalstr{userd}{chinese}%
{\printtext{\bibstring{incn}}}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
index c0d9d4b985..454e5cc7e6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
@@ -28,20 +28,20 @@
% 增加标签包围符号格式处理选项
% 20211030,1.1a,hzz
%
-\newrobustcmd{\mkbibleftborder}{(}
-\newrobustcmd{\mkbibrightborder}{)}
+\newrobustcmd{\mkbibleftborder}{\gbleftparen}
+\newrobustcmd{\mkbibrightborder}{\gbrightparen}
\DeclareBibliographyOption[string]{gbcitelabel}[bracket]{%
\csuse{gbcitelabelopt@#1}
}
\ExecuteBibliographyOptions{gbcitelabel}
\def\gbcitelabelopt@bracket{%
-\renewrobustcmd{\mkbibleftborder}{[}%
-\renewrobustcmd{\mkbibrightborder}{]}%
+\renewrobustcmd{\mkbibleftborder}{\gbleftbracket}%
+\renewrobustcmd{\mkbibrightborder}{\gbrightbracket}%
}
\def\gbcitelabelopt@parens{%
-\renewrobustcmd{\mkbibleftborder}{(}%
-\renewrobustcmd{\mkbibrightborder}{)}%
+\renewrobustcmd{\mkbibleftborder}{\gbleftparen}%
+\renewrobustcmd{\mkbibrightborder}{\gbrightparen}%
}
\def\gbcitelabelopt@dot{%
\renewrobustcmd{\mkbibleftborder}{}%
@@ -332,7 +332,7 @@ test {\iftoggle{iftlseven}}%3.7=biblatex
\savefield{labelyear}{\cbx@lastyear}}}
{\iftoggle{bbx:gblabelref}{\printtext[bibhyperref]{\printnames{labelname}}}{\printnames{labelname}}%%
%\setunit{\printdelim{nameyeardelim}}%
- (\usebibmacro{cite:labeldate+extradate})%
+ \gbleftparen\usebibmacro{cite:labeldate+extradate}\gbrightparen%
\savefield{namehash}{\cbx@lasthash}%
\savefield{labelyear}{\cbx@lastyear}}}}
{\usebibmacro{cite:shorthand}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
index 1ae850d363..d8fe13aa06 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2022/05/17 v1.1i}
+\def\versionofgbtstyle{2022/08/29 v1.1j}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -91,6 +91,7 @@
\DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle}
\DeclareDatamodelFields[type=field,datatype=literal]{lansortorder}
\DeclareDatamodelFields[type=field,datatype=literal]{languageid}
+ \DeclareDatamodelFields[type=field,datatype=integer]{refnumber}
%因为biblatex更新3.14版本以后,biber对于为声明数据模型的条目类型
%不再默认读取,而是以空字符串作为条目类型名,自然在条目定义alias时
@@ -100,6 +101,21 @@
\DeclareDatamodelEntrytypes{newspaper}%
}{}
+%%
+%%符号的垂直位置调整一下
+%% 20220625,hzz,v1.1i
+\newlength{\BracketLift}
+\setlength{\BracketLift}{0.0ex}
+\renewcommand*{\bibleftparen}{\blx@postpunct\raise\BracketLift\hbox{(}}
+\renewcommand*{\bibrightparen}{\blx@postpunct\raise\BracketLift\hbox{)}\midsentence}
+\renewcommand*{\bibleftbracket}{\blx@postpunct\raise\BracketLift\hbox{[}}
+\renewcommand*{\bibrightbracket}{\blx@postpunct\raise\BracketLift\hbox{]}\midsentence}
+\newcommand*{\gbleftparen}{\raise\BracketLift\hbox{(}}
+\newcommand*{\gbrightparen}{\raise\BracketLift\hbox{)}}
+\newcommand*{\gbleftbracket}{\raise\BracketLift\hbox{[}}
+\newcommand*{\gbrightbracket}{\raise\BracketLift\hbox{]}}
+
+
%=====================================================================
% 设置宏包选项
%=====================================================================
@@ -122,7 +138,7 @@
%用于在文献条目后面输出注释信息的宏
%FieldFormat{annotation}用于设置注释信息的格式
\DeclareFieldFormat{annotation}{%
- \printtext{\addspace(#1)}%
+ \printtext{\addspace\gbleftparen#1\gbrightparen}%
}
\renewbibmacro*{annotation}{%
\iftoggle{bbx:gbannote}%
@@ -156,20 +172,25 @@
% 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式
% 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题
\DeclareBibliographyOption{gbfootbib}[false]{%
- \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ifstrequal{#1}{false}{}{\execgbfootbib\execgbfootbibfmt}}
\ExecuteBibliographyOptions{gbfootbib}
+ %
+ % 增加一个选项,用于控制分离后的脚注的格式
+ % 20220829,v1.1j,hzz
+ % 将原来的一个gbfootbib选项控制所有格式分离为由两个选项gbfootbib和gbfootbibfmt控制
+ % 分离后,gbfootbibfmt实现同(4)这样的方式,gbfootbib则实现全部的格式
+ \DeclareBibliographyOption{gbfootbibfmt}[false]{%
+ \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ExecuteBibliographyOptions{gbfootbibfmt}
- %%
+ %%
\newlength{\footbibmargin}
\newlength{\footbiblabelsep}
\setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
\setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
- \def\execgbfootbib%
- {%
- %开启引用跟踪计数器,为使用\ifciteseen等测试命令
- \ExecuteBibliographyOptions{citetracker=true}
- %
- %利用footmisc宏包来实现脚注文献的悬挂对齐
+
+ \def\execgbfootbibfmt%
+ {%利用footmisc宏包来实现脚注文献的悬挂对齐
\AtEndPreamble{
\@ifclassloaded{beamer}{}{
%beamer类因为其特殊性,为避免冲突不调footmisc。
@@ -185,7 +206,7 @@
\iftoggle{bbx:gbfnperpage}%
{\@addtoreset{footnote}{page}}{}%重设计数器
-\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
+ \@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
\long\def\H@@footnotetext##1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
@@ -202,8 +223,8 @@
}%
\color@endgroup}}%
- \long\def\H@@mpfootnotetext##1{%
- \global\setbox\@mpfootins\vbox{%
+ \long\def\H@@mpfootnotetext##1{%
+ \global\setbox\@mpfootins\vbox{%
\unvbox\@mpfootins
\reset@font\footnotesize
\hsize\columnwidth
@@ -262,6 +283,12 @@
}%
}{}{}
}
+ }
+
+ \def\execgbfootbib%
+ {%
+ %开启引用跟踪计数器,为使用\ifciteseen等测试命令
+ \ExecuteBibliographyOptions{citetracker=true}
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
@@ -296,12 +323,11 @@
}%
{\usebibmacro{citesavefn}%
\ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%
- {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}\nopunct}%
+ {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%\nopunct
{\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}%
}%
{\multicitedelim}%
{\usebibmacro{postnote}}
-
}
%
@@ -344,6 +370,7 @@
\def\str@references{参考文献}
\def\str@bytranslator{译}
\def\str@andotherscn{等}
+ \def\str@andcn{和}
\def\str@backrefpage{引用页}
\def\str@backrefpages{引用页}
\def\str@noaddress{出版地不详}
@@ -1350,7 +1377,7 @@
\addvspace{\bibitemsep}%恢复\bibitemsep的作用
%\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid%
-\mkgbnumlabel{\printfield{labelnumber}}%
+\leavevmode\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}}
%
% 简单的段落环境
@@ -1409,14 +1436,14 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
}%
{\ifentrytype{online}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\gbrightbracket}}%
}
%
@@ -1426,11 +1453,11 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak N\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -1440,11 +1467,11 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak S\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -1684,6 +1711,7 @@
\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily
+\def\SlashFont{\ttfamily}%设置斜杠的字体,比如:[J/OL]中的斜杠;\rmfamily
%\urlstyle{rm} %使用这句也一样
\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行
\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行
@@ -1730,10 +1758,10 @@
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@gbdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@gbdate{}{}\printtext{\gbrightparen}}%
}%
}}%
@@ -2066,7 +2094,7 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
%
\DeclareFieldFormat{urldate}{##1}%
\renewbibmacro*{urldate}{%
-\addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+\addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 调整doi+eprint+url格式
%
@@ -2116,14 +2144,14 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
{\testCJKfirst{userd}%
\ifboolexpr{%
test {\iflistundef{location}} and test {\iflistundef{institution}}%
-}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}%
-{\printtext{[S.l.\space :\space s.n.\adddot]}}%
+}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}%
+{\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}%
}{%
-\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
+\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}}{\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}}}%
{\printlist{location}}%
\publocpunct%
\iflistundef{institution}{%
-\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot]
+\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot]
{\printlist{institution}}}%
\setunit{\addcomma\addspace}%
%\usebibmacro{date}%
@@ -2150,14 +2178,16 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
\iftoggle{bbx:gbpub}%
{\testCJKfirst{userd}%
\ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
- {\iffieldequalstr{entrysubtype}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}%
+ {\iffieldequalstr{entrysubtype}{standard}{}%
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrighttbracket}%
+ {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}}%
{\iflistundef{location}{%\adddot
\iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}\addcolon\addspace}{\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}}% \bibstring{noaddress}
{\printlist{location}\publocpunct}%%\addcolon\addspace%
\iflistundef{publisher}{%
\iffieldequalstr{entrysubtype}{standard}{}%
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
{\printlist{publisher}}}%
\setunit*{\addcomma\addspace}%\addcomma\addspace%
@@ -2255,10 +2285,11 @@ incollection,proceedings,inproceedings]{number}{%
% 调整期刊名的格式
%
% v1.0k,20180425,增加了字体控制命令,hzz
+% v1.1j,20220527,修复期刊名不存在时多余的标点
\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx
\usebibmacro{journal}%
%\setunit*{\addspace}%
- \setunit*{\addcomma\addspace}%修改为增加一个逗号
+ \iffieldundef{journaltitle}{}{\setunit*{\addcomma\addspace}}%修改为增加一个逗号
\iffieldundef{series}
{}
{\newunit
@@ -2266,9 +2297,9 @@ incollection,proceedings,inproceedings]{number}{%
\setunit{\addspace}}%
%\usebibmacro{volume+number+eid}%
%\setunit{\addspace}%
- \usebibmacro{issue+date}%
+ \printtext{\usebibmacro{issue+date}}%使用printtext配合后面的\setunit*来实现后面的逗号的自动处理
%\setunit{\addcolon\space}%
- \iffieldundef{volume}{}{\setunit{\addcomma\space}}%
+ \iffieldundef{volume}{}{\setunit*{\addcomma\space}}%
%换成逗号和空格
\usebibmacro{issue}%
\usebibmacro{volume+number+eid}%把卷期放到年份后面
@@ -2470,8 +2501,9 @@ incollection,proceedings,inproceedings]{number}{%
% 20190212,v1.0q,增加中英文区分,by hzz
%
% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。
+% 需要注意\bibstring命令会把首字母大写的。
\renewbibmacro*{in:}{%
- \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak\texttt{//}\allowbreak}}%\addthinspace
+ \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak{\SlashFont//}\allowbreak}}%\addthinspace
{\setunit{\adddot\addspace}%
\iffieldequalstr{userd}{chinese}%
{\printtext{\bibstring{incn}}}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
index 62bdf65054..84729ef0fd 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2022/05/17 v1.1i}
+\def\versionofgbtstyle{2022/08/29 v1.1j}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -118,6 +118,7 @@
%为多样式文献表增加的stylesections、styleaysection域:
\DeclareDatamodelFields[type=field,datatype=integer]{aysections}
\DeclareDatamodelFields[type=field,datatype=literal]{styleaysection}
+ \DeclareDatamodelFields[type=field,datatype=integer]{refnumber}
%因为biblatex更新3.14版本以后,biber对于为声明数据模型的条目类型
%不再默认读取,而是以空字符串作为条目类型名,自然在条目定义alias时
@@ -127,6 +128,19 @@
\DeclareDatamodelEntrytypes{newspaper}%
}{}
+%%
+%%符号的垂直位置调整一下
+%% 20220625,hzz,v1.1i
+\newlength{\BracketLift}
+\setlength{\BracketLift}{0.0ex}
+\renewcommand*{\bibleftparen}{\blx@postpunct\raise\BracketLift\hbox{(}}
+\renewcommand*{\bibrightparen}{\blx@postpunct\raise\BracketLift\hbox{)}\midsentence}
+\renewcommand*{\bibleftbracket}{\blx@postpunct\raise\BracketLift\hbox{[}}
+\renewcommand*{\bibrightbracket}{\blx@postpunct\raise\BracketLift\hbox{]}\midsentence}
+\newcommand*{\gbleftparen}{\raise\BracketLift\hbox{(}}
+\newcommand*{\gbrightparen}{\raise\BracketLift\hbox{)}}
+\newcommand*{\gbleftbracket}{\raise\BracketLift\hbox{[}}
+\newcommand*{\gbrightbracket}{\raise\BracketLift\hbox{]}}
%=====================================================================
@@ -155,20 +169,25 @@
% 当前面的脚注中已经存在当前文献,那么当前文献内容不再输出而用同(4)这样的方式
% 需要注意的是由于小页环境和表格中的脚注本身的问题,可能会有一些问题
\DeclareBibliographyOption{gbfootbib}[false]{%
- \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ifstrequal{#1}{false}{}{\execgbfootbib\execgbfootbibfmt}}
\ExecuteBibliographyOptions{gbfootbib}
+ %
+ % 增加一个选项,用于控制分离后的脚注的格式
+ % 20220829,v1.1j,hzz
+ % 将原来的一个gbfootbib选项控制所有格式分离为由两个选项gbfootbib和gbfootbibfmt控制
+ % 分离后,gbfootbibfmt实现同(4)这样的方式,gbfootbib则实现全部的格式
+ \DeclareBibliographyOption{gbfootbibfmt}[false]{%
+ \ifstrequal{#1}{false}{}{\execgbfootbib}}
+ \ExecuteBibliographyOptions{gbfootbibfmt}
%%
\newlength{\footbibmargin}
\newlength{\footbiblabelsep}
\setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
\setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
- \def\execgbfootbib%
- {%
- %开启引用跟踪计数器,为使用\ifciteseen等测试命令
- \ExecuteBibliographyOptions{citetracker=true}
- %
- %利用footmisc宏包来实现脚注文献的悬挂对齐
+
+ \def\execgbfootbibfmt%
+ {%利用footmisc宏包来实现脚注文献的悬挂对齐
\AtEndPreamble{
\@ifclassloaded{beamer}{}{
%beamer类因为其特殊性,为避免冲突不调footmisc。
@@ -261,6 +280,12 @@
}%
}{}{}
}
+ }
+
+ \def\execgbfootbib%
+ {%
+ %开启引用跟踪计数器,为使用\ifciteseen等测试命令
+ \ExecuteBibliographyOptions{citetracker=true}
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
@@ -295,14 +320,14 @@
}%
{\usebibmacro{citesavefn}%
\ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%
- {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%\nopunct
+ {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}\nopunct}%
{\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}%
}%
{\multicitedelim}%
{\usebibmacro{postnote}}
-
}
+
%
% 增加一个选项,用于控制gb7714的使用范围,即英文文献和中文文献使用不同的样式
% 20180814,v1.0m,hzz
@@ -344,6 +369,7 @@
\def\str@references{参考文献}
\def\str@bytranslator{译}
\def\str@andotherscn{等}
+ \def\str@andcn{和}
\def\str@backrefpage{引用页}
\def\str@backrefpages{引用页}
\def\str@noaddress{出版地不详}
@@ -1639,7 +1665,7 @@
\addvspace{\bibitemsep}%恢复\bibitemsep的作用
%\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid
-\mkgbnumlabel{\printfield{labelnumber}}%
+\leavevmode\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}}
%
% 简单的段落环境
@@ -1717,14 +1743,14 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
}%
{\ifentrytype{online}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
}}%
- {\allowbreak\printtext{[}\nobreak#1\nobreak\printtext{]}}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\gbrightbracket}}%
}
%
@@ -1734,11 +1760,11 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak N\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak N\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -1748,11 +1774,11 @@
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
{\iffieldundef{url}%当存在url时,增加一个OL标识符
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{{\SlashFont/}OL\gbrightbracket}\nobreak}%
}%
- {\allowbreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-}{\allowbreak\printtext{[}\nobreak S\printtext{]}\nobreak}%
+ {\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}\nobreak}%
+}{\allowbreak\printtext{\gbleftbracket}\nobreak S\printtext{\gbrightbracket}\nobreak}%
}
%
@@ -1776,6 +1802,7 @@
{title}{#1}%\nopunct\unspace
\DeclareFieldFormat{url}{\url{#1}} %%url相关输出,url域修改如本行,源来自biblatex.def
\def\UrlFont{\rmfamily}%设置url字体为roman字体%\ttfamily
+\def\SlashFont{\ttfamily}%设置斜杠的字体,比如:[J/OL]中的斜杠;\rmfamily
%\urlstyle{rm} %使用这句也一样
\setcounter{biburlnumpenalty}{100} %让url可以在数字后断行
\setcounter{biburlucpenalty}{100} %让url可以在大写字母后断行
@@ -2283,7 +2310,7 @@
%
\DeclareFieldFormat{urldate}{#1}
\renewbibmacro*{urldate}{%
- \addthinspace\printtext{[}\printurldate\printtext{]}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
+ \addthinspace\printtext{\gbleftbracket}\printurldate\printtext{\gbrightbracket}}%能用高层命令+选项尽量用命令(比如这里的\printurldate),而不用\blx@edtfdate这种更底层的命令
%
% 专利的公告日期、或报纸的日期的输出宏
@@ -2305,10 +2332,10 @@
}%
{}%更新或修改日期通常有day信息
{\iffieldundef{year}{%
- \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{(}\printeventdate\printtext{)}}}%
- {\printtext{(}\printenddate\printtext{)}}%
+ \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}%
+ {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}%
}{\iffieldequalstr{year}{}{%因为year存在,但为空
- }{\printtext{(}\blx@gbdate{}{}\printtext{)}}%
+ }{\printtext{\gbleftparen}\blx@gbdate{}{}\printtext{\gbrightparen}}%
}%
}}%
@@ -2396,14 +2423,15 @@
{\testCJKfirst{userd}%
\ifboolexpr{%
test {\iflistundef{location}} and test {\iflistundef{institution}}%
-}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}%
-{\printtext{[S.l.\space :\space s.n.\adddot]}}%
+}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}%
+ {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}%
}{%
-\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
+\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}}
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}}}%
{\printlist{location}}%
\publocpunct%
\iflistundef{institution}{%
-\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}%
+\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}}{\printtext{\mkbibbrackets{s.n.}}}}%
{\printlist{institution}}}%
\setunit{\addcomma\addspace}%
%\usebibmacro{date}%
@@ -2430,14 +2458,17 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
\iftoggle{bbx:gbpub}%
{\testCJKfirst{userd}%
\ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
- {\iffieldequalstr{entrysubtype}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}%
+ {\iffieldequalstr{entrysubtype}{standard}{}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress}\space :\space\str@nopublisher\gbrightbracket}%
+ {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}}%
{\iflistundef{location}{%\adddot
\iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress}
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@noaddress\gbrightbracket}\addcolon\addspace}
+ {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}}% \bibstring{noaddress}
{\printlist{location}\publocpunct}%%\addcolon\addspace%
\iflistundef{publisher}{%
\iffieldequalstr{entrysubtype}{standard}{}%
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+ {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str@nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
{\printlist{publisher}}}%
\setunit*{\addcomma\addspace}%\addcomma\addspace%
@@ -2513,7 +2544,7 @@ incollection,proceedings,inproceedings]{number}{%
%
% 对version的版本信息做出修改
%
-\DeclareFieldFormat{version}{%源来自biblatex.DEF
+\DeclareFieldFormat{version}{\bibtitlefont%源来自biblatex.DEF
\testCJKfirst{userd}%
\ifinteger{#1}%
{\iftoggle{ifCJKforgbt}{\printtext{#1\str@edition}}%
@@ -2543,10 +2574,11 @@ incollection,proceedings,inproceedings]{number}{%
% 调整期刊名的格式
%
% v1.0k,20180425,增加了字体控制命令,hzz
+% v1.1j,20220527,修复期刊名不存在时多余的标点
\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx
\usebibmacro{journal}%
%\setunit*{\addspace}%
- \setunit*{\addcomma\addspace}%修改为增加一个逗号
+ \iffieldundef{journaltitle}{}{\setunit*{\addcomma\addspace}}%修改为增加一个逗号
\iffieldundef{series}
{}
{\newunit
@@ -2554,9 +2586,9 @@ incollection,proceedings,inproceedings]{number}{%
\setunit{\addspace}}%
%\usebibmacro{volume+number+eid}%
%\setunit{\addspace}%
- \usebibmacro{issue+date}%
+ \printtext{\usebibmacro{issue+date}}%使用printtext配合后面的\setunit*来实现后面的逗号的自动处理
%\setunit{\addcolon\space}%
- \iffieldundef{volume}{}{\setunit{\addcomma\space}}%
+ \iffieldundef{volume}{}{\setunit*{\addcomma\space}}%
%换成逗号和空格
\usebibmacro{issue}%
\usebibmacro{volume+number+eid}%把卷期放到年份后面
@@ -2858,8 +2890,9 @@ incollection,proceedings,inproceedings]{number}{%
% 20190212,v1.0q,增加中英文区分,by hzz
%
% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。
+% 需要注意\bibstring命令会把首字母大写的。
\renewbibmacro*{in:}{%
- \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak\texttt{//}\allowbreak}}%\addthinspace
+ \iftoggle{bbx:gbpunctin}{\printtext{\allowbreak{\SlashFont//}\allowbreak}}%\addthinspace
{\setunit{\adddot\addspace}%
\iffieldequalstr{userd}{chinese}%
{\printtext{\bibstring{incn}}}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
index 7eacc808dd..1beb8d05ca 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
@@ -30,6 +30,9 @@
sortcites,
}
+\newrobustcmd{\mkbibleftborder}{\gbleftbracket}
+\newrobustcmd{\mkbibrightborder}{\gbrightbracket}
+
%修改\mkbibsuperscript宏在最后加上一个空白使得xeCJK不会自动在引用标签后面加上中英文之间的空白
%hzz,v1.0w,2021-0401
\renewrobustcmd{\mkbibsuperscript}[1]{%
@@ -56,12 +59,12 @@
% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode}
% v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式
\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号
- {[\usebibmacro{cite:init}%
+ {\mkbibleftborder\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {\usebibmacro{cite:dump}]%
+ {\usebibmacro{cite:dump}\mkbibrightborder%
\printfield{postnote}}
% v1.0p 以前用的方式
%\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号
@@ -85,13 +88,13 @@
% 重定义parencite命令,以满足标签带页码的国标要求
%
\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
- {[\usebibmacro{cite:init}%]
+ {\mkbibleftborder\usebibmacro{cite:init}%]
\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{%[
- \usebibmacro{cite:dump}]%
+ \usebibmacro{cite:dump}\mkbibrightborder%
\mkbibsuperscript{\printfield{postnote}}}
%
@@ -105,26 +108,26 @@
{\printfield{postnote}}}
% 2.新增\pagescite引用命令
\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
- {[\usebibmacro{cite:init}%]直接添加方括号
+ {\mkbibleftborder\usebibmacro{cite:init}%]直接添加方括号
\usebibmacro{prenote}%
}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {\usebibmacro{cite:dump}]%
+ {\usebibmacro{cite:dump}\mkbibrightborder%
\usebibmacro{postpages}}
%
% 定义yearpagescite,为与ay样式兼容,等同于\pagescite
%
\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
- {[\usebibmacro{cite:init}%]直接添加方括号
+ {\mkbibleftborder\usebibmacro{cite:init}%]直接添加方括号
\usebibmacro{prenote}%
}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {\usebibmacro{cite:dump}]%
+ {\usebibmacro{cite:dump}\mkbibrightborder%
\usebibmacro{postpages}}
%
@@ -132,13 +135,13 @@
%
% 原理方法:等同于\pagescite,但不要页码
\DeclareCiteCommand{\yearcite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
- {[\usebibmacro{cite:init}%]直接添加方括号
+ {\mkbibleftborder\usebibmacro{cite:init}%]直接添加方括号
\usebibmacro{prenote}%
}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {\usebibmacro{cite:dump}]}
+ {\usebibmacro{cite:dump}\mkbibrightborder}
%
% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码
@@ -180,12 +183,12 @@
\DeclareCiteCommand{\citep}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号
- {[\usebibmacro{cite:init}%
+ {\mkbibleftborder\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
- {\usebibmacro{cite:dump}]%
+ {\usebibmacro{cite:dump}\mkbibrightborder%
\printfield{postnote}}
\newrobustcmd*{\citetns}%
@@ -375,12 +378,11 @@
\iffieldundef{postnote}%
{}%
{\thefield{postnote}}}%
- (\usebibmacro{prenote}}%)
+ \gbleftparen\usebibmacro{prenote}}%)
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
- {%(
- )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote}
+ {\gbrightparen\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote}
}
\DeclareCiteCommand{\parencite}[\mkbibparens]
@@ -413,7 +415,7 @@
\savefield{labelyear}{\cbx@lastyear}}}
{\printnames{labelname}%
%\setunit{\printdelim{nameyeardelim}}%
- (\usebibmacro{cite:labeldate+extradate})%
+ \gbleftparen\usebibmacro{cite:labeldate+extradate}\gbrightparen%
\savefield{namehash}{\cbx@lasthash}%
\savefield{labelyear}{\cbx@lastyear}}}}
{\usebibmacro{cite:shorthand}%
@@ -460,12 +462,11 @@
\iffieldundef{postnote}%
{}%
{\thefield{postnote}}}%
- (\usebibmacro{prenote}}%)
+ \gbleftparen\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
- {%(
- )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote}
+ {\gbrightparen\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote}
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-CCNU.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-CCNU.bbx
index 0515a3b152..bd1edb0f05 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-CCNU.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-CCNU.bbx
@@ -192,17 +192,15 @@
% v1.0k,20180425,增加了字体控制命令,hzz
\renewbibmacro*{journal+issuetitle}{\bibpubfont%源来自standard.bbx
\usebibmacro{journal}%
- \setunit*{\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}}%修改为增加一个逗号
+ \iffieldundef{journaltitle}{}{\setunit*{\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}}}%修改为增加一个逗号
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{issue+date}%
- %\setunit{\addcolon\space}%
\iffieldundef{volume}{}{\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}}%
%换成逗号和空格
- \usebibmacro{issue}%
\usebibmacro{volume+number+eid}%把卷期放到年份后面
%\newunit
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-NWAFU.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-NWAFU.bbx
index 6d49208e42..e1aba48494 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-NWAFU.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-NWAFU.bbx
@@ -71,6 +71,54 @@
\DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addperiod\space}
\DeclareFieldFormat{postnote}{#1}
+\def\gbcaselocalset{%
+ \renewrobustcmd*{\bibinitperiod}{}%
+ \renewcommand*{\revsdnamepunct}{}%
+ %\renewrobustcmd*{\bibinitdelim}{}%
+}
+
+
+\renewbibmacro*{name:family-given}[4]{%
+ \gbcaselocalset%
+ \ifuseprefix
+ {\usebibmacro{name:delim}{#3#1}%
+ \usebibmacro{name:hook}{#3#1}%
+ \mkbibcompletenamefamilygiven{%
+ \ifdefvoid{#3}
+ {}
+ {\ifcapital
+ {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
+ {\mkbibnameprefix{#3}\isdot}%
+ \ifprefchar{}{\bibnamedelimc}}%
+ \mkbibnamefamily{#1}\isdot
+ \ifdefvoid{#4}
+ {}
+ {\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
+ \ifdefvoid{#2}
+ {}
+ {\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}}}
+ {\usebibmacro{name:delim}{#1}%
+ \usebibmacro{name:hook}{#1}%
+ \mkbibcompletenamefamilygiven{%
+ \mkbibnamefamily{#1}\isdot
+ \ifdefvoid{#4}
+ {}
+ {\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
+ \ifboolexpe{%
+ test {\ifdefvoid{#2}}
+ and
+ test {\ifdefvoid{#3}}}
+ {}
+ {\revsdnamepunct}%
+ \ifdefvoid{#2}
+ {}
+ {\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
+ \ifdefvoid{#3}
+ {}
+ {\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}}
+
+
+
%==================================================
%调整部分域的输出格式
diff --git a/macros/latex/contrib/hereapplies/ChangeLog.md b/macros/latex/contrib/hereapplies/ChangeLog.md
index 814e1b431d..0dbba84996 100644
--- a/macros/latex/contrib/hereapplies/ChangeLog.md
+++ b/macros/latex/contrib/hereapplies/ChangeLog.md
@@ -2,6 +2,18 @@ Change Log
==========
+## 0.7.0 (2022-08-29)
+
+Changes:
+
+* All restrictions have been lifted concerning the characters that are allowed
+ in the identifiers passed to `\hereapplies` and `\whereapplies`; leading and
+ trailing spaces from now on will be trimmed
+* I/O operations now rely on one auxiliary file only
+* Code review
+* Documentation
+
+
## 0.6.0 (2022-08-23)
Changes:
diff --git a/macros/latex/contrib/hereapplies/README.md b/macros/latex/contrib/hereapplies/README.md
index b03b599989..380a1fbdf1 100644
--- a/macros/latex/contrib/hereapplies/README.md
+++ b/macros/latex/contrib/hereapplies/README.md
@@ -7,28 +7,28 @@ A LaTeX package for referencing groups of pages that share something in common
Overview
--------
-**Here Applies** is a LaTeX package that allows to create groups of labels and
+**Here Applies** is a LaTeX package that allows to collect groups of labels and
reference them altogether. It can be used for creating informal glossaries that
cross-link concepts to their applications, or simply mentioning multiple pages
that share something in common.
-The package offers two macros: `\hereapplies` and `\whereapplies` (plus their
+The package offers two commands: `\hereapplies` and `\whereapplies` (plus their
“starred” versions `\hereapplies*` and `\whereapplies*`). In both cases an
identifier is passed as argument – and this can be any string invented in the
-moment, as long as it contains only letters (`\hereapplies` additionally
-supports more than one identifier in the form of a comma-separated list).
+moment (`\hereapplies` additionally supports more than one identifier in the
+form of a comma-separated list).
Every time `\hereapplies` is invoked with known identifiers, the document is
made aware that the place shares some kind of connection with other places in
which the same identifiers were used. And so, every time the `\whereapplies`
-macro is invoked with a known identifier, all the occurrences of the latter
+command is invoked with a known identifier, all the occurrences of the latter
within the entire document will be printed in the form of a linkable page list
(e.g. “pp. 1, 5, 8–9, 14–20…”).
As `\hereapplies` is designed to be invoked in the middle of a chapter or a
-section, and that location must be made linkable, the `\phantomsection` macro
-is invoked by default before a label is added. To avoid calling
-`\phantomsection`, the “starred” macro `\hereapplies*` is available.
+section and that location must be made linkable, the `\phantomsection`
+directive is invoked by default before a label is added. To avoid calling
+`\phantomsection`, the “starred” command `\hereapplies*` is available.
Finally, like `\whereapplies` resembles a pluralizable version of `\pageref`,
its “starred” version `\whereapplies*` will resemble a pluralizable version of
@@ -62,19 +62,19 @@ see \whereapplies{conceptOne}.
This is concept two. To find this concept applied, please
see \whereapplies{conceptTwo}.\newpage
-\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
-one'' applies here.\newpage
+\hereapplies{conceptOne} This is page \thepage. As you can see,
+``concept one'' applies here.\newpage
-\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-two'' applies here.\newpage
+\hereapplies{conceptTwo} This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies{conceptOne,conceptTwo}This is page \thepage. As you
+\hereapplies{conceptOne, conceptTwo} This is page \thepage. As you
can see, both ``concept one'' and ``concept two'' apply here.\newpage
-\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-two'' applies here.\newpage
+\hereapplies{conceptTwo} This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies[myref]{conceptOne}This is page \thepage. As you can
+\hereapplies[myref]{conceptOne} This is page \thepage. As you can
see, ``concept one'' applies here. This point in the document is
labeled \texttt{myref}.
@@ -87,38 +87,44 @@ will generate [this document][1].
A minimal tutorial
------------------
-### Macro `\hereapplies[label]{identifiers}`
+### Command `\hereapplies[label]{identifiers}`
-The `\hereapplies` macro notifies the document that one or more identifiers
+The `\hereapplies` command notifies the document that one or more identifiers
apply to a particular point and adds a label to it.
If the optional argument is passed the label created will be named accordingly,
-otherwise an opaque name will be assigned to it. This argument may contain only
-what is legal for `\pageref`.
+otherwise an opaque name will be chosen. This argument may contain only what is
+legal for `\pageref`.
-The `identifiers` argument must be a comma-separated list of identifiers. Each
-of these may contain only Latin letters and the "at" sign (`/^[A-Za-z@]+$/`).
-These strings will remain confined within the internal scope of the package and
-will not create conflicts with possible macros or labels of the same names.
+The `identifiers` argument must be a comma-separated list of identifiers
+(leading and trailing spaces around each member will be ignored). Each of these
+strings will remain confined within the internal scope of the package and will
+not create conflicts with possible macros or labels of the same names.
-The “starred” version of this macro (`\hereapplies*`) will not invoke the
-`\phantomsection` directive.
+After storing some internal values, `\hereapplies` will expand exactly to
+
+``` tex
+\phantomsection
+\label{...}
+```
+
+Its “starred” version (`\hereapplies*`) will not invoke the `\phantomsection`
+directive.
-### Macro `\whereapplies{identifier}`
+### Command `\whereapplies{identifier}`
-The `\whereapplies` macro prints all the occurrences of an identifier, in the
+The `\whereapplies` command prints all the occurrences of an identifier, in the
form “p. …” or “pp. …” (with page range support).
-The `identifier` argument may contain only Latin letters and the "at" sign
-(`/^[A-Za-z@]+$/`). This string will remain confined within the internal scope
-of the package and will not create conflicts with possible macros or labels of
-the same name.
+The `identifier` argument will remain confined within the internal scope of the
+package and will not create conflicts with possible commands or labels of the
+same name. Leading and trailing spaces around this string will be ignored.
If the same `identifier` is not passed to `\hereapplies` at least once
throughout the document, `\whereapplies` will print “**??**”.
-The “starred” version of this macro (`\whereapplies*`) will use `\pageref*`
+The “starred” version of this command (`\whereapplies*`) will use `\pageref*`
instead of `\pageref` for generating the page list.
@@ -140,7 +146,7 @@ For example, writing at the beginning of a document
% English: `\ and\ `
\gdef\halastdelimiter{\ und\ }
% English: `,\ ` (exactly like in German -- leave it)
-% \gdef\hadelimiter{,\ }
+%\gdef\hadelimiter{,\ }
```
will translate “pp. 2, 4 and 6” into “S. 2, 4 und 6”.
diff --git a/macros/latex/contrib/hereapplies/hereapplies-example.pdf b/macros/latex/contrib/hereapplies/hereapplies-example.pdf
index ae7b2fc2af..a175e64cd5 100644
--- a/macros/latex/contrib/hereapplies/hereapplies-example.pdf
+++ b/macros/latex/contrib/hereapplies/hereapplies-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/hereapplies/hereapplies-example.tex b/macros/latex/contrib/hereapplies/hereapplies-example.tex
index f302236ff1..d816e6fe57 100644
--- a/macros/latex/contrib/hereapplies/hereapplies-example.tex
+++ b/macros/latex/contrib/hereapplies/hereapplies-example.tex
@@ -16,20 +16,21 @@ see \whereapplies{conceptOne}.
This is concept two. To find this concept applied, please
see \whereapplies{conceptTwo}.\newpage
-\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
-one'' applies here.\newpage
+\hereapplies{conceptOne} This is page \thepage. As you can see,
+``concept one'' applies here.\newpage
-\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-two'' applies here.\newpage
+\hereapplies{conceptTwo} This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies{conceptOne,conceptTwo}This is page \thepage. As you
+\hereapplies{conceptOne, conceptTwo} This is page \thepage. As you
can see, both ``concept one'' and ``concept two'' apply here.\newpage
-\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-two'' applies here.\newpage
+\hereapplies{conceptTwo} This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies[myref]{conceptOne}This is page \thepage. As you can
+\hereapplies[myref]{conceptOne} This is page \thepage. As you can
see, ``concept one'' applies here. This point in the document is
labeled \texttt{myref}.
\end{document}
+
diff --git a/macros/latex/contrib/hereapplies/hereapplies.sty b/macros/latex/contrib/hereapplies/hereapplies.sty
index 61ee402956..ba13cdb9a7 100644
--- a/macros/latex/contrib/hereapplies/hereapplies.sty
+++ b/macros/latex/contrib/hereapplies/hereapplies.sty
@@ -1,4 +1,4 @@
-% -*- Mode: latex; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+% -*- Mode: latex; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*-
%
%
% hereapplies.sty
@@ -8,7 +8,7 @@
%
% https://github.com/madmurphy/hereapplies.sty
%
-% Version 0.6.0
+% Version 0.7.0
%
% Copyright (C) 2022 madmurphy <madmurphy333@gmail.com>
%
@@ -47,26 +47,26 @@
% This is concept two. To find this concept applied, please
% see \whereapplies{conceptTwo}.\newpage
%
-% \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
-% one'' applies here.\newpage
+% \hereapplies{conceptOne} This is page \thepage. As you can see,
+% ``concept one'' applies here.\newpage
%
-% \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-% two'' applies here.\newpage
+% \hereapplies{conceptTwo} This is page \thepage. As you can see,
+% ``concept two'' applies here.\newpage
%
-% \hereapplies{conceptOne,conceptTwo}This is page \thepage. As you
+% \hereapplies{conceptOne, conceptTwo} This is page \thepage. As you
% can see, both ``concept one'' and ``concept two'' apply here.\newpage
%
-% \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept
-% two'' applies here.\newpage
+% \hereapplies{conceptTwo} This is page \thepage. As you can see,
+% ``concept two'' applies here.\newpage
%
-% \hereapplies[myref]{conceptOne}This is page \thepage. As you can
+% \hereapplies[myref]{conceptOne} This is page \thepage. As you can
% see, ``concept one'' applies here. This point in the document is
% labeled \texttt{myref}.
%
% \end{document}
%
%
-\ProvidesPackage{hereapplies}[2022/08/23 Here Applies]
+\ProvidesPackage{hereapplies}[2022/08/29 Here Applies]
\RequirePackage{hyperref}
\RequirePackage{refcount}
%
@@ -77,118 +77,207 @@
%
%
% The abbreviation of one single page
-\providecommand{\hapage}{p.\ }
+\providecommand*{\hapage}{p.\ }
% The abbreviation of two or more pages
-\providecommand{\hapages}{pp.\ }
+\providecommand*{\hapages}{pp.\ }
% The delimiter between page numbers
-\providecommand{\hadelimiter}{,\ }
+\providecommand*{\hadelimiter}{,\ }
% The delimiter before the last page number
-\providecommand{\halastdelimiter}{\ and\ }
+\providecommand*{\halastdelimiter}{\ and\ }
+%
+%
+%
+% ABSTRACT UTILITIES
+% ==================
+%
+% These macros are not strictly related to this package, but are required.
+%
+%
+% Macro: `\@ha@ifcomma text to check,\@then{if yes}{if no}`
+% *****************************************************************************
+%
+% Check if a string contains a comma
+%
+% This macro is mainly for internal purposes (but nothing forbids invoking it
+% directly). When invoked it checks whether a comma is present in `text to
+% check`, then expands to `if yes` or `if no` accordingly.
+
+% Please do not put curly brackets around the text to check. The comma at the
+% end of the text is mandatory.
+%
+\long\gdef\@ha@ifcomma#1,#2\@then#3#4{%
+ \if\relax\detokenize{#2}\relax#4\else#3\fi%
+}
+%
+%
+% Macro: `\ha@trim{text}`
+% *****************************************************************************
+%
+% Trim leading and trailing spaces from a string
+%
+% This macro is mainly for internal purposes (but nothing forbids invoking it
+% directly).
+%
+\begingroup
+% Temporarily change the categories of `<` and `>`, for trimming safely
+\catcode`\<=4\catcode`\>=3
+% Helper macro
+\long\gdef\@ha@trm< #1 >< #2 >< #3 >< #4 >< #5 >< #6 >< #7 >< #8 >< #9 >/{%
+ \ifcase\numexpr2#3#8\relax\or#2\or#7\or#5\or#1\fi%
+}
+% Usable macro
+\long\gdef\ha@trim#1{%
+ \@ha@trm< #1 >< #1>< - >< + >< ? ><#1 ><#1>< 0 >< 2 >< 1 >< 3 >< 2 >< ! >/%
+}
+\endgroup
%
%
%
% PRIVATE ENVIRONMENT
% ===================
%
+% These macros regulate the internal functioning of the package and should not
+% be invoked directly.
+%
%
-% Assign a unique number to each identifier
-\newcounter{@ha@identifier@counter}
-% Assign a unique number to each unnamed occurrence of an identifier
+% Assign a unique number to each unlabeled occurrence of an identifier
\newcounter{@ha@unlabeled@counter}
%
%
-% Macro `\@ha@makeoccurrencelist{hypermacro}{labels}`
+% Macro `\@ha@makepagelist{hypermacro}{labels}`
% *****************************************************************************
%
% Generate the list of page numbers (with page range support)
%
-% This macro is for internal purposes. When invoked, it scans the
+% This macro is for internal purposes only. When invoked, it scans the
% comma-separated list of labels provided (`labels`), checks which labels refer
% to duplicate page numbers and which page numbers can be grouped together, and
% finally prints a list.
%
-% The `hypermacro` argument is the macro from the `hyperref` package that will
-% process the label name. This should be either `T@pageref` -- equivalent to
-% `\pageref` -- or `@pagerefstar` -- equivalent to `\pageref*`.
-%
-% The `labels` must be a comma-separated list of labels.
-%
-\newcommand{\@ha@makeoccurrencelist}[2]{%
- % Reset the current page number
- \def\@ha@tmp@@currp{-1}%
- % Reset the current range offset
- \def\@ha@tmp@@prangeoffs{-1}%
- % Ensure no comma before the first page number
- \def\@ha@tmp@@psep{}%
- % Ensure no text before the last page number if it is also the first one
- \def\@ha@tmp@@lastpsep{}%
- % Iterate through the `labels` argument
- \@for\@ha@tmp@@thislabel:=#2\do{%
- % Store the page number associated with this label
- \edef\@ha@tmp@@nextp{\getpagerefnumber{\@ha@tmp@@thislabel}}%
- % Check that we are not on the same page as in the last iteration
- \unless\ifnum\@ha@tmp@@currp=\@ha@tmp@@nextp%
- % This is not the same page as in the last iteration
- % Is this the first page in which this identifier appears?
- \unless\ifnum\@ha@tmp@@currp=-1%
- % This is not the first page in which this identifier appears
- % Does this page follow immediately the previous label's page?
- \ifnum\numexpr\@ha@tmp@@currp+1=\@ha@tmp@@nextp%
- % This page follows immediately the previous label's page
- % Are these the first contiguous pages that we encounter?
- \ifnum\@ha@tmp@@prangeoffs=-1%
- % These are the first contiguous pages we encounter
- % Store the first page number of the pair
- \edef\@ha@tmp@@prangeoffs{\@ha@tmp@@currp}%
- % Store the first label of the pair
- \edef\@ha@tmp@@currrangelbl{\@ha@tmp@@currlbl}%
- \fi%
- \else%
- % This page is far from the previous label's page
- % Was the previous page part of a contiguous range?
- \ifnum\@ha@tmp@@prangeoffs=-1%
- % The previous page was a standalone page
- % Print "[, ]<p>"
- {\@ha@tmp@@psep\csname
- #1\endcsname{\@ha@tmp@@currlbl}}%
- \else%
- % The previous page was part of a contiguous range
- % Print "[, ]<p--q>"
- {\@ha@tmp@@psep\csname
- #1\endcsname{\@ha@tmp@@currrangelbl}--\csname
- #1\endcsname{\@ha@tmp@@currlbl}}%
- % Reset the current range offset
- \def\@ha@tmp@@prangeoffs{-1}%
- \fi%
- % Ensure a comma before the next page number
- \let\@ha@tmp@@psep\hadelimiter%
- % Ensure " and " before the last page number
- \let\@ha@tmp@@lastpsep\halastdelimiter%
- \fi%
- \fi%
- % Prepare the next page number
- \edef\@ha@tmp@@currp{\@ha@tmp@@nextp}%
- % Prepare the next label
- \edef\@ha@tmp@@currlbl{\@ha@tmp@@thislabel}%
- \fi%
- }%
- % Print the last page number
- % Is there at least one page to print?
- \unless\ifnum\@ha@tmp@@currp=-1%
- % There is at least one page to print
- % Was the previous page part of a contiguous range?
- \ifnum\@ha@tmp@@prangeoffs=-1%
- % The previous page was a standalone page
- % Print "[ and ]<p>"
- {\@ha@tmp@@lastpsep\csname #1\endcsname{\@ha@tmp@@currlbl}}%
- \else%
- % The previous page was part of a contiguous range
- % Print "[ and ]<p--q>"
- {\@ha@tmp@@lastpsep\csname
- #1\endcsname{\@ha@tmp@@currrangelbl}--\csname
- #1\endcsname{\@ha@tmp@@currlbl}}%
- \fi%
- \fi%
+% The `hypermacro` argument is the macro (usually from the `hyperref` package)
+% that will process the label name.
+%
+% The `labels` argument must be a comma-separated list of labels.
+%
+\gdef\@ha@makepagelist#1#2{%
+ \begingroup%
+ % Reset the current page number
+ \def\@ha@tmp@@currp{-1}%
+ % Reset the current range offset
+ \def\@ha@tmp@@prangeoffs{-1}%
+ % Ensure no comma before the first page number
+ \def\@ha@tmp@@psep{}%
+ % Ensure no text before the last number if it is also the first one
+ \def\@ha@tmp@@lastpsep{}%
+ % Iterate through the `labels` argument
+ \@for\@ha@tmp@@thislabel:=#2\do{%
+ % Store the page number associated with this label
+ \edef\@ha@tmp@@nextp{\getpagerefnumber{\@ha@tmp@@thislabel}}%
+ % Check that we are not on the same page as in the last iteration
+ \ifnum\@ha@tmp@@currp=\@ha@tmp@@nextp\else%
+ % This is not the same page as in the last iteration
+ % Is this the first page in which this identifier appears?
+ \ifnum\@ha@tmp@@currp>-1%
+ % We have already met pages in which this identifiers appears
+ % Does this page follow immediately the previous page?
+ \ifnum\numexpr\@ha@tmp@@currp+1=\@ha@tmp@@nextp%
+ % This page follows immediately the previous page
+ % Are these the first two contiguous pages of the range?
+ \ifnum\@ha@tmp@@prangeoffs=-1%
+ % These are the first two contiguous pages of the range
+ % Store the first page number of the pair
+ \let\@ha@tmp@@prangeoffs\@ha@tmp@@currp%
+ % Store the first label of the pair
+ \let\@ha@tmp@@currrangelbl\@ha@tmp@@currlbl%
+ \fi%
+ \else%
+ % This page is far from the previous label's page
+ % Was the previous page part of a contiguous range?
+ \ifnum\@ha@tmp@@prangeoffs=-1%
+ % The previous page was a standalone page
+ % Print "[, ]<p>"
+ {\@ha@tmp@@psep\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currlbl}}%
+ \else%
+ % The previous page was part of a contiguous range
+ % Print "[, ]<p--q>"
+ {\@ha@tmp@@psep\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currrangelbl}--\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currlbl}}%
+ % Reset the current range offset
+ \def\@ha@tmp@@prangeoffs{-1}%
+ \fi%
+ % Ensure a comma before the next page number
+ \let\@ha@tmp@@psep\hadelimiter%
+ % Ensure " and " before the last page number
+ \let\@ha@tmp@@lastpsep\halastdelimiter%
+ \fi%
+ \fi%
+ % Prepare the next page number
+ \let\@ha@tmp@@currp\@ha@tmp@@nextp%
+ % Prepare the next label
+ \let\@ha@tmp@@currlbl\@ha@tmp@@thislabel%
+ \fi%
+ }%
+ % Print the last page number
+ % Is there at least one page to print?
+ \ifnum\@ha@tmp@@currp>-1%
+ % There is at least one page to print
+ % Was the previous page part of a contiguous range?
+ \ifnum\@ha@tmp@@prangeoffs=-1%
+ % The previous page was a standalone page
+ % Print "[ and ]<p>"
+ {\@ha@tmp@@lastpsep\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currlbl}}%
+ \else%
+ % The previous page was part of a contiguous range
+ % Print "[ and ]<p--q>"
+ {\@ha@tmp@@lastpsep\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currrangelbl}--\csname
+ #1\expandafter\endcsname%
+ \expandafter{\@ha@tmp@@currlbl}}%
+ \fi%
+ \fi%
+ \endgroup%
+}
+%
+%
+% Macro `\@ha@makeoutputstrings{identifier}{preamble}{labels}`
+% *****************************************************************************
+%
+% Generate the output strings of `\whereapplies` and `\whereapplies*`
+%
+% This macro is for internal purposes only. When invoked, it updates the two
+% macros `@ha@prop@@soutput@...` and `@ha@prop@@doutput@...`.
+%
+% The `identifier` argument remains confined within the internal scope of the
+% package and does not create conflicts with possible macros or labels of the
+% same name. Leading and trailing spaces around this string will **not** be
+% ignored.
+%
+% The `preamble` argument is the text that will be expanded before the page
+% list (usually "p." or "pp.").
+%
+% The `labels` argument must be a comma-separated list of labels.
+%
+\gdef\@ha@makeoutputstrings#1#2#3{%
+ % Write "p./pp. \pageref..." to the output
+ \expandafter\gdef\csname @ha@prop@@doutput@#1\endcsname{%
+ % `\T@pageref` is a synonym of `\pageref`
+ #2\@ha@makepagelist{T@pageref}{#3}%
+ }%
+ % Write "p./pp. \pageref*..." to the starred output
+ \expandafter\gdef\csname @ha@prop@@soutput@#1\endcsname{%
+ % `\@pagerefstar` is a synonym of `\pageref*`
+ #2\@ha@makepagelist{@pagerefstar}{#3}%
+ }%
+ % Make the list of labels available to the API (via `\get@hainfo`)
+ \expandafter\gdef\csname @ha@prop@@labels@#1\endcsname{#3}%
}
%
%
@@ -202,151 +291,168 @@
% identifier. If the identifier was already initialized the macro will be no
% op.
%
-% The `identifier` argument may contain only Latin letters and the "at" sign
-% (`/^[A-Za-z@]+$/`). This string remains confined within the internal scope of
-% the package and does not create conflicts with possible macros or labels of
-% the same name.
-%
-\newcommand{\@ha@newidentifier}[1]{%
- % Was this identifier already initialized?
- \unless\ifcsname @ha@prop@@count@#1\endcsname%
- % The identifier was never initialized
- % Set the output to "??" - it will be updated by the .haN file
- \expandafter\gdef\csname @ha@prop@@uoutput@#1\endcsname{\textbf{??}}%
- % Set the starred output to "??" - it will be updated by the .haN file
- \expandafter\gdef\csname @ha@prop@@soutput@#1\endcsname{\textbf{??}}%
- % Use "p." for the preamble when there is only one occurrence
- \global\expandafter\let\csname @ha@prop@@preamble@#1\endcsname\hapage%
- % Increase the counter of identifiers
- \stepcounter{@ha@identifier@counter}%
- % Store the current value of the counter of identifiers
- \expandafter\xdef\csname
- @ha@prop@@count@#1\endcsname{\the@ha@identifier@counter}%
- % Initialize the .haN file
- % Previous versions had this line, which created unwanted whitespaces:
- %\@starttoc{ha\csname @ha@prop@@count@#1\endcsname}%
- % I am thankful to David Carlisle for the following replacement:
- {\endlinechar=\m@ne\@starttoc{ha\csname @ha@prop@@count@#1\endcsname}}%
- % Store all the occurrences when the document reaches the end
- \AtEndDocument{%
- % Make sure that there are occurrences
- \ifcsname @ha@prop@@labels@#1\endcsname%
- % There are occurrences
- % Set the .haN file as output
- \addtocontents{ha\csname @ha@prop@@count@#1\endcsname}{%
- % Write "p./pp. \pageref..." to the output
- \gdef\expandafter\protect\csname @ha@prop@@uoutput@#1\endcsname{%
- % Preamble (either "p." or "pp.")
- \csname @ha@prop@@preamble@#1\endcsname%
- % `\T@pageref` is a synonym of `\pageref`
- \expandafter\protect\csname
- @ha@makeoccurrencelist\endcsname{T@pageref}{\csname
- @ha@prop@@labels@#1\endcsname}%
- }%
- % Write "p./pp. \pageref*..." to the starred output
- \gdef\expandafter\protect\csname @ha@prop@@soutput@#1\endcsname{%
- % Preamble (either "p." or "pp.")
- \csname @ha@prop@@preamble@#1\endcsname%
- % `\@pagerefstar` is a synonym of `\pageref*`
- \expandafter\protect\csname
- @ha@makeoccurrencelist\endcsname{@pagerefstar}{\csname
- @ha@prop@@labels@#1\endcsname}%
- }%
- }%
- \fi%
- }%
- \fi%
+% The `identifier` argument remains confined within the internal scope of the
+% package and does not create conflicts with possible macros or labels of the
+% same name. Leading and trailing spaces around this string will **not** be
+% ignored.
+%
+\gdef\@ha@newidentifier#1{%
+ % Was this identifier already initialized?
+ \ifcsname @ha@iter@@preamble@#1\endcsname\else%
+ % The identifier was never initialized
+ % Was the .hax input already initialized during this run?
+ \ifdefined\@ha@commons@@haxcontent\else%
+ % The .hax input was never initialized
+ % Previous versions created unwanted whitespaces; I am thankful to
+ % David Carlisle for suggesting `\endlinechar=\m@ne`
+ {\endlinechar=\m@ne\@starttoc{hax}}%
+ % Initialize the content to export to the .hax file
+ \gdef\@ha@commons@@haxcontent{}%
+ % Export the content when the document reaches the end
+ \AtEndDocument{%
+ \addtocontents{hax}{\@ha@commons@@haxcontent}%
+ }%
+ \fi%
+ % Was a .hax file already exported during a previous run?
+ \ifcsname @ha@prop@@labels@#1\endcsname\else%
+ % This is the first run
+ % Set the output to "??" - to be updated by the .hax file
+ \expandafter\gdef\csname
+ @ha@prop@@doutput@#1\endcsname{\textbf{??}}%
+ % Set the starred output to "??" - to be updated by the .hax file
+ \expandafter\gdef\csname
+ @ha@prop@@soutput@#1\endcsname{\textbf{??}}%
+ % Set the list of labels to an empty value
+ \expandafter\gdef\csname @ha@prop@@labels@#1\endcsname{}%
+ \fi%
+ % Use "p." for the preamble when there is only one occurrence
+ \global\expandafter\let\csname @ha@iter@@preamble@#1\endcsname\hapage%
+ % Generate the output strings
+ \g@addto@macro\@ha@commons@@haxcontent{%
+ % Make sure that there are occurrences
+ \ifcsname @ha@iter@@labels@#1\endcsname%
+ % There are occurrences
+ % Generate the output strings
+ \protect\@ha@makeoutputstrings{#1}{\csname
+ @ha@iter@@preamble@#1\endcsname}{\csname
+ @ha@iter@@labels@#1\endcsname}%
+ \fi%
+ }%
+ \fi%
}
%
%
-% Macro: `\@ha@getpropat{field}{identifier}`
-% *****************************************************************************
%
-% Get the value of an identifier's property
+% LIBRARY ENVIRONMENT
+% ===================
%
-% This macro is for internal purposes (but nothing forbids invoking it
-% directly). If the identifier was never initialized the macro will initialize
-% it.
+% These macros are not directly available to the user, but are callable by
+% other packages, if needed.
+%
+%
+% Macro: `\starred@labeled@hereapplies{label}{identifiers}`
+% *****************************************************************************
%
-% Possible values for the `field` argument are: `count`, `labels`, `preamble`,
-% `soutput`, `uoutput`.
+% Identical to `\hereapplies*`, but the two arguments are both mandatory
%
-% The `identifier` argument may contain only Latin letters and the "at" sign
-% (`/^[A-Za-z@]+$/`). This string remains confined within the internal scope of
-% the package and does not create conflicts with possible macros or labels of
-% the same name.
+% This macro is mainly for internal purposes (but nothing forbids invoking it
+% directly). See the documentation of `\hereapplies` for more information.
%
-\newcommand{\@ha@getpropat}[2]{%
- % Make sure that the identifier is initialized
- \@ha@newidentifier{#2}%
- % Print the identifier's property
- \csname @ha@prop@@#1@#2\endcsname%
+\newcommand*{\starred@labeled@hereapplies}[2]{%
+ \begingroup%
+ % Assign a label to this occurrence
+ \label{#1}%
+ % Iterate through the comma-separated list `identifiers`
+ \@for\@ha@tmp@@litem:=#2\do{%
+ % Remove trailing and leading spaces
+ \edef\@ha@tmp@@id{\expandafter\ha@trim\expandafter{\@ha@tmp@@litem}}%
+ % Make sure that the identifier is initialized
+ \expandafter\@ha@newidentifier\expandafter{\@ha@tmp@@id}%
+ % Is this the first time this identifier is mentioned?
+ \ifcsname @ha@iter@@labels@\@ha@tmp@@id\endcsname%
+ % This is *not* the first time this identifier is mentioned
+ % Add this label to the list
+ \expandafter\g@addto@macro\csname
+ @ha@iter@@labels@\@ha@tmp@@id\endcsname{,#1}%
+ % Use "pp." for the preamble when there are multiple occurrences
+ \global\expandafter\let\csname
+ @ha@iter@@preamble@\@ha@tmp@@id\endcsname\hapages%
+ \else%
+ % This is the first time this identifier is mentioned
+ % Set up the list with this label as value
+ \expandafter\gdef\csname
+ @ha@iter@@labels@\@ha@tmp@@id\endcsname{#1}%
+ \fi%
+ }%
+ \endgroup%
}
%
%
-% Macro: `\starred@labeled@hereapplies{label}{identifiers}`
+% Macro: `\starred@hereapplies[label]{identifiers}`
% *****************************************************************************
%
-% Equivalent to `\hereapplies*`, but the two arguments are both mandatory
+% Identical to `\hereapplies*`
%
-% This macro is for internal purposes (but nothing forbids invoking it
+% This macro is mainly for internal purposes (but nothing forbids invoking it
% directly). See the documentation of `\hereapplies` for more information.
%
-\newcommand{\starred@labeled@hereapplies}[2]{%
- % Assign a label to this occurrence
- \label{#1}%
- % Iterate through the comma-separated list `identifiers`
- \@for\@ha@tmp@@id:=#2\do{%
- % Make sure that the identifier is initialized
- {\edef\tmp{\noexpand\@ha@newidentifier{\@ha@tmp@@id}}\tmp}%
- % Is this the first time this identifier is mentioned?
- \ifcsname @ha@prop@@labels@\@ha@tmp@@id\endcsname%
- % This is *not* the first time this identifier is mentioned
- % Add this label to the list
- \expandafter\g@addto@macro\csname
- @ha@prop@@labels@\@ha@tmp@@id\endcsname{,#1}%
- % Use "pp." for the preamble when there are multiple occurrences
- \global\expandafter\let\csname
- @ha@prop@@preamble@\@ha@tmp@@id\endcsname\hapages%
- \else%
- % This is the first time this identifier is mentioned
- % Set up the list with this label as value
- \expandafter\gdef\csname
- @ha@prop@@labels@\@ha@tmp@@id\endcsname{#1}%
- \fi%
- }%
+\newcommand*{\starred@hereapplies}[2][]{%
+ % Check whether the macro has been called with one or two arguments
+ \if\relax\detokenize{#1}\relax%
+ % The macro has been called with only one argument
+ % Assign a unique number to the unnamed occurrence
+ \stepcounter{@ha@unlabeled@counter}%
+ % Call `\starred@hereapplies` with an opaque label
+ {\edef\@ha@tmp@@mcall{\noexpand\starred@labeled@hereapplies{%
+ hereapplies:unnamed\the@ha@unlabeled@counter}{#2}%
+ }\@ha@tmp@@mcall}%
+ \else%
+ % The macro has been called with two arguments
+ % Call `\starred@labeled@hereapplies` with the same arguments
+ \starred@labeled@hereapplies{#1}{#2}%
+ \fi%
}
%
%
-% Macro: `\starred@hereapplies[label]{identifiers}`
+% Macro: `\get@hainfo[property]{identifier}`
% *****************************************************************************
%
-% Equivalent to `\hereapplies*`
+% Get the value of an identifier's property
%
-% This macro is for internal purposes (but nothing forbids invoking it
-% directly). See the documentation of `\hereapplies` for more information.
+% This macro is mainly for internal purposes (but nothing forbids invoking it
+% directly). If the identifier was never initialized the macro will initialize
+% it.
%
-\newcommand{\starred@hereapplies}[2][]{%
- % Check whether the macro has been called with one or two arguments
- \if\relax\detokenize{#1}\relax%
- % The macro has been called with only one argument
- % Assign a unique number to the unnamed occurrence
- \stepcounter{@ha@unlabeled@counter}%
- % Call `\starred@hereapplies` with an opaque label
- {\edef\tmp{\noexpand\starred@labeled@hereapplies{%
- hereapplies:unnamed\the@ha@unlabeled@counter}{#2}%
- }\tmp}%
- \else%
- % The macro has been called with two arguments
- % Call `\starred@labeled@hereapplies` with the same arguments
- \starred@labeled@hereapplies{#1}{#2}%
- \fi%
+% Possible values for the `property` argument are: `doutput`, `labels` and
+% `soutput`. When omitted it defaults to `labels`.
+%
+% The `identifier` argument remains confined within the internal scope of the
+% package and does not create conflicts with possible macros or labels of the
+% same name. Leading and trailing spaces around this string will be ignored.
+%
+\newcommand*{\get@hainfo}[2][labels]{%
+ \begingroup%
+ % Trim leading and trailing spaces from the identifier
+ \edef\@ha@tmp@@id{\ha@trim{#2}}%
+ % Make sure that there are no commas
+ \expandafter\@ha@ifcomma\@ha@tmp@@id,\@then{%
+ \PackageError{hereapplies}{Comma detected in "#2"}{%
+ It is possible to query only one single identifier at a time.%
+ }%
+ }{}%
+ % Make sure that the identifier is initialized
+ \expandafter\@ha@newidentifier\expandafter{\@ha@tmp@@id}%
+ % Print the identifier's property
+ \csname @ha@prop@@#1@\@ha@tmp@@id\endcsname%
+ \endgroup%
}
%
%
%
-% PUBLIC ENVIRONMENT
-% ===================
+% USER ENVIRONMENT
+% ================
+%
+% These macros are directly available to the user.
%
%
% Macro: `\hereapplies[label]{identifiers}`
@@ -356,20 +462,21 @@
% and add a label to it
%
% If the optional argument is passed the label created will be named
-% accordingly, otherwise an opaque name will be assigned to it. This argument
-% may contain only what is legal for `\pageref`.
+% accordingly, otherwise an opaque name will be chosen. This argument may
+% contain only what is legal for `\pageref`.
%
-% The `identifiers` argument must be a comma-separated list of identifiers.
-% Each of these may contain only Latin letters and the "at" sign (`@`). These
-% strings will remain confined within the internal scope of the package and
-% will not create conflicts with possible macros or labels of the same names.
+% The `identifiers` argument must be a comma-separated list of identifiers
+% (leading and trailing spaces around each member will be ignored). Each of
+% these strings will remain confined within the internal scope of the package
+% and will not create conflicts with possible macros or labels of the same
+% names.
%
-% The starred version of this macro (`\hereapplies*`) does not invoke the
+% The starred version of this command (`\hereapplies*`) will not invoke the
% `\phantomsection` directive.
%
-\newcommand{\hereapplies}{%
- % Check if a star is present in the invocation of the command
- \@ifstar{\starred@hereapplies}{\phantomsection\relax\starred@hereapplies}%
+\newcommand*{\hereapplies}{%
+ % Check if a star is present in the invocation of the command
+ \@ifstar{\starred@hereapplies}{\phantomsection\starred@hereapplies}%
}
%
%
@@ -377,21 +484,21 @@
% *****************************************************************************
%
% Print all the occurrences of an identifier in the form "p. ..." or "pp. ..."
-% with page range support
+% (with page range support)
%
-% The `identifier` argument may contain only Latin letters and the "at"
-% sign (`@`). This string will remain confined within the internal scope of the
-% package and will not create conflicts with possible macros or labels of the
-% same name.
+% The `identifier` argument remains confined within the internal scope of the
+% package and does not create conflicts with possible macros or labels of the
+% same name. Leading and trailing spaces around this string will be ignored.
%
% If the same `identifier` is not passed to `\hereapplies` at least once
% throughout the document, `\whereapplies` will print "??".
%
-% The starred version of this macro (`\whereapplies*`) will use `\pageref*`
+% The starred version of this command (`\whereapplies*`) will use `\pageref*`
% instead of `\pageref` for generating the page list.
%
-\newcommand{\whereapplies}{%
- % Check if a star is present in the invocation of the command
- \@ifstar{\@ha@getpropat{soutput}}{\@ha@getpropat{uoutput}}%
+\newcommand*{\whereapplies}{%
+ % Check if a star is present in the invocation of the command
+ \@ifstar{\get@hainfo[soutput]}{\get@hainfo[doutput]}%
}%
+% EOF
diff --git a/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx b/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx
index e6f5f6f07b..f2c5beadba 100644
--- a/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx
+++ b/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx
@@ -106,6 +106,7 @@ This is concept one.
status open
\begin_layout Plain Layout
+
conceptOne
\end_layout
@@ -121,6 +122,7 @@ This is concept two.
status open
\begin_layout Plain Layout
+
conceptTwo
\end_layout
@@ -141,12 +143,13 @@ conceptTwo
status open
\begin_layout Plain Layout
+
conceptOne
\end_layout
\end_inset
-This is page
+ This is page
\begin_inset ERT
status collapsed
@@ -180,12 +183,13 @@ concept one
status open
\begin_layout Plain Layout
+
conceptTwo
\end_layout
\end_inset
-This is page
+ This is page
\begin_inset ERT
status collapsed
@@ -219,12 +223,13 @@ concept two
status open
\begin_layout Plain Layout
-conceptOne,conceptTwo
+
+conceptOne, conceptTwo
\end_layout
\end_inset
-This is page
+ This is page
\begin_inset ERT
status collapsed
@@ -269,12 +274,13 @@ concept two
status open
\begin_layout Plain Layout
+
conceptTwo
\end_layout
\end_inset
-This is page
+ This is page
\begin_inset ERT
status collapsed
@@ -308,10 +314,12 @@ concept two
status open
\begin_layout Plain Layout
+
\begin_inset Argument 1
status open
\begin_layout Plain Layout
+
myref
\end_layout
@@ -322,7 +330,7 @@ conceptOne
\end_inset
-This is page
+ This is page
\begin_inset ERT
status collapsed
diff --git a/macros/latex/contrib/hereapplies/package.json b/macros/latex/contrib/hereapplies/package.json
index 300cd53071..fa375b37a7 100644
--- a/macros/latex/contrib/hereapplies/package.json
+++ b/macros/latex/contrib/hereapplies/package.json
@@ -1,6 +1,6 @@
{
"name": "hereapplies.sty",
- "version": "0.6.0",
+ "version": "0.7.0",
"description": "A LaTeX package for referencing groups of pages that share something in common",
"homepage": "https://madmurphy.github.io/hereapplies.sty",
"author": "madmurphy",
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index 371dcfb50d..8f8cc3876b 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,4 +1,4 @@
-## Babel 3.78
+## Babel 3.79
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -8,9 +8,9 @@ is a set of ini files for about 250 languages.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.78 are described in:
+Changes in version 3.79 are described in:
-https://latex3.github.io/babel/news/whats-new-in-babel-3.78.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.79.html
Apart from the manual, you can find information on some aspects of babel at:
@@ -46,13 +46,13 @@ respective authors.
### Summary of latest changes
```
-3.78 2022-07-20
- * Fix: Undefined \bbl@xenohyph with Thai (#182).
- * More minor updates to the CLDR 41: Chechen, Cherokee, Central
- Kurdish, Czech, Welsh, Danish, German, Lower Sorbian,
- Dzongkha, Ewe, Greek, Esperanto, Spanish, Estonian, Persian,
- Finnish, Filipino, Faroese, Western Frisian, Irish, Scottish
- Gaelic.
+3.79 2022-08-29
+ * Fixes:
+ - Issues of tcolorbox in RTL (graphics layout), thanks to Salim
+ Bou (@seloumi) (#186).
+ - \footnote with babel bidi=default raises an error in LuaLaTeX (#187).
+ - Extra blank spaces with Hebrew calendar.
+ * 'odia' is now the preferred name for 'oriya', following the CLDR.
```
### Previous changes
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index d9ebe75a44..1e7004c471 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}[2022/07/20 v3.78 The Babel package]
+\ProvidesFile{babel.dtx}[2022/08/29 v3.79 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -126,8 +126,9 @@
\def\MacroFont{\fontencoding \encodingdefault \fontfamily\ttdefault
\fontseries\mddefault \fontshape\updefault \small \catcode`\_=\active}
\definecolor{shadecolor}{rgb}{0.96,0.96,0.93}
-\def\PrintDescribeMacro#1{%
- \strut\MacroFont\color{thered}\normalsize\string#1}
+\AtBeginDocument{%
+ \def\PrintDescribeMacro#1{%
+ \strut\MacroFont\color{thered}\normalsize\string#1}}
\def\Describe#1{%
\par\penalty-500\vskip3ex\noindent
\DescribeMacro{#1}\args}
@@ -5050,6 +5051,9 @@ help from Bernd Raichle, for which I am grateful.
in: \TeX hax Digest, Volume 89, \#13, 17 February 1989.
\bibitem{CJKV} Ken Lunde,
\textit{CJKV Information Processing}, O'Reilly, 2nd ed., 2009.
+ \bibitem{ReinDersh} Edward M. Reingold and Nachum Dershowitz,
+ \emph{Calendrical Calculations: The Ultimate Edition},
+ Cambridge University Press, 2018
\bibitem{HP} Hubert Partl,
\emph{German \TeX},
\emph{TUGboat} 9 (1988) \#1, p.~70--72.
@@ -5171,8 +5175,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.78>>
-%<<date=2022/07/20>>
+%<<version=3.79>>
+%<<date=2022/08/29>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5636,9 +5640,7 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@infowarn#1{%
\begingroup
\def\\{\MessageBreak}%
- \GenericWarning
- {(babel) \@spaces\@spaces\@spaces}%
- {Package babel Info: #1}%
+ \PackageNote{babel}{#1}%
\endgroup}
\def\bbl@info#1{%
\begingroup
@@ -6945,6 +6947,7 @@ help from Bernd Raichle, for which I am grateful.
define it after the language has been loaded\\%
(typically in the preamble) with:\\%
\string\setlocalecaption{\languagename}{\bbl@tempa}{..}\\%
+ Feel free to contribute on github.com/latex3/babel.\\%
Reported}}
\def\bbl@tentative{\protect\bbl@tentative@i}
\def\bbl@tentative@i#1{%
@@ -9661,6 +9664,9 @@ help from Bernd Raichle, for which I am grateful.
% \end{macrocode}
%
% \subsection{Load engine specific macros}
+%
+% Some macros are not defined in all engines, so, after loading the
+% files define them if necessary to raise an error.
%
% \begin{macrocode}
\bbl@trace{Input engine specific macros}
@@ -9671,6 +9677,19 @@ help from Bernd Raichle, for which I am grateful.
\or
\input xebabel.def
\fi
+\providecommand\babelfont{%
+ \bbl@error
+ {This macro is available only in LuaLaTeX and XeLaTeX.}%
+ {Consider switching to these engines.}}
+\providecommand\babelprehyphenation{%
+ \bbl@error
+ {This macro is available only in LuaLaTeX.}%
+ {Consider switching to that engine.}}
+\ifx\babelposthyphenation\@undefined
+ \let\babelposthyphenation\babelprehyphenation
+ \let\babelpatterns\babelprehyphenation
+ \let\babelcharproperty\babelprehyphenation
+\fi
% \end{macrocode}
%
% \subsection{Creating and modifying languages}
@@ -9690,28 +9709,12 @@ help from Bernd Raichle, for which I am grateful.
\edef\languagename{#2}%
\bbl@id@assign
% Initialize keys
- \let\bbl@KVP@captions\@nil
- \let\bbl@KVP@date\@nil
- \let\bbl@KVP@import\@nil
- \let\bbl@KVP@main\@nil
- \let\bbl@KVP@script\@nil
- \let\bbl@KVP@language\@nil
- \let\bbl@KVP@hyphenrules\@nil
- \let\bbl@KVP@linebreaking\@nil
- \let\bbl@KVP@justification\@nil
- \let\bbl@KVP@mapfont\@nil
- \let\bbl@KVP@maparabic\@nil
- \let\bbl@KVP@mapdigits\@nil
- \let\bbl@KVP@intraspace\@nil
- \let\bbl@KVP@intrapenalty\@nil
- \let\bbl@KVP@onchar\@nil
- \let\bbl@KVP@transforms\@nil
+ \bbl@vforeach{captions,date,import,main,script,language,%
+ hyphenrules,linebreaking,justification,mapfont,maparabic,%
+ mapdigits,intraspace,intrapenalty,onchar,transforms,alph,%
+ Alph,labels,labels*,calendar}%
+ {\bbl@csarg\let{KVP@##1}\@nnil}%
\global\let\bbl@release@transforms\@empty
- \let\bbl@KVP@alph\@nil
- \let\bbl@KVP@Alph\@nil
- \let\bbl@KVP@labels\@nil
- \bbl@csarg\let{KVP@labels*}\@nil
- \let\bbl@KVP@calendar\@nil
\let\bbl@calendars\@empty
\global\let\bbl@inidata\@empty
\global\let\bbl@extend@ini\@gobble
@@ -9722,6 +9725,11 @@ help from Bernd Raichle, for which I am grateful.
\global\let\bbl@extend@ini\bbl@extend@ini@aux
\bbl@renewinikey##1\@@{##2}%
\else
+ \bbl@csarg\ifx{KVP@##1}\@nnil\else
+ \bbl@error
+ {Unknown key '##1' in \string\babelprovide}%
+ {See the manual for valid keys}%
+ \fi
\bbl@csarg\def{KVP@##1}{##2}%
\fi}%
\chardef\bbl@howloaded=% 0:none; 1:ldf without ini; 2:ini
@@ -9735,15 +9743,15 @@ help from Bernd Raichle, for which I am grateful.
\ifcase\bbl@howloaded
\let\bbl@lbkflag\@empty % new
\else
- \ifx\bbl@KVP@hyphenrules\@nil\else
+ \ifx\bbl@KVP@hyphenrules\@nnil\else
\let\bbl@lbkflag\@empty
\fi
- \ifx\bbl@KVP@import\@nil\else
+ \ifx\bbl@KVP@import\@nnil\else
\let\bbl@lbkflag\@empty
\fi
\fi
% == import, captions ==
- \ifx\bbl@KVP@import\@nil\else
+ \ifx\bbl@KVP@import\@nnil\else
\bbl@exp{\\\bbl@ifblank{\bbl@KVP@import}}%
{\ifx\bbl@initoload\relax
\begingroup
@@ -9755,11 +9763,11 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
{}%
\fi
- \ifx\bbl@KVP@captions\@nil
+ \ifx\bbl@KVP@captions\@nnil
\let\bbl@KVP@captions\bbl@KVP@import
\fi
% ==
- \ifx\bbl@KVP@transforms\@nil\else
+ \ifx\bbl@KVP@transforms\@nnil\else
\bbl@replace\bbl@KVP@transforms{ }{,}%
\fi
% == Load ini ==
@@ -9777,7 +9785,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@extend@ini{#2}%
\fi
% == ensure captions ==
- \ifx\bbl@KVP@captions\@nil\else
+ \ifx\bbl@KVP@captions\@nnil\else
\bbl@ifunset{bbl@extracaps@#2}%
{\bbl@exp{\\\babelensure[exclude=\\\today]{#2}}}%
{\bbl@exp{\\\babelensure[exclude=\\\today,
@@ -9800,10 +9808,10 @@ help from Bernd Raichle, for which I am grateful.
\bbl@load@basic{#2}%
% == script, language ==
% Override the values from ini or defines them
- \ifx\bbl@KVP@script\@nil\else
+ \ifx\bbl@KVP@script\@nnil\else
\bbl@csarg\edef{sname@#2}{\bbl@KVP@script}%
\fi
- \ifx\bbl@KVP@language\@nil\else
+ \ifx\bbl@KVP@language\@nnil\else
\bbl@csarg\edef{lname@#2}{\bbl@KVP@language}%
\fi
\ifcase\bbl@engine\or
@@ -9812,7 +9820,7 @@ help from Bernd Raichle, for which I am grateful.
Babel.set_chranges_b('\bbl@cl{sbcp}', '\bbl@cl{chrng}') }}%
\fi
% == onchar ==
- \ifx\bbl@KVP@onchar\@nil\else
+ \ifx\bbl@KVP@onchar\@nnil\else
\bbl@luahyphenate
\bbl@exp{%
\\\AddToHook{env/document/before}{{\\\select@language{#2}{}}}}%
@@ -9872,7 +9880,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
% == mapfont ==
% For bidi texts, to switch the font based on direction
- \ifx\bbl@KVP@mapfont\@nil\else
+ \ifx\bbl@KVP@mapfont\@nnil\else
\bbl@ifsamestring{\bbl@KVP@mapfont}{direction}{}%
{\bbl@error{Option '\bbl@KVP@mapfont' unknown for\\%
mapfont. Use 'direction'.%
@@ -9898,7 +9906,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
% == Line breaking: intraspace, intrapenalty ==
% For CJK, East Asian, Southeast Asian, if interspace in ini
- \ifx\bbl@KVP@intraspace\@nil\else % We can override the ini or set
+ \ifx\bbl@KVP@intraspace\@nnil\else % We can override the ini or set
\bbl@csarg\edef{intsp@#2}{\bbl@KVP@intraspace}%
\fi
\bbl@provide@intraspace
@@ -9921,10 +9929,10 @@ help from Bernd Raichle, for which I am grateful.
\fi
\fi
% == Line breaking: justification ==
- \ifx\bbl@KVP@justification\@nil\else
+ \ifx\bbl@KVP@justification\@nnil\else
\let\bbl@KVP@linebreaking\bbl@KVP@justification
\fi
- \ifx\bbl@KVP@linebreaking\@nil\else
+ \ifx\bbl@KVP@linebreaking\@nnil\else
\bbl@xin@{,\bbl@KVP@linebreaking,}{,elongated,kashida,cjk,unhyphenated,}%
\ifin@
\bbl@csarg\xdef
@@ -9966,7 +9974,7 @@ help from Bernd Raichle, for which I am grateful.
{\expandafter\ifx\csname bbl@dgnat@\languagename\endcsname\@empty\else
\expandafter\expandafter\expandafter
\bbl@setdigits\csname bbl@dgnat@\languagename\endcsname
- \ifx\bbl@KVP@maparabic\@nil\else
+ \ifx\bbl@KVP@maparabic\@nnil\else
\ifx\bbl@latinarabic\@undefined
\expandafter\let\expandafter\@arabic
\csname bbl@counter@\languagename\endcsname
@@ -9980,7 +9988,7 @@ help from Bernd Raichle, for which I am grateful.
% == Counters: mapdigits ==
% Native digits (lua level).
\ifodd\bbl@engine
- \ifx\bbl@KVP@mapdigits\@nil\else
+ \ifx\bbl@KVP@mapdigits\@nnil\else
\bbl@ifunset{bbl@dgnat@\languagename}{}%
{\RequirePackage{luatexbase}%
\bbl@activate@preotf
@@ -10018,7 +10026,7 @@ help from Bernd Raichle, for which I am grateful.
% What if extras<lang> contains a \babel@save\@alph? It won't be
% restored correctly when exiting the language, so we ignore
% this change with the \bbl@alph@saved trick.
- \ifx\bbl@KVP@alph\@nil\else
+ \ifx\bbl@KVP@alph\@nnil\else
\bbl@extras@wrap{\\\bbl@alph@saved}%
{\let\bbl@alph@saved\@alph}%
{\let\@alph\bbl@alph@saved
@@ -10027,7 +10035,7 @@ help from Bernd Raichle, for which I am grateful.
\\\bbl@add\<extras\languagename>{%
\let\\\@alph\<bbl@cntr@\bbl@KVP@alph @\languagename>}}%
\fi
- \ifx\bbl@KVP@Alph\@nil\else
+ \ifx\bbl@KVP@Alph\@nnil\else
\bbl@extras@wrap{\\\bbl@Alph@saved}%
{\let\bbl@Alph@saved\@Alph}%
{\let\@Alph\bbl@Alph@saved
@@ -10037,7 +10045,7 @@ help from Bernd Raichle, for which I am grateful.
\let\\\@Alph\<bbl@cntr@\bbl@KVP@Alph @\languagename>}}%
\fi
% == Calendars ==
- \ifx\bbl@KVP@calendar\@nil
+ \ifx\bbl@KVP@calendar\@nnil
\edef\bbl@KVP@calendar{\bbl@cl{calpr}}%
\fi
\def\bbl@tempe##1 ##2\@@{% Get first calendar
@@ -10087,7 +10095,7 @@ help from Bernd Raichle, for which I am grateful.
% == Release saved transforms ==
\bbl@release@transforms\relax % \relax closes the last item.
% == main ==
- \ifx\bbl@KVP@main\@nil % Restore only if not 'main'
+ \ifx\bbl@KVP@main\@nnil % Restore only if not 'main'
\let\languagename\bbl@savelangname
\chardef\localeid\bbl@savelocaleid\relax
\fi}
@@ -10103,7 +10111,7 @@ help from Bernd Raichle, for which I am grateful.
\@namedef{extras#1}{}%
\@namedef{noextras#1}{}%
\bbl@startcommands*{#1}{captions}%
- \ifx\bbl@KVP@captions\@nil % and also if import, implicit
+ \ifx\bbl@KVP@captions\@nnil % and also if import, implicit
\def\bbl@tempb##1{% elt for \bbl@captionslist
\ifx##1\@empty\else
\bbl@exp{%
@@ -10120,7 +10128,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
\fi
\StartBabelCommands*{#1}{date}%
- \ifx\bbl@KVP@import\@nil
+ \ifx\bbl@KVP@import\@nnil
\bbl@exp{%
\\\SetString\\\today{\\\bbl@nocaption{today}{#1today}}}%
\else
@@ -10136,17 +10144,17 @@ help from Bernd Raichle, for which I am grateful.
{\bbl@ifunset{bbl@rgthm@#1}{3}{\bbl@cs{rgthm@#1}}}}}%
% == hyphenrules (also in renew) ==
\bbl@provide@hyphens{#1}%
- \ifx\bbl@KVP@main\@nil\else
+ \ifx\bbl@KVP@main\@nnil\else
\expandafter\main@language\expandafter{#1}%
\fi}
%
\def\bbl@provide@renew#1{%
- \ifx\bbl@KVP@captions\@nil\else
+ \ifx\bbl@KVP@captions\@nnil\else
\StartBabelCommands*{#1}{captions}%
\bbl@read@ini{\bbl@KVP@captions}2% % Here all letters cat = 11
\EndBabelCommands
\fi
- \ifx\bbl@KVP@import\@nil\else
+ \ifx\bbl@KVP@import\@nnil\else
\StartBabelCommands*{#1}{date}%
\bbl@savetoday
\bbl@savedate
@@ -10193,7 +10201,7 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\def\bbl@provide@hyphens#1{%
\let\bbl@tempa\relax
- \ifx\bbl@KVP@hyphenrules\@nil\else
+ \ifx\bbl@KVP@hyphenrules\@nnil\else
\bbl@replace\bbl@KVP@hyphenrules{ }{,}%
\bbl@foreach\bbl@KVP@hyphenrules{%
\ifx\bbl@tempa\relax % if not yet found
@@ -10206,7 +10214,7 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\fi
\ifx\bbl@tempa\relax % if no opt or no language in opt found
- \ifx\bbl@KVP@import\@nil
+ \ifx\bbl@KVP@import\@nnil
\ifx\bbl@initoload\relax\else
\bbl@exp{% and hyphenrules is not empty
\\\bbl@ifblank{\bbl@cs{hyphr@#1}}%
@@ -10655,7 +10663,7 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@inikv@labels#1#2{%
\in@{.map}{#1}%
\ifin@
- \ifx\bbl@KVP@labels\@nil\else
+ \ifx\bbl@KVP@labels\@nnil\else
\bbl@xin@{ map }{ \bbl@KVP@labels\space}%
\ifin@
\def\bbl@tempc{#1}%
@@ -10889,7 +10897,7 @@ help from Bernd Raichle, for which I am grateful.
\catcode`\%=12
\catcode`\&=14
\gdef\bbl@transforms#1#2#3{&%
- \ifx\bbl@KVP@transforms\@nil\else
+ \ifx\bbl@KVP@transforms\@nnil\else
\directlua{
local str = [==[#2]==]
str = str:gsub('%.%d+%.%d+$', '')
@@ -13196,18 +13204,18 @@ help from Bernd Raichle, for which I am grateful.
\ifin@
\bbl@ifunset{bbl@intsp@\languagename}{}%
{\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else
- \ifx\bbl@KVP@intraspace\@nil
+ \ifx\bbl@KVP@intraspace\@nnil
\bbl@exp{%
\\\bbl@intraspace\bbl@cl{intsp}\\\@@}%
\fi
- \ifx\bbl@KVP@intrapenalty\@nil
+ \ifx\bbl@KVP@intrapenalty\@nnil
\bbl@intrapenalty0\@@
\fi
\fi
- \ifx\bbl@KVP@intraspace\@nil\else % We may override the ini
+ \ifx\bbl@KVP@intraspace\@nnil\else % We may override the ini
\expandafter\bbl@intraspace\bbl@KVP@intraspace\@@
\fi
- \ifx\bbl@KVP@intrapenalty\@nil\else
+ \ifx\bbl@KVP@intrapenalty\@nnil\else
\expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@
\fi
\bbl@exp{%
@@ -13612,15 +13620,18 @@ help from Bernd Raichle, for which I am grateful.
end
lang.patterns(lg, pats)
end
+ Babel.characters = Babel.characters or {}
+ Babel.ranges = Babel.ranges or {}
function Babel.hlist_has_bidi(head)
local has_bidi = false
+ local ranges = Babel.ranges
for item in node.traverse(head) do
if item.id == node.id'glyph' then
local itemchar = item.char
local chardata = Babel.characters[itemchar]
local dir = chardata and chardata.d or nil
if not dir then
- for nn, et in ipairs(Babel.ranges) do
+ for nn, et in ipairs(ranges) do
if itemchar < et[1] then
break
elseif itemchar <= et[2] then
@@ -13957,7 +13968,7 @@ help from Bernd Raichle, for which I am grateful.
Babel.locale_props[\the\localeid].linebreak = 'c'
}%
\bbl@exp{\\\bbl@intraspace\bbl@cl{intsp}\\\@@}%
- \ifx\bbl@KVP@intrapenalty\@nil
+ \ifx\bbl@KVP@intrapenalty\@nnil
\bbl@intrapenalty0\@@
\fi
\else % sea
@@ -13969,12 +13980,12 @@ help from Bernd Raichle, for which I am grateful.
Babel.set_chranges('\bbl@cl{sbcp}',
'\bbl@cl{chrng}')
}%
- \ifx\bbl@KVP@intrapenalty\@nil
+ \ifx\bbl@KVP@intrapenalty\@nnil
\bbl@intrapenalty0\@@
\fi
\fi
\fi
- \ifx\bbl@KVP@intrapenalty\@nil\else
+ \ifx\bbl@KVP@intrapenalty\@nnil\else
\expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@
\fi}}
% \end{macrocode}
@@ -14941,13 +14952,18 @@ end
\bbl@sreplace\tikz{\begingroup}{\begingroup\bbl@pictsetdir\tw@}%
\fi
\ifx\tcolorbox\@undefined\else
- \AddToHook{env/tcolorbox/begin}{\bbl@pictsetdir\@ne}%
- \bbl@sreplace\tcb@savebox
- {\ignorespaces}{\ignorespaces\bbl@pictresetdir}%
- \ifx\tikzpicture@tcb@hooked\@undefined\else
- \bbl@sreplace\tikzpicture@tcb@hooked{\noexpand\tikzpicture}%
- {\textdir TLT\noexpand\tikzpicture}%
- \fi
+ \def\tcb@drawing@env@begin{%
+ \csname tcb@before@\tcb@split@state\endcsname
+ \bbl@pictsetdir\tw@
+ \begin{\kvtcb@graphenv}%
+ \tcb@bbdraw%
+ \tcb@apply@graph@patches
+ }%
+ \def\tcb@drawing@env@end{%
+ \end{\kvtcb@graphenv}%
+ \bbl@pictresetdir
+ \csname tcb@after@\tcb@split@state\endcsname
+ }%
\fi
}}
{}
@@ -15535,7 +15551,7 @@ end
Babel = Babel or {}
-Babel.ranges={
+Babel.ranges = {
{0x0590, 0x05FF, 'r'},
{0x0600, 0x07BF, 'al'},
{0x07C0, 0x085F, 'r'},
@@ -15553,7 +15569,7 @@ Babel.ranges={
{0x100000, 0x10FFFD, 'on'} -- PUA
}
-Babel.characters={
+Babel.characters = {
[0x0]={d='bn'},
[0x1]={d='bn'},
[0x2]={d='bn'},
@@ -22848,21 +22864,22 @@ Babel.cjk_breaks = {
% This is basically the set of macros written by Michail Rozman in
% 1991, with corrections and adaptions by Rama Porrat, Misha, Dan Haran
% and Boris Lavva. This must be eventually replaced by computations
-% with \textsf{l3fp}.
+% with \textsf{l3fp}. An explanation of what’s going on can be found in
+% \texttt{hebcal.sty}
%
% \begin{macrocode}
%<*ca-hebrew>
\newcount\bbl@cntcommon
\def\bbl@remainder#1#2#3{%
- #3 = #1 % c = a
- \divide #3 by #2 % c = a/b
- \multiply #3 by -#2 % c = -b(a/b)
- \advance #3 by #1 }% % c = a - b(a/b)
+ #3=#1\relax
+ \divide #3 by #2\relax
+ \multiply #3 by -#2\relax
+ \advance #3 by #1\relax}%
\newif\ifbbl@divisible
\def\bbl@checkifdivisible#1#2{%
- {\countdef\tmp = 0 % \tmp == \count0 - temporary variable
+ {\countdef\tmp=0
\bbl@remainder{#1}{#2}{\tmp}%
- \ifnum \tmp = 0
+ \ifnum \tmp=0
\global\bbl@divisibletrue
\else
\global\bbl@divisiblefalse
@@ -22886,94 +22903,94 @@ Babel.cjk_breaks = {
\bbl@gregleapfalse
\fi
\ifbbl@gregleap}
-\def\bbl@gregdayspriormonths#1#2#3{% no month number 0
- {#3 = \ifcase #1 0 \or 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or
+\def\bbl@gregdayspriormonths#1#2#3{%
+ {#3=\ifcase #1 0 \or 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or
181 \or 212 \or 243 \or 273 \or 304 \or 334 \fi
\bbl@ifgregleap{#2}%
- \ifnum #1 > 2 % if month after February
- \advance #3 by 1 % add leap day
+ \ifnum #1 > 2
+ \advance #3 by 1
\fi
\fi
- \global\bbl@cntcommon = #3}%
- #3 = \bbl@cntcommon}
+ \global\bbl@cntcommon=#3}%
+ #3=\bbl@cntcommon}
\def\bbl@gregdaysprioryears#1#2{%
- {\countdef\tmpc = 4 % \tmpc==\count4
- \countdef\tmpb = 2 % \tmpb==\count2
- \tmpb = #1 %
- \advance \tmpb by -1 %
- \tmpc = \tmpb % \tmpc = \tmpb = year-1
- \multiply \tmpc by 365 % Days in prior years =
- #2 = \tmpc % = 365*(year-1) ...
- \tmpc = \tmpb %
- \divide \tmpc by 4 % \tmpc = (year-1)/4
- \advance #2 by \tmpc % ... plus Julian leap days ...
- \tmpc = \tmpb %
- \divide \tmpc by 100 % \tmpc = (year-1)/100
- \advance #2 by -\tmpc % ... minus century years ...
- \tmpc = \tmpb %
- \divide \tmpc by 400 % \tmpc = (year-1)/400
- \advance #2 by \tmpc % ... plus 4-century years.
- \global\bbl@cntcommon = #2}%
- #2 = \bbl@cntcommon}
+ {\countdef\tmpc=4
+ \countdef\tmpb=2
+ \tmpb=#1\relax
+ \advance \tmpb by -1
+ \tmpc=\tmpb
+ \multiply \tmpc by 365
+ #2=\tmpc
+ \tmpc=\tmpb
+ \divide \tmpc by 4
+ \advance #2 by \tmpc
+ \tmpc=\tmpb
+ \divide \tmpc by 100
+ \advance #2 by -\tmpc
+ \tmpc=\tmpb
+ \divide \tmpc by 400
+ \advance #2 by \tmpc
+ \global\bbl@cntcommon=#2\relax}%
+ #2=\bbl@cntcommon}
\def\bbl@absfromgreg#1#2#3#4{%
- {\countdef\tmpd = 0 % \tmpd==\count0
- #4 = #1 % days so far this month
+ {\countdef\tmpd=0
+ #4=#1\relax
\bbl@gregdayspriormonths{#2}{#3}{\tmpd}%
- \advance #4 by \tmpd % add days in prior months
+ \advance #4 by \tmpd
\bbl@gregdaysprioryears{#3}{\tmpd}%
- \advance #4 by \tmpd % add days in prior years
- \global\bbl@cntcommon = #4}%
- #4 = \bbl@cntcommon}
+ \advance #4 by \tmpd
+ \global\bbl@cntcommon=#4\relax}%
+ #4=\bbl@cntcommon}
\newif\ifbbl@hebrleap
\def\bbl@checkleaphebryear#1{%
- {\countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \tmpa = #1
+ {\countdef\tmpa=0
+ \countdef\tmpb=1
+ \tmpa=#1\relax
\multiply \tmpa by 7
\advance \tmpa by 1
\bbl@remainder{\tmpa}{19}{\tmpb}%
- \ifnum \tmpb < 7 % \tmpb = (7*year+1)%19
+ \ifnum \tmpb < 7
\global\bbl@hebrleaptrue
\else
\global\bbl@hebrleapfalse
\fi}}
\def\bbl@hebrelapsedmonths#1#2{%
- {\countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \countdef\tmpc = 2 % \tmpc==\count2
- \tmpa = #1 %
- \advance \tmpa by -1 %
- #2 = \tmpa % #2 = \tmpa = year-1
- \divide #2 by 19 % Number of complete Meton cycles
- \multiply #2 by 235 % #2 = 235*((year-1)/19)
- \bbl@remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
- \tmpc = \tmpb %
- \multiply \tmpb by 12 %
- \advance #2 by \tmpb % add regular months this cycle
- \multiply \tmpc by 7 %
- \advance \tmpc by 1 %
- \divide \tmpc by 19 % \tmpc = (1+7*((year-1)%19))/19 -
- \advance #2 by \tmpc % add leap months
- \global\bbl@cntcommon = #2}%
- #2 = \bbl@cntcommon}
+ {\countdef\tmpa=0
+ \countdef\tmpb=1
+ \countdef\tmpc=2
+ \tmpa=#1\relax
+ \advance \tmpa by -1
+ #2=\tmpa
+ \divide #2 by 19
+ \multiply #2 by 235
+ \bbl@remainder{\tmpa}{19}{\tmpb}% \tmpa=years%19-years this cycle
+ \tmpc=\tmpb
+ \multiply \tmpb by 12
+ \advance #2 by \tmpb
+ \multiply \tmpc by 7
+ \advance \tmpc by 1
+ \divide \tmpc by 19
+ \advance #2 by \tmpc
+ \global\bbl@cntcommon=#2}%
+ #2=\bbl@cntcommon}
\def\bbl@hebrelapseddays#1#2{%
- {\countdef\tmpa = 0 % \tmpa==\count0
- \countdef\tmpb = 1 % \tmpb==\count1
- \countdef\tmpc = 2 % \tmpc==\count2
+ {\countdef\tmpa=0
+ \countdef\tmpb=1
+ \countdef\tmpc=2
\bbl@hebrelapsedmonths{#1}{#2}%
- \tmpa = #2 %
- \multiply \tmpa by 13753 %
- \advance \tmpa by 5604 % \tmpa=MonthsElapsed*13758 + 5604
+ \tmpa=#2\relax
+ \multiply \tmpa by 13753
+ \advance \tmpa by 5604
\bbl@remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
\divide \tmpa by 25920
\multiply #2 by 29
\advance #2 by 1
- \advance #2 by \tmpa % #2 = 1 + MonthsElapsed*29 +
- \bbl@remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \advance #2 by \tmpa
+ \bbl@remainder{#2}{7}{\tmpa}%
\ifnum \tmpc < 19440
\ifnum \tmpc < 9924
- \else % New moon at 9 h. 204 p. or later
- \ifnum \tmpa = 2 % on Tuesday ...
+ \else
+ \ifnum \tmpa=2
\bbl@checkleaphebryear{#1}% of a common year
\ifbbl@hebrleap
\else
@@ -22982,8 +22999,8 @@ Babel.cjk_breaks = {
\fi
\fi
\ifnum \tmpc < 16789
- \else % New moon at 15 h. 589 p. or later
- \ifnum \tmpa = 1 % on Monday ...
+ \else
+ \ifnum \tmpa=1
\advance #1 by -1
\bbl@checkleaphebryear{#1}% at the end of leap year
\ifbbl@hebrleap
@@ -22992,113 +23009,112 @@ Babel.cjk_breaks = {
\fi
\fi
\else
- \advance #2 by 1 % new moon at or after midday
+ \advance #2 by 1
\fi
- \bbl@remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
- \ifnum \tmpa = 0 % if Sunday ...
+ \bbl@remainder{#2}{7}{\tmpa}%
+ \ifnum \tmpa=0
\advance #2 by 1
- \else %
- \ifnum \tmpa = 3 % Wednesday ...
+ \else
+ \ifnum \tmpa=3
\advance #2 by 1
\else
- \ifnum \tmpa = 5 % or Friday
+ \ifnum \tmpa=5
\advance #2 by 1
\fi
\fi
\fi
- \global\bbl@cntcommon = #2}%
- #2 = \bbl@cntcommon}
+ \global\bbl@cntcommon=#2\relax}%
+ #2=\bbl@cntcommon}
\def\bbl@daysinhebryear#1#2{%
- {\countdef\tmpe = 12 % \tmpe==\count12
+ {\countdef\tmpe=12
\bbl@hebrelapseddays{#1}{\tmpe}%
\advance #1 by 1
\bbl@hebrelapseddays{#1}{#2}%
\advance #2 by -\tmpe
- \global\bbl@cntcommon = #2}%
- #2 = \bbl@cntcommon}
+ \global\bbl@cntcommon=#2}%
+ #2=\bbl@cntcommon}
\def\bbl@hebrdayspriormonths#1#2#3{%
- {\countdef\tmpf= 14 % \tmpf==\count14
- #3 = \ifcase #1 % Days in prior month of regular year
- 0 \or % no month number 0
- 0 \or % Tishri
- 30 \or % Heshvan
- 59 \or % Kislev
- 89 \or % Tebeth
- 118 \or % Shebat
- 148 \or % Adar I
- 148 \or % Adar II
- 177 \or % Nisan
- 207 \or % Iyar
- 236 \or % Sivan
- 266 \or % Tammuz
- 295 \or % Av
- 325 \or % Elul
- 400 % Dummy
+ {\countdef\tmpf= 14
+ #3=\ifcase #1\relax
+ 0 \or
+ 0 \or
+ 30 \or
+ 59 \or
+ 89 \or
+ 118 \or
+ 148 \or
+ 148 \or
+ 177 \or
+ 207 \or
+ 236 \or
+ 266 \or
+ 295 \or
+ 325 \or
+ 400
\fi
\bbl@checkleaphebryear{#2}%
- \ifbbl@hebrleap % in leap year
- \ifnum #1 > 6 % if month after Adar I
- \advance #3 by 30 % add 30 days
+ \ifbbl@hebrleap
+ \ifnum #1 > 6
+ \advance #3 by 30
\fi
\fi
\bbl@daysinhebryear{#2}{\tmpf}%
\ifnum #1 > 3
- \ifnum \tmpf = 353 %
- \advance #3 by -1 %
- \fi % Short Kislev
- \ifnum \tmpf = 383 %
- \advance #3 by -1 %
- \fi %
+ \ifnum \tmpf=353
+ \advance #3 by -1
+ \fi
+ \ifnum \tmpf=383
+ \advance #3 by -1
+ \fi
\fi
\ifnum #1 > 2
- \ifnum \tmpf = 355 %
- \advance #3 by 1 %
- \fi % Long Heshvan
- \ifnum \tmpf = 385 %
- \advance #3 by 1 %
- \fi %
+ \ifnum \tmpf=355
+ \advance #3 by 1
+ \fi
+ \ifnum \tmpf=385
+ \advance #3 by 1
+ \fi
\fi
- \global\bbl@cntcommon = #3}%
- #3 = \bbl@cntcommon}
+ \global\bbl@cntcommon=#3\relax}%
+ #3=\bbl@cntcommon}
\def\bbl@absfromhebr#1#2#3#4{%
- {#4 = #1
+ {#4=#1\relax
\bbl@hebrdayspriormonths{#2}{#3}{#1}%
- \advance #4 by #1 % Add days in prior months this year
+ \advance #4 by #1\relax
\bbl@hebrelapseddays{#3}{#1}%
- \advance #4 by #1 % Add days in prior years
- \advance #4 by -1373429 % Subtract days before Gregorian
- \global\bbl@cntcommon = #4}% % 01.01.0001
- #4 = \bbl@cntcommon}
+ \advance #4 by #1\relax
+ \advance #4 by -1373429
+ \global\bbl@cntcommon=#4\relax}%
+ #4=\bbl@cntcommon}
\def\bbl@hebrfromgreg#1#2#3#4#5#6{%
- {\countdef\tmpx= 17 % \tmpx==\count17
- \countdef\tmpy= 18 % \tmpy==\count18
- \countdef\tmpz= 19 % \tmpz==\count19
- #6 = #3 %
- \global\advance #6 by 3761 % approximation from above
+ {\countdef\tmpx= 17
+ \countdef\tmpy= 18
+ \countdef\tmpz= 19
+ #6=#3\relax
+ \global\advance #6 by 3761
\bbl@absfromgreg{#1}{#2}{#3}{#4}%
- \tmpz = 1 \tmpy = 1
+ \tmpz=1 \tmpy=1
\bbl@absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
- \ifnum \tmpx > #4 %
- \global\advance #6 by -1 % Hyear = Gyear + 3760
+ \ifnum \tmpx > #4\relax
+ \global\advance #6 by -1
\bbl@absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
- \fi %
- \advance #4 by -\tmpx % Days in this year
- \advance #4 by 1 %
- #5 = #4 %
- \divide #5 by 30 % Approximation for month from below
- \loop % Search for month
+ \fi
+ \advance #4 by -\tmpx
+ \advance #4 by 1
+ #5=#4\relax
+ \divide #5 by 30
+ \loop
\bbl@hebrdayspriormonths{#5}{#6}{\tmpx}%
- \ifnum \tmpx < #4
+ \ifnum \tmpx < #4\relax
\advance #5 by 1
- \tmpy = \tmpx
+ \tmpy=\tmpx
\repeat
\global\advance #5 by -1
\global\advance #4 by -\tmpy}}
\newcount\bbl@hebrday \newcount\bbl@hebrmonth \newcount\bbl@hebryear
\newcount\bbl@gregday \newcount\bbl@gregmonth \newcount\bbl@gregyear
-%
\def\bbl@ca@hebrew#1-#2-#3\@@#4#5#6{%
- \bbl@gregday=#3 \bbl@gregmonth=#2 \bbl@gregyear=#1
+ \bbl@gregday=#3\relax \bbl@gregmonth=#2\relax \bbl@gregyear=#1\relax
\bbl@hebrfromgreg
{\bbl@gregday}{\bbl@gregmonth}{\bbl@gregyear}%
{\bbl@hebrday}{\bbl@hebrmonth}{\bbl@hebryear}%
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index 13a22deb6a..e33a43e916 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{2022/07/20}
+\def\filedate{2022/08/29}
\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
index 8d2d9a776d..d742702467 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index c8f85ad5b6..95360a381a 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}[2022/07/20 v3.78]
+\ProvidesFile{bbcompat.dtx}[2022/08/29 v3.79]
%</dtx>
%
%% File 'bbcompat.dtx'