代码

代码

我正在为使用温哥华格式变体的期刊格式化引文。我遇到了两个问题:

  1. 我需要参考书目中的引文与其对应的文内引文编号一起出现。例如,如果我在文中引用“你真棒(1)”。我需要参考书目条目为:“1. 作者,B....”
  2. 在参考书目中,我需要引用在引用编号之后立即开始,并且在转到第二行时不缩进。

第一幅图显示了引用的格式,第二幅图显示了当前的格式。

第一张图片

第一张图片

第二张图片

图片 2

更改bibstyle=authoryearbibstyle=numeric会产生下面的图像(图 3)。我有引文编号,但现在我正在处理间距问题。此外,作者的名字首字母出现在他们的姓氏之前,这与我想要的正好相反。如果我可以让引文信息紧跟在引文编号之后并向左对齐,并且作者的名字首字母出现在他们的姓氏之后,就像图 1 中那样,那就太完美了。

第三张图片 第三张图片

如您所见,我已经非常接近了,但我就是无法解决最后两个问题。这是我的第二张图片的 MWE:

\documentclass [12pt]{article}

\usepackage[
    backend=bibtex8,
    natbib=true,
    citestyle=numeric,
    isbn=false,
    bibstyle=authoryear,
    maxnames=3,
    minnames=3,
    firstinits=true, % Removes period after first name intial 
    terseinits=true, % Removes period after first name intial 
    sorting=none] % List citation in order they appear
    {biblatex}

