利用LaTeX写学位论文使用biblatex生成盲评的成果列表

利用LaTeX写学位论文使用biblatex生成盲评的成果列表

引言

在之前的文章《latex参考文献中修改指定作者的格式来突出显示》,我们介绍了在LaTeX中利用参考文献的方式生成学位论文的成果列表,而且将其中的作者突出显示。
但这种方式是用于明评的,若是盲评版本,则形式可能存在不同。盲评的版本通常是两种方式:一种方式是直接不显示成果,另一种方式则是部分显示成果但隐去学位论文作者。
这第二种方式是本文要讨论的,也就是如何利用原先的bib文件,以生成参考文献的方式,来获得隐去学位论文作者但显示其他信息的成果列表。

因为盲评成果列表的特殊性,所以我们可以直接修改bib文件来达成所需目的的修改。比如将如下条目:

@article{ref-1-1-Yang,
author    = {Yang, Y and Ren, T L and Zhang, L T and others},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1=thesisauthor},
}

修改为:

@article{ref-1-1-Yang,
author    = {{First Author, XXX}},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1=thesisauthor},
}

如此,在利用biblatex生成参考文献的方式得到得了成果列表中,该论文的作者信息被显示为“First Author, XXX”。

然而,这种修改bib文件的方式并不是我们最期待的,因为每次切换学位论文的明、盲版本都要修改或更换bib文件并不方便。
我们希望只维护一个bib文件来达成生成明、盲版本成果列表的目的。

考虑到在生成明评版本的时候,bib文件中添加了关于成果的作者注解信息,以利用其来突出显示学位论文作者。
实际上盲评版本,也可以采用类似的方式得到,只是需要对注解信息做一定的修改或者不做任何的修改而仅修改参考文献样式。
下面我们对其进行介绍。

数据注解的两种逻辑

biblatex中的数据注解,实际上有两种逻辑,一是利用数据注解提供条目的元信息来为格式化提供标记,二是利用数据注解为条目提供直接可以取用的文本信息,只要注解内容在给出时以成对的双引号包围时。

前面的bib例子中,
AUTHOR+an={1=thesisauthor}, 是一种提供元信息的注解方式,为author中的第一个作者提供一个thesisauthor标记。

但如果该条目修改为:

@article{ref-1-1-Yang,
author    = {Yang, Y and Ren, T L and Zhang, L T and others},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1="第一作者"},
}

则是一种提供可用文本信息的注解方式,即为author中的第一个作者提供了一个可用的字符串"第一作者"。

由于提供了特定的可用文本,因此在代码实现上,采用第二种方式可能会简单一些,但在bib文件的普适性等方面则可能略差一些。

用户可以根据自身情况选择使用,下面分别介绍两种不同的实现方式。

基于提供“可用文本”数据注解的实现

基于提供“可用文本”数据注解的实现,在BIThesis中实现了一种利用在part层标记名为myself的part,并提供对应的可用文本的方式,可以得到论文作者信息替换为“第一作者”这样的信息,而其他作者则省略,展现了一种很好的思路。

这里的例子,则还要更简单一些,仅在item层做注解,从而实现盲评的成果列表。

具体为(注意代码中为了去除多余的标点和空格重定义的multinamedelim):

\documentclass{ctexart}
\usepackage{xcolor}
\usepackage[style=gb7714-2015,gbannote=true]{biblatex}%,gbnamefmt=pinyin
\usepackage{fmtcount}

\begin{filecontents}[force]{\jobname.bib}
@article{ref-1-1-Yang,
author    = {Yang, Y and Ren, T L and Zhang, L T and others},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1="First Author"},
}

@article{ref-2-1-杨轶,
author    = {杨轶 and 张宁欣 and 任天令 and others},
title     = {硅基铁电微声学器件中薄膜残余应力的研究},
journal   = {中国机械工程},
pages= {1289-1291},
date      = {2005},
volume      = {16},
number ={14},
annotation ={EI 收录, 检索号:0534931 2907},
AUTHOR+an={1="第一作者"}
}

@article{ref-5-1-Wu,
author    = {Wu, X M and Yang, Y and Cai, J and others},
title     = {Measurements of ferroelectric MEMS microphones},
journal   = {Integrated Ferroelectrics},
date      = {2005},
pages={417-429},
volume      = {69},
annotation      = {SCI 收录, 检索号 :896KM.},
AUTHOR+an={2="Second Author"}
}

@article{ref-6-1-贾泽,
author    = {贾泽 and 杨轶 and 陈兢 and others},
title     = {用于压电和电容微麦克风的体硅腐蚀相关研究},
journal   = {压电与声光},
date      = {2006},
pages      = {117-119},
number={1},
volume      = {28},
annotation      = {EI 收录, 检索号:06129773469.},
AUTHOR+an={2="第二作者"}
}
\end{filecontents}

