texlive[59101] Master/texmf-dist: biblatex-gb7714-2015 (6may21)
commits+karl at tug.org
commits+karl at tug.org
Thu May 6 22:22:49 CEST 2021
Revision: 59101
http://tug.org/svn/texlive?view=revision&revision=59101
Author: karl
Date: 2021-05-06 22:22:49 +0200 (Thu, 06 May 2021)
Log Message:
-----------
biblatex-gb7714-2015 (6may21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md
trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx
trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.cbx
Modified: trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md 2021-05-06 20:22:49 UTC (rev 59101)
@@ -1,4 +1,4 @@
-<b>Date of last change: 2021-04-03 to version v1.0x</b>
+<b>Date of last change: 2021-05-06 to version v1.0y</b>
# biblatex-gb7714-2015: a biblatex style package
@@ -55,7 +55,7 @@
* [LZUthesis(兰州大学本科毕业论文LaTeX模板)](https://github.com/szsdk/LZUthesis)
* [neuthesis(东北大学博士学位论文Latex模板)](https://github.com/mervin0502/neuthesis)
* [NJU-thesis-esz(南京大学学位论文-微调整后适用于人文社科)](https://github.com/EdwardSaidZhou/NJU-thesis-esz)
-* [NKThesis(南开大学硕士毕业论文(博士论文)Latex模板)](https://github.com/procuteboy/NKThesis)
+* NKThesis(南开大学硕/博模板)[Template1](https://github.com/procuteboy/NKThesis) [Template2](https://github.com/NewFuture/NKThesis)
* [NKUBachelorThesis(南开大学本科生毕业论文(毕业设计)LaTeX模板)](https://github.com/NKcqx/NKUBachelorThesis)
* [nputhesis(NPU 博士、硕士学位论文 \LaTeX 模板)](https://github.com/NPUSCG/nputhesis)
* [nuaa-thesis(南京航空航天大学本科、硕士和博士学位论文的样式模板)](https://github.com/nuaa803/nuaa-thesis)
@@ -73,6 +73,7 @@
* [UCASthesis(ucasthesis 国科大学位论文 LaTeX 模板 [最新样式])](https://github.com/mohuangrui/ucasthesis)
* [ustcthesis(中国科学技术大学学位论文 LaTeX 模板)](https://github.com/ustctug/ustcthesis)
* [WUTthesis(武汉理工大学研究生学位论文的 LaTeX 模板)](https://github.com/Jiayin-Gu/WUTthesis)
+* [whu-thesis(武汉大学毕业论文 LaTeX 模板)](https://github.com/whutug/whu-thesis)
* [Yet anoter BUPT Thesis LaTeX class (北邮研究生学位设计的LaTeX文档类)](https://github.com/qcts33/BUPTthesis-ctex)
* [Zhejiang University thesis(浙江大学毕业设计/论文模板)](https://github.com/TheNetAdmin/zjuthesis)
* [《经济研究》杂志 LaTeX 论文模板)](https://github.com/EthanDeng/Chinese-ERJ)
@@ -103,29 +104,21 @@
<h3 id="jumptopkgload">0. pacakge usage/宏包加载方式</h3>
样式包配合biblatex使用,即在biblatex调用时加载样式包:
-* 使用顺序编码制:
+* 顺序编码制样式(gb7714-2015):
```
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
```
-* 使用著者-出版年制:
+* 著者-出版年制样式(gb7714-2015ay):
```
\usepackage[backend=biber,style=gb7714-2015ay]{biblatex}
```
-* 使用宏包提供的选项:
+* 同一文献表中不同语言区分不同著录格式的样式(gb7714-2015ms):
```
- %设置gbalign选项以改变文献表序号标签对齐方式,
- %设置gbpub=false取消缺省出版项自填补信息,比如:
- \usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015,gbpub=false]{biblatex}
-```
-
-* 使用同一文献表中不同语言区分著录格式的样式(gb7714-2015ms):
-
-```
%设置gbstyle=false,中文文献使用GB/T 7714-2015著录格式,而其它语言文献使用biblatex标准样式
\usepackage[backend=biber,style=gb7714-2015ms,gbstyle=false]{biblatex}
```
@@ -139,6 +132,25 @@
\setaystylesection{2}
```
+* 标注(引用)样式和著录样式区分使用:
+```
+\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay]{biblatex}
+```
+或(类似的方式均可)
+```
+\usepackage[backend=biber,citestyle=gb7714-2015ay,bibstyle=gb7714-2015]{biblatex}
+```
+
+* 宏包选项的使用:
+
+```
+ %设置gbalign选项以改变文献表序号标签对齐方式,
+ %设置gbpub=false取消缺省出版项自填补信息,比如:
+ \usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015,gbpub=false]{biblatex}
+```
+
+
+
更多宏包选项的说明见:[biblatex-gb7714-2015.pdf](biblatex-gb7714-2015.pdf)
宏包加载的完整文档示例见:[tex文档一般结构](#jumptotexsrcf)
@@ -151,7 +163,7 @@
\usepackage{ctex}%加载ctex宏包,中文支持
-\usepackage[left=20mm,right=20mm,top=25mm, bottom=15mm]{geometry}%加载geometry宏包,定义版面
+\usepackage{geometry}%加载geometry宏包,定义版面
\usepackage[colorlinks=true,pdfstartview=FitH,%
linkcolor=blue,anchorcolor=violet,citecolor=magenta]{hyperref}%加载hyperref宏包,使用超链接
@@ -194,7 +206,8 @@
见文献\supercite{Peebles2001-100-100}
2. 不带页码的引用(顺序编码制非上标,方括号包围;作者年制行内,括号包围):\\
- 见文献\parencite{Peebles2001-100-100}
+ 见文献\parencite{Peebles2001-100-100}\\
+ 见文献\citep{Peebles2001-100-100}
3. 带页码的引用(标准命令,默认样式; 增加命令,GB/T 7714-2015样式):\\
见文献\cite[见][49页]{蔡敏2006--}\\
@@ -203,9 +216,10 @@
见文献\pagescite[201-301]{Peebles2001-100-100}
4. 顺序编码制中同时输出作者和顺序编码标签,比如:\\
- 见\citeauthor{蔡敏2006--}\cite{蔡敏2006--}\\
+ 见\citet{蔡敏2006--}(顺序编码标签上标)\\
见\authornumcite{蔡敏2006--}\\
见\textcite{蔡敏2006--} (顺序编码标签不上标)
+ 见\citeauthor{蔡敏2006--}\cite{蔡敏2006--}\\
5. 作者年制文中已有作者还需要年份和页码(顺序编码制与pagescite作用相同,作者年制年份行内页码上标):\\
见蔡敏\yearpagescite[][205]{蔡敏2006--}和Peebles\yearpagescite[][15]{Peebles2001-100-100}
@@ -216,7 +230,11 @@
见赵耀东(\citeyear{蔡敏2006--})
7. 作者年制中由标注命令给出作者年份信息,作者以主语方式作为正文内容:\\
- 见\textcite{蔡敏2006--}
+ 见\cite{蔡敏2006--}\\
+ 见\parencite{蔡敏2006--}\\
+ 见\textcite{蔡敏2006--}\\
+ 见\citet{蔡敏2006--}\\
+ 见\citep{蔡敏2006--}\\
8. 在页脚中引用和打印文献表:\\
见文献\footnote{在脚注中引用\footcite{蔡敏2006--}}\\
@@ -489,13 +507,36 @@
```\usepackage[backend=biber,citestyle=gb7714-2015ay,bibstyle=gb7714-2015]{biblatex}```
-参见:[issue:参考文献的顺序](https://github.com/sjtug/SJTUThesis/issues/300)
+但这种情况下,文献表中的年份信息是在出版项里面的,如果要提前到作者后面,可以使用如下方式:
+```\usepackage[backend=biber,style=gb7714-2015ay,gbgalign=right]{biblatex}```
+如果要让年份信息既出现在作者后面又出现在出版项里面,那么还可以增加mergedate选项进行控制:
+```\usepackage[backend=biber,style=gb7714-2015ay,gbgalign=right,mergedate=false]{biblatex}```
+这种情况下,直接用gb7714-2015ay下的gbgalign选项来生成数字标签的文献表,而且可以使用right/left/center/gb7714-2015等不同的选项值来实现不同对齐形式的标签。
+反过来如果要在文中引用是数字标签,而文献表是无数字标签的样式,那么也可以使用下面两种方式:
+```\usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015ay]{biblatex}```
+
+这种情况下,文献表中的年份信息是在出版项里面的,如果要提前到作者后面,则使用:
+
+```\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay]{biblatex}```
+
+类似的也可以使用mergedate选项来控制年份的显示情况:
+
+```\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay,mergedate=false]{biblatex}```
+
+参见:[issue:参考文献的顺序](https://github.com/sjtug/SJTUThesis/issues/300) ,
+[issue90](https://github.com/hushidong/biblatex-gb7714-2015/issues/90)
+
+
+
+
+
+
* <b>请问如果参考文献中存在一些特殊字符比如&或者一些特殊命令比如\LaTex{}等,是不是会出现问题?</b>
@@ -770,7 +811,7 @@
`{\MakeLowercase i}FogSim title contents`
-(2)修改titlecase域格式,即将如下命令放到导言区中,放biblatex后面
+(2)修改titlecase域格式,即将如下命令放到导言区中,放在biblatex宏包加载命令后面
```
\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{%
@@ -822,6 +863,17 @@
具体示例见:[biblatex中如何修改参考文献中日期的著录格式](https://blog.csdn.net/xenonhu/article/details/86933525)
+* <b>我希望将文献表中期刊文献的卷和期使用加粗格式,请问该如何处理?</b>
+
+调整其域格式输出即可,比如:
+
+```
+\DeclareFieldFormat[article,periodical]{volume}{\textbf{#1}}
+\DeclareFieldFormat[article,periodical]{number}{\textbf{#1}}
+```
+
+见:[issue](https://github.com/sjtug/SJTUThesis/issues/580)
+
#### 4.3 Citation format/正文引用的标注格式
@@ -966,7 +1018,32 @@
反之,从两个开始压缩改成3个连续压缩,方法是类似的,就是将中的0改回1。
+* <b>在顺序编码制标签中,希望修改编码压缩之间的符号,比如[1-2]变为[1~2],该怎么处理?</b>
+使用最新版本的biblatex (v3.15以后)可以直接定义如下标点:
+```
+\renewcommand{\multiciterangedelim}{$\sim$}
+```
+
+对于老版本可以修改宏,注意其中的注释
+```
+\renewbibmacro*{cite:dump}{
+ \ifnumgreater{\value{cbx at tempcnta}}{0}
+ {\ifnumgreater{\value{cbx at tempcnta}}{1}%1改为0,可以将压缩起始3个编号改为2个编号
+ {$\sim$}%压缩的链接标点修改\bibrangedash
+ {\multicitedelim}%
+ \bibhyperref[\cbx at lastkey]{%
+ \ifdef\cbx at lastprefix
+ {\printtext[labelprefix]{\cbx at lastprefix}}
+ {}%
+ \printtext[labelnumber]{\cbx at lastnumber}}}
+ {}%
+ \setcounter{cbx at tempcnta}{0}%
+ \global\undef\cbx at lastprefix}
+```
+
+
+
* <b>在正文中的某一部分,希望取消顺序编码标签中的压缩,而其他部分保持这种压缩,该怎么处理?</b>
@@ -1200,6 +1277,7 @@
- ![teststyleerj.tex](example\teststyleerj.tex) 测试chinese-erj样式
- ![test-translator-in-other-lan.tex](example\test-translator-in-other-lan.tex) 测试译著的其它语言的译者格式
- ![test-space-after-citelabel-inCJKline.tex](example\test-space-after-citelabel-inCJKline.tex) 测试删除标注后因为xeCJK加入的空格
+ - ![test-special-chars-in-fields.tex](test-special-chars-in-fields.tex) 测试不同域中存在的特殊字符处理
---------------------------------------------------------
@@ -1428,6 +1506,7 @@
* 2020/07/21 v1.0v,ctan
* 2021/01/19 v1.0w,ctan
* 2021/04/03 v1.0x,ctan
+* 2021/05/06 v1.0y,ctan
Modified: trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex 2021-05-06 20:22:49 UTC (rev 59101)
@@ -382,16 +382,17 @@
\begin{description}
\pdfbookmark[4]{gbalign}{gbalign}
- \item[gbalign]=\textbf{right},left,center,gb7714-2015. \hfill default is right
+ \item[gbalign]=\textbf{right},left,center,gb7714-2015,\textbf{gb7714-2015ay}. \hfill default: right for numeric style and gb7714-2015ay for author-year style
- 为顺序编码制增加的选项,用于选择参考文献表序号标签的对齐方式。
+ 为控制文献表数字序号标签增加的选项,用于选择是否生成序号标签及其对齐方式。
\begin{itemize}
- \item gbalign=right,默认的list环境中的标签右对齐;
- \item gbalign=left,是list环境中的标签左对齐;
- \item gbalign=center,是list环境中的等宽标签,数字在[]内居中;
- \item gbalign=gb7714-2015,是项对齐方式,即段落环境中标签使用原始宽度,标签与条目内容等间距。
+ \item gbalign=right,数字序号标签,是list环境中的标签右对齐,是gb7714-2015样式的默认选项;
+ \item gbalign=left,数字序号标签,是list环境中的标签左对齐;
+ \item gbalign=center,数字序号标签,是list环境中的等宽标签,数字在[]内居中;
+ \item gbalign=gb7714-2015,数字序号标签,是项对齐方式,即段落环境中标签使用原始宽度,标签与条目内容等间距。
+ \item gbalign=gb7714-2015ay,无数字序号标签,是author-year风格的文献表,是gb7714-2015ay样式的默认选项。
\end{itemize}
- 该选项对著者年份制无效。顺序编码制序号标签对齐方式测试,
+ 该选项对\textbf{著者年份制、顺序编码制均有效}。使用序号标签对齐方式的测试,
数字在标签内居中见:
\href{run:./example/opt-gbalign-center.tex}{opt-gbalign-center.tex},
标签左对齐见:
@@ -1305,6 +1306,8 @@
二是采用正常段落环境的文献表,即设置gbalign=gb7714-2015时(即项对齐情况,就是各条文献是自身对齐的情况),在重定义的命令中通过调整lengthid尺寸来设置\emph{每条参考文献第二行开始的缩进距离}。
调整方法见例\ref{eg:biblist:hspace}。
+除了使用这种段落形式的文献表外,也有需求是要把文献表放到一个表格里面这样的需求,要求每一条文献占据表格的一行,这也是能实现的,但本宏包就不去实现了,具体有需求的用户可以在github 的biblatex下搜索tabular或者在tex.stackexchange上搜索biblatex tabular,已经有具体的实现了,这里不再赘述。
+
\begin{example}{文献表水平缩进控制}{eg:biblist:hspace}
\begin{texlist}
% 著者-出版年制文献表缩进控制
@@ -2012,7 +2015,7 @@
各个数据域的录入应符合bib文件规范。需要注意:
-\bc{1. 有时直接从网络获取的参考文献信息中可能带有一些特殊字符比如\%,\&等,这些字符在 tex 中通常需要做转义处理,本样式中对像title,journal等常见域中出现的特殊字符已经做了转义,但是一些不常见的域比如 abstract 等没有考虑,所以用户需要手动处理,例如把\%改为\textbackslash \%,否则可能导致出错}
+\bc{1. 有时直接从网络获取的参考文献信息中可能带有一些特殊字符比如\%,\&等,这些字符在 tex 中通常需要做转义处理,本样式中对像title,journal,abstract,howpublished等常见域中出现的特殊字符已经做了转义,但也存在一些域没有考虑,所以当出现错误时,用户需要手动处理,例如把\%改为\textbackslash \%。}
\bc{2. 由于目前biber使用\href{https://github.com/ambs/Text-BibTeX/tree/master/btparse}
{btparse}
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx at version}
\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -213,6 +213,22 @@
% 设置宏包选项
%=====================================================================
%
+ % 增加一个控制是否调整日期输出位置的选项mergedate
+ % 为兼容性考虑,但实际不产生作用了,因为如果要使用ay样式可以直接从bibstyle进入
+ % 因为使用string所以只适用于biblatex3.3以上版本
+ % 20210415,v1.0y,hzz
+ \DeclareBibliographyOption[string]{mergedate}[none]{%
+ \ifcsdef{bbx at opt@mergedate@#1}
+ {\csuse{bbx at opt@mergedate@#1}}
+ {}}
+ \ExecuteBibliographyOptions{mergedate}
+
+ \def\bbx at opt@mergedate at none{}%none就是正常的顺序编码样式
+ \def\bbx at opt@mergedate at true{}%none就是正常的顺序编码样式
+ \def\bbx at opt@mergedate at false{}%none就是正常的顺序编码样式
+
+
+ %
% 增加一个控制是否输出恢复传统crossref作用的选项
% 20210216,v1.0w,hzz
\newtoggle{bbx:citexref}
@@ -750,6 +766,7 @@
\ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{}
\ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{}
\ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{\setaligngbstyleay}{}
}
}
{% 针对biblatex<3.3版本的选项设置
@@ -793,6 +810,7 @@
\ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{}
\ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{}
\ifstrequal{#1}{gb7714-2015}{}{}
+ \ifstrequal{#1}{gb7714-2015ay}{\setaligngbstyleay}{}
}
}
@@ -1356,6 +1374,24 @@
\step[fieldset=langid,fieldvalue={english}]
\step[fieldset=lansortorder,fieldvalue=\lankrorder]
}
+ \map[overwrite]{%bib中abstract和howpublished常出现特殊字符这里做一下预处理。
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
}
}
@@ -1505,7 +1541,7 @@
\map[overwrite]{
\step[fieldsource={location}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
- \map[overwrite]{
+ \map[overwrite]{%&符号处理
\step[fieldsource={institution}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
\map[overwrite]{
@@ -2111,6 +2147,23 @@
{\endgroup}
{\itemcmd}}
+%
+% 增加一个作者年制文献表格式的文献表输出环境。
+% 20210411,hzz,v1.0x
+\def\setaligngbstyleay{%
+\setlength{\bibhang}{1em}
+\setlength{\bibitemindent}{-\bibhang}
+\setlength{\bibitemsep}{4.5pt}
+\defbibenvironment{bibliography}
+ {\list
+ {}
+ {\setlength{\leftmargin}{\bibhang}%
+ \setlength{\itemindent}{\bibitemindent}%
+ \setlength{\itemsep}{\bibitemsep}%
+ \setlength{\parsep}{\bibparsep}}}
+ {\endlist}
+ {\item}
+}
%=====================================================================
% 设置单元或块等的标点
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015.cbx}[\versionofgbtstyle biblatex citation style]
%
@@ -38,6 +38,7 @@
%
% 修订使可用选项gblabelref来控制是否将标准标签中的作者加上超链接
% 20210121,v1.0w,hzz
+%
\iftoggle{iftlatest}%
{\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx at lasthash}
@@ -88,6 +89,25 @@
\setcounter{cbx at tempcnta}{0}%
\global\undef\cbx at lastprefix}
+%biblatex v3.15 增加了一堆标点命令如\multiciterangedelim
+%为方便用户定义,在新的版本中使用新的{cite:dump},尽管前面的定义也没有问题
+%前面的定义是适用于biblatex v2.8以后的版本的,从16年到20年都没动过
+%而且也适用于最新的版本,biblatex本身兼容性做的也还是不错的。
+\@ifpackagelater{biblatex}{2020/08/15}{%v3.15 2020-08-16
+ \renewbibmacro*{cite:dump}{%
+ \usebibmacro{cite:dump:inset}%
+ % dump labelnumber (+labelprefix)
+ \ifnumgreater{\value{cbx at tempcnta}}{0}
+ {\ifnumgreater{\value{cbx at tempcnta}}{0}%1改为0,可以将压缩起始3个编号改为2个编号
+ {\setunit{\multiciterangedelim}}
+ {\setunit{\multicitedelim}}%
+ \usebibmacro{cite:print:last:labelnumber}%
+ \global\undef\cbx at lastprefix}
+ {}%
+ \setcounter{cbx at tempcnta}{0}%
+ }%
+}{}
+
%
% 定义一个上标方括号wrapper
%
@@ -109,6 +129,14 @@
\mkbibbrackets{##1}}%
#1\endgroup}\kern\z@}
+\newrobustcmd{\mkbibsuperscriptusp}[1]{%
+ \unspace\allowhyphens\textsuperscript{%
+ \begingroup
+ \protected\long\def\mkbibsuperscriptusp##1{%
+ \blx at warning{Nested superscript}%
+ \mkbibbrackets{##1}}%
+ #1\endgroup}}
+
%
% 重定义cite命令
%
@@ -154,7 +182,7 @@
{}
{%[
\usebibmacro{cite:dump}]%
- \mkbibsuperscript{\printfield{postnote}}}
+ \mkbibsuperscriptusp{\printfield{postnote}}}
%
% 新定义pagescite命令,以满足标签带页码的国标要求
@@ -243,9 +271,11 @@
%
% 重定义citet,因为前面与\authornumcite同定义的命令无法正确处理多个bibtexkey同时给出的压缩情况
-% 20200721,v1.0v,hzz
+% 20200721,v1.0v,hzz
% 方法:利用textcite命令进行定义
% 基本利用textcite命令来写citet,仅利用bool{cbx:incitet}做判断,进而处理不同的上标和页码形式
+% 20210416,v1.0y,hzz:将namelabeldelim标点注释掉了,因为中文环境下不需要,
+% 若有需要可以用context sensitive的形式做定义
\newbool{cbx:incitet}
\global\booltrue{cbx:incitet}
@@ -263,7 +293,7 @@
\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}%
- \setunit*{\printdelim{namelabeldelim}}%
+ %\setunit*{\printdelim{namelabeldelim}}%
\mkbibsuperscript{\printtext{\bibopenbracket}\global\booltrue{cbx:parens}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}%
@@ -378,7 +408,7 @@
\newbibmacro*{citec:dump}{%
\ifnumgreater{\value{cbx at tempcnta}}{0}
- {\ifnumgreater{\value{cbx at tempcnta}}{1}
+ {\ifnumgreater{\value{cbx at tempcnta}}{0}%从1改成0就是从3个开始压缩改成2个开始压缩
{\bibrangedash}
{\multicitedelim}%
\bibhyperref[\cbx at lastkey]{%
@@ -409,7 +439,8 @@
{}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
- \setunit{\multicitedelim}}}
+ \setunit{\multicitedelim}%
+ }}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
\setunit{\multicitedelim}%
@@ -420,7 +451,8 @@
{\ifboolexpr{ test {\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}}
or not test {\iffieldundef{postnote}}}
{\usebibmacro{citec:dump}%
- \usebibmacro{postnote}}
+ \printfield{postnote}%
+ }
{}}
\DeclareMultiCiteCommand{\citecs}[\mkbibsuperscript]{\citec}{}
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -10,7 +10,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx at version}
\ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -591,6 +591,17 @@
%为姓名格式选择增加的计数器
\newcounter{gbnamefmtcase}
\def\thegbnamefmtcase{\the\c at gbnamefmtcase}
+ %为数字标签格式选择增加的计数器/命令
+ \newcommand{\mkgbnumlabel}[1]{\mkbibbrackets{#1}}
+ \def\gbbiblabelopt at bracket{\renewcommand{\mkgbnumlabel}[1]{\mkbibbrackets{##1}}}
+ \def\gbbiblabelopt at parens{\renewcommand{\mkgbnumlabel}[1]{\mkbibparens{##1}}}
+ \def\gbbiblabelopt at dot{\renewcommand{\mkgbnumlabel}[1]{##1\adddot}}
+ \def\gbbiblabelopt at plain{\renewcommand{\mkgbnumlabel}[1]{##1}}
+ \def\gbbiblabelopt at box{\renewcommand{\mkgbnumlabel}[1]{\framebox{##1}}}
+ \def\gbbiblabelopt at circle{\renewcommand{\mkgbnumlabel}[1]{\textcircled{##1}}}
+ %为文献表中数字标签对齐方式选择增加的计数器/命令
+ \newcounter{gbalignlabel}
+ \def\thegbalignlabel{\the\c at gbalignlabel}
%为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令
\newcounter{gbcitelocalcase}
\newcounter{gbbiblocalcase}
@@ -666,7 +677,10 @@
% 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑
% v1.0l,20180623,hzz
%
- \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{}
+ \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{%
+ \csuse{gbbiblabelopt@#1}
+ }
+ \ExecuteBibliographyOptions{gbbiblabel}
%
% 增加姓名大小写格式处理选项
@@ -686,7 +700,13 @@
% 增加标签对齐选项
%
%因为在作者年制中,不需要使用,这里也增加,为了与顺序编码制的兼容性考虑。
- \DeclareBibliographyOption[string]{gbalign}[right]{}%
+ \DeclareBibliographyOption[string]{gbalign}[gb7714-2015ay]{
+ \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}\setaligngbnumeric}{}
+ \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}\setaligngbnumeric}{}
+ \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}\setaligngbnumeric}{}
+ \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{}{}%默认就是ay样式的
+ }%
@@ -704,7 +724,10 @@
% 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑
% v1.0l,20180623,hzz
%
- \DeclareBibliographyOption{gbbiblabel}[bracket]{}
+ \DeclareBibliographyOption{gbbiblabel}[bracket]{%
+ \csuse{gbbiblabelopt@#1}
+ }
+ \ExecuteBibliographyOptions{gbbiblabel}
%
% 增加姓名大小写格式处理选项
@@ -724,7 +747,13 @@
% 增加标签对齐选项
%
%因为在作者年制中,不需要使用,这里也增加,为了与顺序年制的兼容性考虑。
- \DeclareBibliographyOption{gbalign}[right]{}%
+ \DeclareBibliographyOption{gbalign}[gb7714-2015ay]{%
+ \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}\setaligngbnumeric}{}
+ \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}\setaligngbnumeric}{}
+ \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}\setaligngbnumeric}{}
+ \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{}{}
+ }%
}
@@ -1452,6 +1481,24 @@
% address,location,institution,organization}]{
% \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
% }
+ \map[overwrite]{%bib中abstract和howpublished常出现特殊字符这里做一下预处理。
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
}
}
@@ -1849,8 +1896,8 @@
%
% 增加一个\bibitemindent尺寸用于控制list环境的itemindent
% v1.0l,20180615,hzz
+\newlength{\bibitemindent}
\setlength{\bibhang}{1em}
-\newlength{\bibitemindent}
\setlength{\bibitemindent}{-\bibhang}
\setlength{\bibitemsep}{4.5pt}
\defbibenvironment{bibliography}
@@ -1863,11 +1910,13 @@
{\endlist}
{\item}
%
-% 增加一个numerical环境用于自动显示数字
-% v1.0w,20210311,hzz
-\newcounter{refnumerical}
+% 增加一个numeric环境用于自动显示数字
+% v1.0w,20210311,hzz
+% v1.0x,20210411,hzz,整合到gbalign选项中。
+\newcounter{refnumeric}
\newlength{\biblabelextend}
-\defbibenvironment{numerical}
+\def\setaligngbnumeric{%
+\defbibenvironment{bibliography}
{\setlength{\bibhang}{\biblabelsep}%
\setlength{\labelnumberwidth}{2em}%
\setlength{\bibitemindent}{0pt}%
@@ -1874,8 +1923,8 @@
\setlength{\biblabelextend}{0pt}%
\setlength{\biblabelextend}{0pt}%
\list
- {\printtext[labelnumberwidth]{[\arabic{refnumerical}]}}
- {\usecounter{refnumerical}%
+ {\printtext[labelnumberwidth]{\arabic{refnumeric}}}
+ {\usecounter{refnumeric}%
\addtolength{\labelnumberwidth}{\biblabelextend}%
\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\labelsep}{\biblabelsep}%
@@ -1884,12 +1933,93 @@
\setlength{\itemindent}{\bibitemindent}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
+ \renewcommand*{\makelabel}[1]{\hss####1}}
+ {\endlist}
+ {\item}
+}
+
+\defbibenvironment{numerical}%作者年制中数字标签的文献表环境
+ {\setlength{\bibhang}{\biblabelsep}%
+ \setlength{\labelnumberwidth}{2em}%
+ \setlength{\bibitemindent}{0pt}%
+ \setlength{\biblabelextend}{0pt}%
+ \setlength{\biblabelextend}{0pt}%
+ \list
+ {\printtext[labelnumberwidth]{\arabic{refnumeric}}}
+ {\usecounter{refnumeric}%
+ \addtolength{\labelnumberwidth}{\biblabelextend}%
+ \setlength{\labelwidth}{\labelnumberwidth}%
+ \setlength{\labelsep}{\biblabelsep}%
+ \setlength{\leftmargin}{\bibhang}%
+ \addtolength{\leftmargin}{\labelnumberwidth}%
+ \setlength{\itemindent}{\bibitemindent}%
+ \setlength{\itemsep}{\bibitemsep}%
+ \setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
+\DeclareFieldFormat{labelnumberwidth}{%
+\ifcase\value{gbalignlabel}%右对齐,整个标签为右对齐
+ \mkgbnumlabel{#1}%
+\or%左对齐,整个标签为左对齐
+ \mkgbnumlabel{#1}\hfill%
+\or%中间对齐,比如:序号数字居于[]中间
+ \hfil\mkgbnumlabel{\hfill#1\hfill}\hfil%
+\fi}
+%
+% 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。
+\def\setaligngbstyle{%
+\def\blx at bibitem##1{%
+ \blx at ifdata{##1}
+ {\begingroup
+ \blx at getdata{##1}%
+ \blx at bibcheck
+ \iftoggle{blx at skipentry}{}{%
+ \blx at setdefaultrefcontext{##1}%
+ \global\let\blx at noitem\@empty
+ \blx at setoptions@type\abx at field@entrytype
+ \blx at setoptions@entry
+ \blx at thelabelnumber
+ \addtocounter{instcount}\@ne
+ \blx at initsep
+ \blx at namesep
+ \csuse{blx at item@\blx at theenv}\relax
+% \blx at initsep %移动到上面去,恢复bibnamesep等的作用机制
+% \blx at namesep
+ \csuse{blx at hook@bibitem}%
+ \blx at execute
+ \blx at initunit
+ \blx at anchor
+ \blx at beglangbib
+ \bibsentence
+ \blx at pagetracker
+ \blx at driver\abx at field@entrytype
+ \blx at postpunct
+ \blx at endlangbib}%
+ \par\endgroup}%这里增加了一个\par
+ {}}
+\newlength{\lengthid}
+\newlength{\lengthlw}
+\newcommand{\itemcmd}{%
+\settowidth{\lengthid}{\mkgbnumlabel{\arabic{refnumeric}}}
+\addtolength{\lengthid}{\biblabelsep}
+\setlength{\lengthlw}{\textwidth}
+\addtolength{\lengthlw}{-\lengthid}
+\addvspace{\bibitemsep}%恢复\bibitemsep的作用
+%\parshape 2 0em \textwidth \lengthid \lengthlw
+\hangindent\lengthid
+\mkgbnumlabel{\arabic{refnumeric}}%
+\hspace{\biblabelsep}}
+%
+% 简单的段落环境
+\defbibenvironment{bibliography}
+{\begingroup\setcounter{refnumeric}{0}\setlength{\parindent}{0em}}
+{\endgroup}
+{\stepcounter{refnumeric}\itemcmd}}
+
%=====================================================================
% 设置单元或块等的标点
%=====================================================================
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015ay.cbx}[\versionofgbtstyle biblatex citation style]
%
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx at version}
\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -1159,14 +1159,16 @@
\step[fieldset=keywords, fieldvalue={,}, append]
\step[fieldset=keywords, origfieldval, append]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
}
\map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
- address,location,institution,organization}]{
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
}
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015ms.cbx}[\versionofgbtstyle biblatex citation style]
%
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx at version}
\ProvidesFile{gb7714-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -1253,14 +1253,16 @@
\step[fieldset=keywords, fieldvalue={,}, append]
\step[fieldset=keywords, origfieldval, append]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
}
\map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
- address,location,institution,organization}]{
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
}
Modified: trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.cbx 2021-05-06 20:22:28 UTC (rev 59100)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.cbx 2021-05-06 20:22:49 UTC (rev 59101)
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015mx.cbx}[\versionofgbtstyle biblatex citation style]
%
More information about the tex-live-commits
mailing list.