Biblatex:定制参考书目

Biblatex:定制参考书目

我用来biblatex参考。我的代码和输出如下:

源代码:

\documentclass{report}

\usepackage[utf8]{inputenc}
\usepackage[top=1in,bottom=1in,left=1.25in,right=1in]{geometry}
\usepackage{times}


%___________________________________________
\usepackage[maxbibnames=99,bibstyle=authoryear,style=numeric-comp,doi=false, isbn=false,giveninits,terseinits=true,url=false]{biblatex}
\DeclareNameAlias{author}{family-given}
\renewcommand*{\revsdnamepunct}{}
\renewcommand*{\finalnamedelim}{\addspace and \addspace}
\renewbibmacro{in:}{}
\DeclareFieldFormat{pages}{#1}
\addbibresource{reference.bib}
%___________________________________________

\begin{document}
\noindent Impact of cyclone in human health \cite{dissanayake1991} and concentration graph \cite{mukherjee2018groundwater}.
\printbibliography
\end{document}

输出为: 在此处输入图片描述

reference.bib文件:

@article{dissanayake1991,
    title={The fluoride problem in the ground water of Sri Lanka — environmental management and health},
    author={Dissanayake, CB},
    journal={International Journal of Environmental Studies},
    volume={38},
    number={2-3},
    pages={137--155},
    year={1991},
    publisher={Taylor \& Francis}
}
@article{mukherjee2018groundwater,
  title={Groundwater fluoride contamination, probable release, and containment mechanisms: a review on Indian context},
  author={Mukherjee, Indrani and Singh, Umesh Kumar},
  journal={Environmental geochemistry and health},
  volume={40},
  number={6},
  pages={2259--2301},
  year={2018},
  publisher={Springer}
}

我的问题是:

  1. 是否可以在作者姓名后加上年份?如果可以,我该怎么做?
  2. 是否可以删除作者姓名、标题、期刊名称后的句号(每个参考文献末尾的句号除外)?如果可以,我该如何删除这些句号?

很感谢任何形式的帮助!!

答案1

可以通过从中复制相关代码将年份移至作者姓名后面authoryear.bbx,其中年份位于作者后面,(请参阅下面代码中的注释,复制的代码稍微简化:选项dashed已被删除)。

示例输出中的大多数句点都是由\newunit's生成的\newunitpunct,因此如果您重新定义,\newunitpunct则可以更改这些句点。这可能太过激进(对于其他条目类型也是如此),在这种情况下,人们必须转向更复杂的解决方案,其中更改参考书目宏或驱动程序中的单个\newunit/实例。\setunit

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[top=1in,bottom=1in,left=1.25in,right=1in]{geometry}
\usepackage{times}


\usepackage[backend=biber,
  style=numeric-comp,
  maxbibnames=99,
  giveninits, terseinits=true,
  doi=false, url=false, isbn=false,
]{biblatex}

\DefineBibliographyExtras{english}{%
  \def\finalandcomma{}}

\renewcommand*{\revsdnamepunct}{}

\DeclareNameAlias{sortname}{family-given}

%%%% adapted (simplified) from authoryear.bbx
\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

\DeclareNameWrapperAlias{author}{sortname}
\DeclareNameWrapperAlias{editor}{sortname}
\DeclareNameWrapperAlias{translator}{sortname}

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\printnames{author}%
     \setunit{\printdelim{authortypedelim}}%
     \usebibmacro{authorstrg}%
     \setunit{\printdelim{nameyeardelim}}}%
    {\usebibmacro{labeltitle}%
     \setunit*{\printdelim{nonameyeardelim}}}%
  \usebibmacro{date+extradate}}

\renewbibmacro*{editor}{%
  \usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
  \usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\printdelim{editortypedelim}}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \setunit{\printdelim{nameyeardelim}}}%
    {\usebibmacro{labeltitle}%
     \setunit*{\printdelim{nonameyeardelim}}}%
  \usebibmacro{date+extradate}}

\renewbibmacro*{translator}{%
  \usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
  \usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\printnames{translator}%
     \setunit{\printdelim{translatortypedelim}}%
     \usebibmacro{#1}%
     \clearname{translator}%
     \setunit{\printdelim{nameyeardelim}}}%
    {\usebibmacro{labeltitle}%
     \setunit*{\printdelim{nonameyeardelim}}}%
  \usebibmacro{date+extradate}}