\makeatletter
\newif\ifisblind\isblindfalse

\renewcommand*{\mkbibnamegiven}[1]{%名均设为空
\ifisblind%
\else%
    \hasitemannotation%
        {\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}%
        {#1}%
\fi%
}

\renewcommand*{\mkbibnamefamily}[1]{%
\ifisblind%
    \hasitemannotation%存在注解提供的可用文本时输出该文本并标红加粗
        {\ifbibliography{\textcolor{red}{\textbf{\getitemannotation}}}{#1}}%
        {}%没有注解提供的可用文本时不输出
\else%
    \hasitemannotation%
        {\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}%
        {#1}%
\fi%
}
\makeatother

\addbibresource{\jobname.bib}

\begin{document}


\begin{refsection}
\newrefcontext[sorting=none] %按引用顺序排
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(明评)]
\end{refsection}

\begin{refsection}
\DeclareDelimFormat{multinamedelim}{\unspace} %去除多余的标点和空格
\newrefcontext[sorting=none]
\isblindtrue
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(盲评)]
\end{refsection}


\end{document} 

结果为:

在这里插入图片描述

基于提供“元信息”数据注解的实现

基于提供“元信息”数据注解的实现,则需要利用注解中的元信息进行处理和判断,获取标记作者的顺序,从而输出指定的信息。
这种方法需要修改author宏,但不需要在bib文件中对不同的条目提供不同的注解信息,所有的条目学位论文作者的标记采用相同标记。

具体为(顺序编码制样式):

\documentclass{ctexart}
\usepackage{xcolor}
\usepackage[style=gb7714-2015,gbannote=true]{biblatex}%,gbnamefmt=pinyin
\usepackage{fmtcount}

\begin{filecontents}[force]{\jobname.bib}
@article{ref-1-1-Yang,
author    = {Yang, Y and Ren, T L and Zhang, L T and others},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1=thesisauthor},
}

@article{ref-2-1-杨轶,
author    = {杨轶 and 张宁欣 and 任天令 and others},
title     = {硅基铁电微声学器件中薄膜残余应力的研究},
journal   = {中国机械工程},
pages= {1289-1291},
date      = {2005},
volume      = {16},
number ={14},
annotation ={EI 收录, 检索号:0534931 2907},
AUTHOR+an={1=thesisauthor}
}

@article{ref-5-1-Wu,
author    = {Wu, X M and Yang, Y and Cai, J and others},
title     = {Measurements of ferroelectric MEMS microphones},
journal   = {Integrated Ferroelectrics},
date      = {2005},
pages={417-429},
volume      = {69},
annotation      = {SCI 收录, 检索号 :896KM.},
AUTHOR+an={2=thesisauthor}
}


@article{ref-6-1-贾泽,
author    = {贾泽 and 杨轶 and 陈兢 and others},
title     = {用于压电和电容微麦克风的体硅腐蚀相关研究},
journal   = {压电与声光},
date      = {2006},
pages      = {117-119},
number={1},
volume      = {28},
annotation      = {EI 收录, 检索号:06129773469.},
AUTHOR+an={2=thesisauthor}
}

\end{filecontents}

\makeatletter
\newif\ifisblind\isblindfalse
\newcounter{numitemval}
\newcounter{numitemslt} %selected

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\ifisblind%
       \setcounter{numitemval}{1}%
       \whileboolexpr{test {\ifnumcomp{\value{numitemval}}{<}{\value{author}+1}}}
           {\ifitemannotation[author][default][\thenumitemval]{thesisauthor}%
                {\setcounter{numitemslt}{\thenumitemval}}{}%
           \stepcounter{numitemval}%
           }%
       \ifnumcomp{\value{numitemslt}}{>}{0}
            {\textcolor{red}{\textbf{\iffieldequalstr{userd}{chinese}{第\chinese{numitemslt}作者}{\Ordinalstring{numitemslt}~Author}}}, XXX.}
            {\printnames{author}}
     \else%
        \printnames{author}%
     \fi%%
     \iffieldundef{authortype}
       {}
       {\setunit{\printdelim{authortypedelim}}%
        \usebibmacro{authorstrg}}}
    {}}

