自定义 BibLaTeX 样式

自定义 BibLaTeX 样式

我需要制作以下 BibLaTeX 样式:

在此处输入图片描述

目前我得到这个输出:

在此处输入图片描述

文件.bib名为Libtest.bib

@unpublished {mi:2009,
author = {T. Miller and X. Meyer and K. Nahel},
title = {Arbitrary title: extensive latex work pays of at university most likely},
type = {Unpublished working paper},
institution = {Random University}
location = {Random location}
date = {2009}
}

测试:

\documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}
\overfullrule=1mm
\usepackage[onehalfspacing]{setspace}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[backend=bibtex8,
    style=authoryear-icomp,
    dashed=false,
    autocite=footnote,
    maxcitenames=3,
    mincitenames=1,
    maxbibnames=100,
    sorting=nty
    ]{biblatex}
\bibliography{Libtest}
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\printtext[bibhyperref]{%
   \printtext[parens]{% 
   \printfield{labelyear}%
   \printfield{extrayear}}}}}
\bibliography{Libtest}
\begin{document}
\cite{mi:2009}  argue...
\printbibliography
\end{document}

也许有人可以帮助我将“ands”改为逗号并实现上述其余输出?

问候,汤姆。

答案1

您似乎更喜欢仅打印名字首字母的样式,因此我们将其用作firstinits=true包加载选项。

您还希望所有姓名都采用“姓,名”的格式,因此我们发出\DeclareNameAlias{sortname}{last-first}。要删除最后的“and”:\renewcommand*{\finalnamedelim}{\multinamedelim}

没有应用任何格式title指令

\DeclareFieldFormat*{title}{#1}

要去掉括号中的年份,请在序言中添加以下内容

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {}
    {%\printtext[parens]{%
       \setunit{\addcomma\space}%
       \iffieldsequal{year}{\thefield{datelabelsource}year}
         {\printdateextralabel}%
         {\printfield{labelyear}%
          \printfield{extrayear}}}}%}%

要将顺序更改为“机构、地点”,我们使用

\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{institution+location+date}{%
  \printlist{institution}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{organization+location+date}{%
  \printlist{organization}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}

去掉@articlestry中的“in”

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

以下将卷和编号格式化为“#vol (#nr)”。

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\addspace}%
  \printfield[parens]{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

平均能量损失

\documentclass{article}  
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-icomp, dashed=false, autocite=footnote, maxcitenames=3,
    mincitenames=1, maxbibnames=100, sorting=nty, firstinits=true, backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@unpublished {mi:2009,
  author = {T. Miller and X. Meyer and K. Nahel},
  title = {Arbitrary title: extensive latex work pays of at university most likely},
  type = {Unpublished working paper},
  institution = {Random University},
  location = {Random location},
  date = {2009},
}
@inproceedings{author2010title,
  AUTHOR   = {Smith, Agent},
  TITLE    = {{Entangled in the Matrix}},
  eventtitle= {Cyberwhatever Symposium},
  ADDRESS  = {Berlin},
  DATE     = {2010-06-01}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\renewcommand*{\finalnamedelim}{\multinamedelim}
\DeclareNameAlias{sortname}{last-first}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{journaltitle}{#1}
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\printtext[bibhyperref]{%
   \printtext[parens]{% 
   \printfield{labelyear}%
   \printfield{extrayear}}}}}

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {}
    {%\printtext[parens]{%
       \setunit{\addcomma\space}%
       \iffieldsequal{year}{\thefield{datelabelsource}year}
         {\printdateextralabel}%
         {\printfield{labelyear}%
          \printfield{extrayear}}}}%}%

\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{institution+location+date}{%
  \printlist{institution}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}
\renewbibmacro*{organization+location+date}{%
  \printlist{organization}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}
  \usebibmacro{date}%
  \newunit}

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\addspace}%
  \printfield[parens]{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\begin{document}
  \cite{mi:2009,markey,wilde,knuth:ct:a,baez/article,reese,itzhaki,cicero,author2010title,bertram}
  \printbibliography
\end{document}

给出 在此处输入图片描述

相关内容