%% mergedate=compact
\renewbibmacro*{date}{%
  \usebibmacro{bbx:ifmergeddate}
    {}
    {\printdate}}%

\renewbibmacro*{date+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[parens]{%
       \iflabeldateisdate
         {\printdateextra}
         {\printlabeldateextra}}}}%
\renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}%
\renewbibmacro*{issue+date}{%
  \ifboolexpr{test {\usebibmacro{bbx:ifmergeddate}}
              and
              test {\iffieldundef{issue}}}
    {}
    {\printtext[parens]{%
       \printfield{issue}%
       \setunit*{\addspace}%
       \usebibmacro{bbx:ifmergeddate}
         {}
         {\printdate}}}%
  \newunit}
% authoryear.bbx END

\renewbibmacro{in:}{}
\DeclareFieldFormat{pages}{#1}

% remove period in most places
\renewcommand*{\newunitpunct}{\addspace}


\begin{filecontents}{\jobname.bib}
@article{dissanayake1991,
  title   = {The Fluoride Problem in the Ground Water of {Sri Lanka}
             -- Environmental Management and Health},
  author  = {Dissanayake, CB},
  journal = {International Journal of Environmental Studies},
  volume  = {38},
  number  = {2-3},
  pages   = {137--155},
  year    = {1991},
}
@article{mukherjee2018groundwater,
  title   = {Groundwater Fluoride Contamination, Probable Release,
             and Containment Mechanisms: a Review on {Indian} Context},
  author  = {Mukherjee, Indrani and Singh, Umesh Kumar},
  journal = {Environmental geochemistry and health},
  volume  = {40},
  number  = {6},
  pages   = {2259--2301},
  year    = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Impact of cyclone in human health \autocite{dissanayake1991}
and concentration graph \autocite{mukherjee2018groundwater}.
\printbibliography
\end{document}

[1] Dissanayake C “斯里兰卡地下水中的氟化物问题——环境管理与健康”《国际环境研究杂志》38.2-3 (1991), 137-155。//[2] Mukherjee I 和 Singh UK “地下水氟化物污染、可能的释放和遏制机制:对印度背景的回顾”《环境地球化学与健康》40.6 (2018), 2259-2301。


另一种稍微短一点但也稍微危险的方法是选择bibstyle=authoryear,然后手动输入代码bibstyle=numeric,

由于bibstyle=authoryear,有代码将年份直接移动到作者之后的位置,并bibstyle=numeric,继承了大部分当前设置,只需添加数字,所以这是可行的。

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[top=1in,bottom=1in,left=1.25in,right=1in]{geometry}
\usepackage{times}


\usepackage[backend=biber,
  bibstyle=authoryear,
  citestyle=numeric-comp,
  maxbibnames=99,
  giveninits, terseinits=true,
  doi=false, url=false, isbn=false,
]{biblatex}

\DefineBibliographyExtras{english}{%
  \def\finalandcomma{}}

\renewcommand*{\revsdnamepunct}{}

\makeatletter
\input{numeric.bbx}
\makeatother

\DeclareNameAlias{sortname}{family-given}

\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

\DeclareNameWrapperAlias{author}{sortname}
\DeclareNameWrapperAlias{editor}{sortname}
\DeclareNameWrapperAlias{translator}{sortname}

\renewbibmacro{in:}{}
\DeclareFieldFormat{pages}{#1}

% remove period in most places
\renewcommand*{\newunitpunct}{\addspace}


\begin{filecontents}{\jobname.bib}
@article{dissanayake1991,
  title   = {The Fluoride Problem in the Ground Water of {Sri Lanka}
             -- Environmental Management and Health},
  author  = {Dissanayake, CB},
  journal = {International Journal of Environmental Studies},
  volume  = {38},
  number  = {2-3},
  pages   = {137--155},
  year    = {1991},
}
@article{mukherjee2018groundwater,
  title   = {Groundwater Fluoride Contamination, Probable Release,
             and Containment Mechanisms: a Review on {Indian} Context},
  author  = {Mukherjee, Indrani and Singh, Umesh Kumar},
  journal = {Environmental geochemistry and health},
  volume  = {40},
  number  = {6},
  pages   = {2259--2301},
  year    = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Impact of cyclone in human health \autocite{dissanayake1991}
and concentration graph \autocite{mukherjee2018groundwater}.
\printbibliography
\end{document}

相关内容