\DeclareFieldFormat[article]{volume}{\textbf{#1}\addcomma\space} % Bolds volume of citation and adds comma after volume
\DeclareFieldFormat{pages}{#1} % No prefix for the "pages" field in the bibliography
\renewcommand*{\revsdnamepunct}{} % Removing the comma after last name
\renewcommand*{\revsdnamepunct}{} % Removing the periods after first name intial
\renewcommand{\labelnamepunct}{\addspace} % Removes period after year in bibliography
\DeclareFieldFormat[article]{title}{#1}  % Remove quotes from journal title
\DeclareNameAlias{sortname}{last-first} % Lists all authors with last name first
\renewcommand*{\finalnamedelim}{\addspace\bibstring{and}\space}% removes comma after penultimate name

\usepackage{xpatch}

\xpatchbibmacro{name:andothers}{% maked the ``et al'' italicized in the bibliography
\bibstring{andothers}%
}{%
\bibstring[\emph]{andothers}%
}{}{}

\renewbibmacro{in:}{% Removes "In" from bibliography entries
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}

\usepackage{filecontents}
\begin{filecontents*}{example.bib}

@article{author2014,
author = {Author, A. B. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2014}
}
@article{author2013,
author = {Author, A. D. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2013}
}
\end{filecontents*}

\bibliography{example}

\begin{document}

Be excellent, Dudes \supercite{author2014,author2013}

\printbibliography

\end{document}

答案1

这个答案包含了我评论中的代码和 karlkoeller 答案中的两个元素:

  • 书目标签的重新定义;
  • 坚持bibstyle=authoryear(我在原始答案中已经更改)。

此外,我还更改了标点符号以匹配目标图像。具体来说,我在作者姓名的姓氏和首字母之间添加了逗号,但从列表中的不同姓名之间删除了逗号。也就是说,目标格式显示

last1, init1 last2, init2 and last3, init3

而不是

last1 init1, last2 init2, and last3 init3

代码

\documentclass [12pt]{article}

\usepackage[
    backend=bibtex8,
    natbib=true,
    citestyle=numeric,
    bibstyle=authoryear, % also thanks to karlkoeller's answer (was in MWE but - see comments)
    isbn=false,
    maxnames=3,
    minnames=3,
    firstinits=true, % Removes period after first name intial
    terseinits=true, % Removes period after first name intial
    sorting=none] % List citation in order they appear
    {biblatex}

\DeclareFieldFormat[article]{volume}{\textbf{#1}\addcomma\space} % Bolds volume of citation and adds comma after volume
\DeclareFieldFormat{pages}{#1} % No prefix for the "pages" field in the bibliography
\DeclareFieldFormat[article]{title}{#1}  % Remove quotes from journal title
\DeclareNameAlias{sortname}{last-first} % Lists all authors with last name first
\renewcommand{\labelnamepunct}{\addspace} % Removes period after year in bibliography
\renewcommand*{\revsdnamepunct}{\addcomma}% want a comma between last name and initials
\renewcommand*{\multinamedelim}{\space}% want a space but no comma between names
\renewcommand*{\finalnamedelim}{\addspace\bibstring{and}\space}% want a space but no comma between penultimate name and 'and' followed by final name

\usepackage{xpatch}

\xpatchbibmacro{name:andothers}{% maked the ``et al'' italicized in the bibliography
\bibstring{andothers}%
}{%
\bibstring[\emph]{andothers}%
}{}{}

\renewbibmacro{in:}{% Removes "In" from bibliography entries
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}

\DeclareFieldFormat{labelnumberwidth}{#1.}% from karlkoeller's answer

\defbibenvironment{bibliography}
  {\list
    {\printfield[labelnumberwidth]{labelnumber}}
    {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{0pt}%
      \setlength{\labelsep}{\biblabelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\itemindent}{\labelwidth}%
      \addtolength{\itemindent}{\labelsep}%
      \setlength{\parsep}{\bibparsep}}%
    \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\usepackage{filecontents}
\begin{filecontents*}{example.bib}

@article{author2014,
author = {Author, A. B. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2014}
}
@article{author2013,
author = {Author, A. D. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2013}
}
\end{filecontents*}

\bibliography{example}

\begin{document}

Be excellent, Dudes \supercite{author2014,author2013}

\printbibliography

\end{document}

结果

修改了参考书目的数字样式

答案2

在序言中添加以下几行:

\DeclareFieldFormat{labelnumberwidth}{#1.}

\defbibenvironment{bibliography}
  {\list 
    {\printfield[labelnumberwidth]{labelnumber}} 
  {\setlength{\labelwidth}{\labelnumberwidth}% 
   \setlength{\leftmargin}{0pt}% 
   \setlength{\labelsep}{\biblabelsep}% 
   \setlength{\itemsep}{\bibitemsep}% 
   \setlength{\itemindent}{\labelwidth}% 
   \addtolength{\itemindent}{\labelsep}% 
   \setlength{\parsep}{\bibparsep}}% 
   \renewcommand*{\makelabel}[1]{\hss##1}} 
{\endlist} 
{\item}

梅威瑟:

\documentclass [12pt]{article}

\usepackage[
    backend=bibtex8,
    natbib=true,
    citestyle=numeric,
    isbn=false,
    bibstyle=authoryear,
    maxnames=3,
    minnames=3,
    firstinits=true, % Removes period after first name intial
    terseinits=true, % Removes period after first name intial
    sorting=none] % List citation in order they appear
    {biblatex}

\DeclareFieldFormat[article]{volume}{\textbf{#1}\addcomma\space} % Bolds volume of citation and adds comma after volume
\DeclareFieldFormat{pages}{#1} % No prefix for the "pages" field in the bibliography
\renewcommand*{\revsdnamepunct}{} % Removing the comma after last name
\renewcommand*{\revsdnamepunct}{} % Removing the periods after first name intial
\renewcommand{\labelnamepunct}{\addspace} % Removes period after year in bibliography
\DeclareFieldFormat[article]{title}{#1}  % Remove quotes from journal title
\DeclareNameAlias{sortname}{last-first} % Lists all authors with last name first

\DeclareFieldFormat{labelnumberwidth}{#1.}

\defbibenvironment{bibliography}
  {\list 
    {\printfield[labelnumberwidth]{labelnumber}} 
  {\setlength{\labelwidth}{\labelnumberwidth}% 
   \setlength{\leftmargin}{0pt}% 
   \setlength{\labelsep}{\biblabelsep}% 
   \setlength{\itemsep}{\bibitemsep}% 
   \setlength{\itemindent}{\labelwidth}% 
   \addtolength{\itemindent}{\labelsep}% 
   \setlength{\parsep}{\bibparsep}}% 
   \renewcommand*{\makelabel}[1]{\hss##1}} 
{\endlist} 
{\item}


\usepackage{xpatch}

\xpatchbibmacro{name:andothers}{% maked the ``et al'' italicized in the bibliography
\bibstring{andothers}%
}{%
\bibstring[\emph]{andothers}%
}{}{}

\renewbibmacro{in:}{% Removes "In" from bibliography entries
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}

\usepackage{filecontents}
\begin{filecontents*}{example.bib}

@article{author2014,
author = {Author, A. B. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2014}
}
@article{author2013,
author = {Author, A. D. and Author, A. B. and Author, A. B.},
journal = {Journal of the happy but frustrated biblatex user},
pages = {1070--1074},
title = {{Biblatex hurts so good}},
volume = {10},
date = {2013}
}
\end{filecontents*}

\bibliography{example}

\begin{document}

Be excellent, Dudes \supercite{author2014,author2013}

\printbibliography

\end{document} 

输出:

在此处输入图片描述

相关内容