\renewcommand*{\mkbibnamegiven}[1]{%
\ifitemannotation{thesisauthor}
{\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}%
{#1}%
}


\renewcommand*{\mkbibnamefamily}[1]{%
\ifitemannotation{thesisauthor}
{\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}
{#1}}
\makeatother

\addbibresource{\jobname.bib}

\begin{document}


\begin{refsection}
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(明评)]
\end{refsection}

\begin{refsection}
\isblindtrue
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(盲评)]
\end{refsection}

\end{document} 

结果为:
在这里插入图片描述

具体为(著者年份制样式):

\documentclass{ctexart}
\usepackage{xcolor}
\usepackage[style=gb7714-2015ay,gbannote=true]{biblatex}%,gbnamefmt=pinyin
\usepackage{fmtcount}

\begin{filecontents}[force]{\jobname.bib}
@article{ref-1-1-Yang,
author    = {Yang, Y and Ren, T L and Zhang, L T and others},
title     = {Miniature microphone with silicon-based ferroelectric thin films},
journal   = {Integrated Ferroelectrics},
date      = {2003},
pages      = {229-235},
volume      = {52},
annotation      = {SCI 收录, 检索号:758FZ},
AUTHOR+an={1=thesisauthor},
}

@article{ref-2-1-杨轶,
author    = {杨轶 and 张宁欣 and 任天令 and others},
title     = {硅基铁电微声学器件中薄膜残余应力的研究},
journal   = {中国机械工程},
pages= {1289-1291},
date      = {2005},
volume      = {16},
number ={14},
annotation ={EI 收录, 检索号:0534931 2907},
AUTHOR+an={1=thesisauthor}
}

@article{ref-5-1-Wu,
author    = {Wu, X M and Yang, Y and Cai, J and others},
title     = {Measurements of ferroelectric MEMS microphones},
journal   = {Integrated Ferroelectrics},
date      = {2005},
pages={417-429},
volume      = {69},
annotation      = {SCI 收录, 检索号 :896KM.},
AUTHOR+an={2=thesisauthor}
}


@article{ref-6-1-贾泽,
author    = {贾泽 and 杨轶 and 陈兢 and others},
title     = {用于压电和电容微麦克风的体硅腐蚀相关研究},
journal   = {压电与声光},
date      = {2006},
pages      = {117-119},
number={1},
volume      = {28},
annotation      = {EI 收录, 检索号:06129773469.},
AUTHOR+an={2=thesisauthor}
}

\end{filecontents}

\makeatletter
\newif\ifisblind\isblindfalse
\newcounter{numitemval}
\newcounter{numitemslt} %selected

\renewbibmacro*{author}{%author for biblatex version <=3.7
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{bbx:dashcheck}
       {%\bibnamedash
       \printnames{author}%
       }%
       {\usebibmacro{bbx:savehash}%
       \ifisblind%
       \setcounter{numitemval}{1}%
       \whileboolexpr{test {\ifnumcomp{\value{numitemval}}{<}{\value{author}+1}}}
       {\ifitemannotation[author][default][\thenumitemval]{thesisauthor}%
            {\setcounter{numitemslt}{\thenumitemval}}{}%
       \stepcounter{numitemval}%
       }%
       \ifnumcomp{\value{numitemslt}}{>}{0}
       {\textcolor{red}{\textbf{\iffieldequalstr{userd}{chinese}{第\chinese{numitemslt}作者}{\Ordinalstring{numitemslt}~Author}}}, XXX,}{\printnames{author}}
       \else%
        \printnames{author}%
       \fi%
        \iffieldundef{authortype}
          {\setunit{\addspace}}
          {\setunit{\addcomma\space}}}%
     \iffieldundef{authortype}
       {}
       {\usebibmacro{authorstrg}%
        \setunit{\addspace}}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addspace}}%
     \setunit{\addcomma\space}%增加一个逗号
  \usebibmacro{date+extrayear}
  }


\renewcommand*{\mkbibnamegiven}[1]{%
\ifitemannotation{thesisauthor}
{\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}%
{#1}%
}


\renewcommand*{\mkbibnamefamily}[1]{%
\ifitemannotation{thesisauthor}
{\ifbibliography{\textcolor{red}{\textbf{#1}}}{#1}}
{#1}}
\makeatother

\addbibresource{\jobname.bib}

\begin{document}


\begin{refsection}
\newrefcontext[sorting=none]
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(明评)]
\end{refsection}

\begin{refsection}
\newrefcontext[sorting=none]
\isblindtrue
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-5-1-Wu,ref-6-1-贾泽}

\printbibliography[title=在学期间研究成果(盲评)]
\end{refsection}

\end{document} 

结果为:
在这里插入图片描述

小结

两种实现的主要差别是,基于“可用文本”注解的处理,是在姓名列表中的每个姓名上做处理,利用mkbibnamefamily等在每个姓名上做替换。
而基于“元信息”注解的处理,则根据注解信息在整个姓名列表上做处理,通过重定义author直接替换作者列表。
两种方式没有高下之分,只看格式的需要,哪种方式更容易满足学位论文的格式要求就使用哪个。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值