diff --git a/README.md b/README.md index 3ec6dd1..b7891b6 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,9 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2 * [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年一出来就直接用上) +* [SJTUThesis(上海交通大学学位论文模板)](https://github.com/sjtug/SJTUThesis) (母校的论文模板,不得不说缘分真的很神奇,16年一出来就用上) * [sustechthesis(Southern University of Science and Technology Thesis Template LaTeX Template)](https://github.com/Iydon/sustechthesis) +* [SwufeTeX(西南财经大学学位论文LaTeX模板)](https://github.com/OopsYao/swufethesis) * [Thesis-Template-for-XJTU (西安交大毕业设计模板)](https://github.com/DXie123/Thesis-Template-for-XJTU) * [ThuThesis(LaTeX Thesis Template for Tsinghua University )](https://github.com/tuna/thuthesis) * [TongjiThesis(同济大学硕博士论文LaTeX模板)](https://github.com/marquistj13/TongjiThesis) @@ -599,7 +600,7 @@ gbyntd 以语言、年份、作者、标题、降序排列 \hspace{\biblabelsep}} ``` -示例见:https://github.com/hushidong/biblatex-gb7714-2015/issues/62 +示例见:[issue](https://github.com/hushidong/biblatex-gb7714-2015/issues/62) @@ -706,9 +707,25 @@ biblatex-7714-2015的顺序编码制样式特别设计了这样的环境,以 \setcounter{biburlnumpenalty}{100}%大于0允许在数字后面断行 \setcounter{biburlucpenalty}{100}%大于0允许在大写字母后面断行 \setcounter{biburllcpenalty}{100}%大于0允许在小写字母后面断行 +``` + +* 中英文混排,有些英文断行不佳,导致行溢出,怎么解决? + + +biblatex的参考文献表的换行是由tex的断行机制决定的,处理行(盒子)溢出就要用tex的方式处理: +``` + { + %\hyphenation{Proce-edings} + \hyphenpenalty=5000 %断词阈值, 值越大越不容易出现断词 + \tolerance=500 %丑度, 10000为最大无溢出盒子, 参考the texbook 第6章 + \hbadness=100 %如果丑度超过hbadness这一阀值, 那么就会发出警告 + \printbibliography[heading=subbibintoc,title=【参考文献】] +} ``` +当然如果不想这么设置,可以手动的修改参考文献条目的内容,在需要换行的内容前加上-符号。 +见:https://github.com/hushidong/biblatex-gb7714-2015/issues/89 ​ * 当参考文献没有作者时,希望用佚名或Anon代替作者时,请问该怎么处理? @@ -824,6 +841,20 @@ biblatex-gb7714-2015设计了两种多语言对照参考文献的实现方式, 使用命令`\yearcite{bibtexkey}`给出仅包含年份的标签。 +* 中文文档中,引用标注标签在一个句子中时,标签的`]`后面与中文字符之间存在一个空格,怎么消除? + + +在引用命令后面加一个没有长度的空白即可,比如: +``` +中文字符\cite{sally_history_1985}\mbox{}中文字符 + +中文字符\cite{sally_history_1985}\hbox{}中文字符 + +中文字符\cite{sally_history_1985}\makebox{}中文字符 + +中文字符\cite{sally_history_1985}\hspace{0pt}中文字符 +``` + * 在使用作者年制时,我希望文献表是按作者年份标题排序,而正文某处一个cite命令引用多个参考文献,且这些文献的标签是按年份作者标题排序,该怎么操作? diff --git a/biblatex-gb7714-2015.pdf b/biblatex-gb7714-2015.pdf index e18fbd6..a60f9e6 100644 Binary files a/biblatex-gb7714-2015.pdf and b/biblatex-gb7714-2015.pdf differ diff --git a/example/test-space-after-citelabel-inCJKline.tex b/example/test-space-after-citelabel-inCJKline.tex new file mode 100644 index 0000000..2250f43 --- /dev/null +++ b/example/test-space-after-citelabel-inCJKline.tex @@ -0,0 +1,41 @@ +\documentclass{article} +\usepackage[backend=biber,style=gb7714-2015]{biblatex}%citexref=true +\usepackage{ctex} + +%\apptocmd{\cite}{\makebox{\rule{1em}{1pt}}}{}{} + + +\begin{filecontents}{\jobname.bib} +@book{sally_history_1985, +location = {Monterey, California}, +title = {History of Algebraic Geometry}, +isbn = {978-0-534-03723-9}, +series = {Wadsworth Mathematics Series}, +pagetotal = {xii+186}, +publisher = {Wadsworth International Group, Belmont, {CA}}, +author = {Dieudonné, Jean}, +translator = {Sally, Judith D.}, +date = {1985}, +mrnumber = {780183}, +} +\end{filecontents} +\addbibresource{\jobname.bib} + +\begin{document} +abcd\cite{sally_history_1985}abcd + +中文字符\cite{sally_history_1985}中文字符 + +中文字符\cite{sally_history_1985}a\rule{1em}{1pt}中文字符 + +中文字符\cite{sally_history_1985}\mbox{}中文字符 + +中文字符\cite{sally_history_1985}\hbox{}中文字符 + +中文字符\cite{sally_history_1985}\makebox{}中文字符% + +中文字符\cite{sally_history_1985}\hspace{0pt}中文字符% + + +\printbibliography +\end{document} \ No newline at end of file diff --git a/example/test-translator-in-other-lan.tex b/example/test-translator-in-other-lan.tex new file mode 100644 index 0000000..175f06c --- /dev/null +++ b/example/test-translator-in-other-lan.tex @@ -0,0 +1,38 @@ +%-- +%测试译作中的译者的中英文的差异化处理 +% + +\documentclass{article} +\usepackage[backend=biber,style=gb7714-2015]{biblatex}%citexref=true +\usepackage{ctex} + +\begin{filecontents}{\jobname.bib} +@Book{GPS1988--, + Title = {外国出版史}, + Author = {{昂温, G} and {昂温, P S}}, + Publisher = {中国书籍出版社}, + Translator = {陈生诤}, + Year = {1988}, + Location = {北京} +} + + +@book{sally_history_1985, +location = {Monterey, California}, +title = {History of Algebraic Geometry}, +isbn = {978-0-534-03723-9}, +series = {Wadsworth Mathematics Series}, +pagetotal = {xii+186}, +publisher = {Wadsworth International Group, Belmont, {CA}}, +author = {Dieudonné, Jean}, +translator = {Sally, Judith D.}, +date = {1985}, +mrnumber = {780183}, +} +\end{filecontents} +\addbibresource{\jobname.bib} + +\begin{document} +\nocite{*} +\printbibliography +\end{document} \ No newline at end of file diff --git a/example/updatehistory.tex b/example/updatehistory.tex index 3c5ad96..c8db77f 100644 --- a/example/updatehistory.tex +++ b/example/updatehistory.tex @@ -19,6 +19,17 @@ add a value for option gbnamefmt, the result of setting this value is like:Liu Qiangda. + +\item 完善译著中除中文外其它语言的译者的输出。(20210401) + +improve the translator output of languages other than Chinese for tranlations. + +\item 去除中文行内上标标注后面因xeCJK自动添加的空白。(20210401) + +remove the space after the superscript citation in chinese line automatically added by xeCJK. + + + \end{enumerate} diff --git a/gb7714-2015.bbx b/gb7714-2015.bbx index 15d4f8c..f68ff7e 100644 --- a/gb7714-2015.bbx +++ b/gb7714-2015.bbx @@ -871,6 +871,7 @@ \NewBibliographyString{phdthesiscn} \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} + \NewBibliographyString{bytranslatorcn} @@ -884,7 +885,7 @@ \DefineBibliographyStrings{english}{ bibliography = {\str@bibliography}, references = {\str@references}, - bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%and本地化字符串的中文对应词 andincitecn = {\str@andcn},%将标注中的分开,便于与文献表中的区分 @@ -2261,46 +2262,71 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % % 修改译者位置格式 +% v1.0w,20210401,hzz,增加对英文等其它语言译者的处理 % % 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 \renewbibmacro*{bytranslator+others}{\bibauthorfont% \ifnameundef{translator} {} - {%\usebibmacro{bytranslator+othersstrg} + {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}} %\setunit{\addspace}% \printnames[bytranslator]{translator}% \clearname{translator}% %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + \iffieldequalstr{usere}{chinese}{\usebibmacro{bytranslator+othersstrg}}{}%“译”的位置换到下面来,即放到译者后面。 %\setunit{\addspace}% \newunit}% \usebibmacro{withothers}} +\renewbibmacro*{bytranslator+othersstrg}{% + \def\abx@tempa{bytranslator}% + \ifnamesequal{translator}{commentator} + {\appto\abx@tempa{co}% + \clearname{commentator}} + {\ifnamesequal{translator}{annotator} + {\appto\abx@tempa{an}% + \clearname{annotator}} + {}}% + \ifnamesequal{translator}{introduction} + {\appto\abx@tempa{in}% + \clearname{introduction}} + {\ifnamesequal{translator}{foreword} + {\appto\abx@tempa{fo}% + \clearname{foreword}} + {\ifnamesequal{translator}{afterword} + {\appto\abx@tempa{af}% + \clearname{afterword}} + {}}}% +\iffieldequalstr{usere}{chinese}{\bibstring{bytranslatorcn}} + {\bibstring{\abx@tempa}}} + % % 修改作者数量超过限定值,做省略时的处理格式 % v1.0,20160701,hzz % v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim -% +% v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理 % 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 +% \printnames由start-stop控制项数,默认是1和maxnames/minnames \renewbibmacro*{name:andothers}{\bibauthorfont% \ifboolexpr{ test {\ifnumequal{\value{listcount}}{\value{liststop}}} and test \ifmorenames - }{\ifnumgreater{\value{liststop}}{1}% - {\finalandcomma}% + }{\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {\finalandcomma}%目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 {}% \printdelim{andothersdelim}\printdelim{strandothersdelim}% }{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: %袁训来, 陈哲, 肖书海, 等. %胡泳, 范海燕, 译. %潘惠霞, 魏婧, 杨艳, 等译. -\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理 }} + % 修改省略作者后的本地化字符串,比如et al. % v1.0o,20190103,hzz % diff --git a/gb7714-2015.cbx b/gb7714-2015.cbx index b97d2ce..2322e74 100644 --- a/gb7714-2015.cbx +++ b/gb7714-2015.cbx @@ -98,19 +98,33 @@ % 修改postnote的输出格式 \DeclareFieldFormat{postnote}{#1} + +%修改\mkbibsuperscript宏在最后加上一个空白使得xeCJK不会自动在引用标签后面加上中英文之间的空白 +%hzz,v1.0w,2021-0401 +\renewrobustcmd{\mkbibsuperscript}[1]{% + \unspace\allowhyphens\textsuperscript{% + \begingroup + \protected\long\def\mkbibsuperscript##1{% + \blx@warning{Nested superscript}% + \mkbibbrackets{##1}}% + #1\endgroup}\kern\z@} + % % 重定义cite命令 % % 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} % v1.0p版后将cite的处理方式修改为类似pagescite,而不再使用biblatex的标准方式 -\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 - {[\usebibmacro{cite:init}% +\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 \textsuperscript + {[\usebibmacro{cite:init}%] \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} - {\usebibmacro{cite:dump}]% - \printfield{postnote}} + {%[ + \usebibmacro{cite:dump}]% + \printfield{postnote}}%\kern\p@ \kern\z@ + +%\renewcommand{\cite}[1]{\textsuperscript{[\supercite{#1}]}\kern\z@} % v1.0p 以前用的方式 %\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号 % {\usebibmacro{cite:init}% @@ -333,7 +347,7 @@ \ifboolexpr{ ( test {\iffieldundef{labelprefix}} and test {\ifundef\cbx@lastprefix} ) or - test {\iffieldequals{labelprefix}{\cbx@lastprefix}} + test {\iffieldequals{labelprefix}{\cbx@lastprefix}}% } {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} {\savefield{entrykey}{\cbx@lastkey}% diff --git a/gb7714-2015ay.bbx b/gb7714-2015ay.bbx index 0896d51..4ad3c78 100644 --- a/gb7714-2015ay.bbx +++ b/gb7714-2015ay.bbx @@ -813,6 +813,7 @@ \NewBibliographyString{phdthesiscn} \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} + \NewBibliographyString{bytranslatorcn} % % 修改一些当地化字符串 @@ -823,7 +824,7 @@ \DefineBibliographyStrings{english}{ bibliography = {\str@bibliography}, references = {\str@references}, - bytranslator= {\str@bytranslator\adddot}, %将trans. by 改成 译 + bytranslatorcn= {\str@bytranslator\adddot}, %将trans. by 改成 译 and = {\addcomma},%将第2和3人名见的and符号改成 逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%\str@andcn\ and本地化字符串的中文对应词 andincitecn = {\str@andcn},%将标注中的分开,便于与文献表中的区分 @@ -2038,29 +2039,50 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % % 修改译者位置格式 +% v1.0w,20210401,hzz,增加对英文等其它语言译者的处理 % % 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 \renewbibmacro*{bytranslator+others}{\bibauthorfont% \ifnameundef{translator} {} - {%\usebibmacro{bytranslator+othersstrg} + {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}} %\setunit{\addspace}% \printnames[bytranslator]{translator}% \clearname{translator}% %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + \iffieldequalstr{usere}{chinese}{\usebibmacro{bytranslator+othersstrg}}{}%“译”的位置换到下面来,即放到译者后面。 %\setunit{\addspace}% \newunit}% \usebibmacro{withothers}} - +\renewbibmacro*{bytranslator+othersstrg}{% + \def\abx@tempa{bytranslator}% + \ifnamesequal{translator}{commentator} + {\appto\abx@tempa{co}% + \clearname{commentator}} + {\ifnamesequal{translator}{annotator} + {\appto\abx@tempa{an}% + \clearname{annotator}} + {}}% + \ifnamesequal{translator}{introduction} + {\appto\abx@tempa{in}% + \clearname{introduction}} + {\ifnamesequal{translator}{foreword} + {\appto\abx@tempa{fo}% + \clearname{foreword}} + {\ifnamesequal{translator}{afterword} + {\appto\abx@tempa{af}% + \clearname{afterword}} + {}}}% +\iffieldequalstr{usere}{chinese}{\bibstring{bytranslatorcn}} + {\bibstring{\abx@tempa}}} % % 修改作者数量超过限定值,做省略时的处理格式 % v1.0,20160701,hzz % v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim -% +% v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理 % 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 % \printnames由start-stop控制项数,默认是1和maxnames/minnames \renewbibmacro*{name:andothers}{\bibauthorfont% @@ -2076,7 +2098,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 %袁训来, 陈哲, 肖书海, 等. %胡泳, 范海燕, 译. %潘惠霞, 魏婧, 杨艳, 等译. -\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理 }} % 修改省略作者后的本地化字符串,比如et al. diff --git a/gb7714-2015ms.bbx b/gb7714-2015ms.bbx index f37da1e..3e48e7f 100644 --- a/gb7714-2015ms.bbx +++ b/gb7714-2015ms.bbx @@ -598,6 +598,7 @@ \NewBibliographyString{phdthesiscn} \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} + \NewBibliographyString{bytranslatorcn} % @@ -609,7 +610,7 @@ \DefineBibliographyStrings{english}{ bibliography = {\str@bibliography}, references = {\str@references}, - bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译 + bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译 and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%and本地化字符串的中文对应词 andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 @@ -1774,42 +1775,66 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}% }% % % 修改译者位置格式 +% v1.0w,20210401,hzz,增加对英文等其它语言译者的处理 % % 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 -\renewbibmacro*{bytranslator+others}{% - \ifnameundef{translator}% - {}% - {%\usebibmacro{bytranslator+othersstrg} +\renewbibmacro*{bytranslator+others}{\bibauthorfont% + \ifnameundef{translator} + {} + {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}} %\setunit{\addspace}% \printnames[bytranslator]{translator}% \clearname{translator}% %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + \iffieldequalstr{usere}{chinese}{\usebibmacro{bytranslator+othersstrg}}{}%“译”的位置换到下面来,即放到译者后面。 %\setunit{\addspace}% \newunit}% - \usebibmacro{withothers}}% + \usebibmacro{withothers}} +% +\renewbibmacro*{bytranslator+othersstrg}{% + \def\abx@tempa{bytranslator}% + \ifnamesequal{translator}{commentator} + {\appto\abx@tempa{co}% + \clearname{commentator}} + {\ifnamesequal{translator}{annotator} + {\appto\abx@tempa{an}% + \clearname{annotator}} + {}}% + \ifnamesequal{translator}{introduction} + {\appto\abx@tempa{in}% + \clearname{introduction}} + {\ifnamesequal{translator}{foreword} + {\appto\abx@tempa{fo}% + \clearname{foreword}} + {\ifnamesequal{translator}{afterword} + {\appto\abx@tempa{af}% + \clearname{afterword}} + {}}}% +\iffieldequalstr{usere}{chinese}{\bibstring{bytranslatorcn}} + {\bibstring{\abx@tempa}}} % % 修改作者数量超过限定值,做省略时的处理格式 % v1.0,20160701,hzz % v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim -% +% v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理 % 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 -\renewbibmacro*{name:andothers}{% - \ifboolexpr{% - test {\ifnumequal{\value{listcount}}{\value{liststop}}}% +% \printnames由start-stop控制项数,默认是1和maxnames/minnames +\renewbibmacro*{name:andothers}{\bibauthorfont% + \ifboolexpr{ + test {\ifnumequal{\value{listcount}}{\value{liststop}}} and test \ifmorenames - }{\ifnumgreater{\value{liststop}}{1}% - {\finalandcomma}% + }{\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {\finalandcomma}%目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 {}% \printdelim{andothersdelim}\printdelim{strandothersdelim}% }{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: %袁训来, 陈哲, 肖书海, 等. %胡泳, 范海燕, 译. %潘惠霞, 魏婧, 杨艳, 等译. -\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 -}}% +\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理 +}} % % 修改省略作者后的本地化字符串,比如et al. % v1.0o,20190103,hzz diff --git a/gb7714-2015ms.cbx b/gb7714-2015ms.cbx index 7dfc4ca..8c8adaa 100644 --- a/gb7714-2015ms.cbx +++ b/gb7714-2015ms.cbx @@ -30,6 +30,16 @@ %textcite标注命令中的标点设置 %\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% +%修改\mkbibsuperscript宏在最后加上一个空白使得xeCJK不会自动在引用标签后面加上中英文之间的空白 +%hzz,v1.0w,2021-0401 +\renewrobustcmd{\mkbibsuperscript}[1]{% + \unspace\allowhyphens\textsuperscript{% + \begingroup + \protected\long\def\mkbibsuperscript##1{% + \blx@warning{Nested superscript}% + \mkbibbrackets{##1}}% + #1\endgroup}\kern\z@} + % % 定义一个上标方括号wrapper % diff --git a/gb7714-2015mx.bbx b/gb7714-2015mx.bbx index f384101..64cb331 100644 --- a/gb7714-2015mx.bbx +++ b/gb7714-2015mx.bbx @@ -646,6 +646,7 @@ \NewBibliographyString{phdthesiscn} \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} + \NewBibliographyString{bytranslatorcn} @@ -659,7 +660,7 @@ \DefineBibliographyStrings{english}{ bibliography = {\str@bibliography}, references = {\str@references}, - bytranslator= {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%and本地化字符串的中文对应词 andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 @@ -1732,31 +1733,53 @@ % % 修改译者位置格式 +% v1.0w,20210401,hzz,增加对英文等其它语言译者的处理 % % 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式 -\renewbibmacro*{bytranslator+others}{% +\renewbibmacro*{bytranslator+others}{\bibauthorfont% \ifnameundef{translator} {} - {%\usebibmacro{bytranslator+othersstrg} + {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}} %\setunit{\addspace}% \printnames[bytranslator]{translator}% \clearname{translator}% %从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理 %比如生成cotranslator等用于调用cotranslator所代表的当地化字符串 - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 + \iffieldequalstr{usere}{chinese}{\usebibmacro{bytranslator+othersstrg}}{}%“译”的位置换到下面来,即放到译者后面。 %\setunit{\addspace}% \newunit}% \usebibmacro{withothers}} +\renewbibmacro*{bytranslator+othersstrg}{% + \def\abx@tempa{bytranslator}% + \ifnamesequal{translator}{commentator} + {\appto\abx@tempa{co}% + \clearname{commentator}} + {\ifnamesequal{translator}{annotator} + {\appto\abx@tempa{an}% + \clearname{annotator}} + {}}% + \ifnamesequal{translator}{introduction} + {\appto\abx@tempa{in}% + \clearname{introduction}} + {\ifnamesequal{translator}{foreword} + {\appto\abx@tempa{fo}% + \clearname{foreword}} + {\ifnamesequal{translator}{afterword} + {\appto\abx@tempa{af}% + \clearname{afterword}} + {}}}% +\iffieldequalstr{usere}{chinese}{\bibstring{bytranslatorcn}} + {\bibstring{\abx@tempa}}} % % 修改作者数量超过限定值,做省略时的处理格式 % v1.0,20160701,hzz % v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim -% +% v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理 % 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 % \printnames由start-stop控制项数,默认是1和maxnames/minnames -\renewbibmacro*{name:andothers}{% +\renewbibmacro*{name:andothers}{\bibauthorfont% \ifboolexpr{ test {\ifnumequal{\value{listcount}}{\value{liststop}}} and @@ -1769,7 +1792,7 @@ %袁训来, 陈哲, 肖书海, 等. %胡泳, 范海燕, 译. %潘惠霞, 魏婧, 杨艳, 等译. -\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理 +\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理 }} diff --git a/gb7714-2015mx.cbx b/gb7714-2015mx.cbx index b16bf59..38ecd40 100644 --- a/gb7714-2015mx.cbx +++ b/gb7714-2015mx.cbx @@ -31,7 +31,15 @@ sortcites, } - +%修改\mkbibsuperscript宏在最后加上一个空白使得xeCJK不会自动在引用标签后面加上中英文之间的空白 +%hzz,v1.0w,2021-0401 +\renewrobustcmd{\mkbibsuperscript}[1]{% + \unspace\allowhyphens\textsuperscript{% + \begingroup + \protected\long\def\mkbibsuperscript##1{% + \blx@warning{Nested superscript}% + \mkbibbrackets{##1}}% + #1\endgroup}\kern\z@} % % 定义一个上标方括号wrapper diff --git a/tool/gbT7714-2015.log b/tool/gbT7714-2015.log index a587285..f680d82 100644 --- a/tool/gbT7714-2015.log +++ b/tool/gbT7714-2015.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:05 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/tool/gbT7714-2015eg.log b/tool/gbT7714-2015eg.log index 62b022f..effe647 100644 --- a/tool/gbT7714-2015eg.log +++ b/tool/gbT7714-2015eg.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:05 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/tool/gbT7714-2015fmt.log b/tool/gbT7714-2015fmt.log index ec62a0c..e956f15 100644 --- a/tool/gbT7714-2015fmt.log +++ b/tool/gbT7714-2015fmt.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:06 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/tool/gbT7714-2015lan.log b/tool/gbT7714-2015lan.log index 0692197..1d66f81 100644 --- a/tool/gbT7714-2015lan.log +++ b/tool/gbT7714-2015lan.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:06 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/tool/gbT7714-2015ms.log b/tool/gbT7714-2015ms.log index 59b94c2..90750d9 100644 --- a/tool/gbT7714-2015ms.log +++ b/tool/gbT7714-2015ms.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:05 entering extended mode restricted \write18 enabled. %&-line parsing enabled. diff --git a/tool/gbT7714-2015thesis.log b/tool/gbT7714-2015thesis.log index bca660e..e79827d 100644 --- a/tool/gbT7714-2015thesis.log +++ b/tool/gbT7714-2015thesis.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 19 JAN 2021 18:13 +This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex 2020.9.17) 1 APR 2021 16:06 entering extended mode restricted \write18 enabled. %&-line parsing enabled.