报纸文章中的日期

报纸文章中的日期

我有以下代码:

\documentclass[british]{article}
\usepackage[backend=biber,%
            style=authoryear,%
            mergedate=basic,
            ]{biblatex}
\begin{filecontents}{bib.bib}
@Article{frie2002,
  author =   {Jonathan Friedland},
  title =    {Across the Divide},
  journal =  {Guardian},
  year =     {2002},
  pages =    {10-11},
  date =     {2002-01-15},
  volume =   {section G2},
}
\end{filecontents}
\addbibresource{bib.bib} 
\begin{document} 
\nocite{*}
\printbibliography
\end{document}

它产生的输出是

在此处输入图片描述

我如何获得这个输出?

在此处输入图片描述

答案1

您可以用entrysubtype = {newspaper}它来区分报纸文章和期刊文章。

条目看起来像这样(我们用它chapter来代替,但volume似乎不太正确)

@article{frie2002,
  author  = {Jonathan Friedland},
  title   = {Across the Divide},
  journal = {Guardian}, 
  pages   = {10-11},
  date    = {2002-01-15},
  chapter = {section G2}, 
  entrysubtype = {newspaper},
}

然后我们可以修改几个宏并检查newspaper

\DeclareFieldFormat{chapter}{\ifnumerals{#1}{\bibstring{chapter}~}{}#1}
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \iffieldequalstr{entrysubtype}{newspaper}
    {\setunit{\addcomma\space}%
     \usebibmacro{newspaper:issue+date}}
    {\setunit{\addspace}%
     \usebibmacro{issue+date}%
     \setunit{\addcolon\space}%
     \usebibmacro{issue}}%
  \newunit}

\newbibmacro*{newspaper:issue+date}{%
  \printtext{%
    \iffieldundef{day}{}{%
      \mkdatezeros{\thefield{day}}%
      \iffieldundef{month}{}{\nobreakspace}}%
    \iffieldundef{month}
      {}
      {\mkbibmonth{\thefield{month}}}}}

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \newunit
  \iffieldequalstr{entrysubtype}{newspaper}
    {\printfield{chapter}}{}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit}

平均能量损失

\documentclass[british]{article}
\usepackage[backend=biber,%
            style=authoryear,%
            mergedate=basic,
            ]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{frie2002,
  author  = {Jonathan Friedland},
  title   = {Across the Divide},
  journal = {Guardian}, 
  pages   = {10-11},
  date    = {2002-01-15},
  chapter = {section G2}, 
  entrysubtype = {newspaper},
}
\end{filecontents}
\addbibresource{\jobname.bib} 
\addbibresource{biblatex-examples.bib} 

\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareFieldFormat{chapter}{\ifnumerals{#1}{\bibstring{chapter}~}{}#1}
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \iffieldequalstr{entrysubtype}{newspaper}
    {\setunit{\addcomma\space}%
     \usebibmacro{newspaper:issue+date}}
    {\setunit{\addspace}%
     \usebibmacro{issue+date}%
     \setunit{\addcolon\space}%
     \usebibmacro{issue}}%
  \newunit}

\newbibmacro*{newspaper:issue+date}{%
  \printtext{%
    \iffieldundef{day}{}{%
      \mkdatezeros{\thefield{day}}%
      \iffieldundef{month}{}{\nobreakspace}}%
    \iffieldundef{month}
      {}
      {\mkbibmonth{\thefield{month}}}}}

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \newunit
  \iffieldequalstr{entrysubtype}{newspaper}
    {\printfield{chapter}}{}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit}

\begin{document} 
\nocite{frie2002,sigfridsson}
\printbibliography
\end{document}

给出

Friedland, Jonathan (2002),《跨越鸿沟》,《卫报》,1 月 15 日,G2 版,第 10-11 页。

Sigfridsson, Emma 和 Ulf Ryde (1998),《从静电势和矩推导原子电荷的方法比较》,载于:《计算化学杂志》19.4,第 377-395 页,doi:10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P。

答案2

一个可能不太好看但可行的解决方案是:

\documentclass[british]{article}
\usepackage[backend=biber,%
            style=authoryear,%
            dateabbrev=false
            ]{biblatex}
\begin{filecontents}{bib.bib}
@Article{frie2002,
  author =   {Jonathan Friedland},
  title =    {Across the Divide},
  journal =  {Guardian},
  year =     {2002},
  pages =    {10-11},
  date =     {2002-01-15},
  volume =   {section G2},
}
\end{filecontents}
\addbibresource{bib.bib} 

\renewbibmacro*{journal}{\printfield{journaltitle},}
\DeclareFieldFormat*{volume}{\printfield{day}. \mkbibmonth{\printfield{month}}, #1}


\begin{document} 
\nocite{*}
\printbibliography
\end{document}

在我的计算机上产生所需的输出:期望参考样式

但我不得不承认,这似乎是一种布局参考文献的有点奇怪方式;)

相关内容