Biblatex:仅更改一种文献类型的日期/年份输出

Biblatex:仅更改一种文献类型的日期/年份输出

我有一本书,它使用脚注和几个参考书目,包括书籍、文章等。通常,引用样式为作者-年份,类似于“作者(年份)、标题、出版商”。我使用代码片段来调整标准 biblatex 样式,以便在所有文献类型的年份周围加上括号(参见 MWE)。但是,我创建了一种文献类型 (misc2) 来涵盖法院裁决(因为 misc one 用于不适合 biblatex 类型的法律文件)。与其他类型不同,这些类型应该看起来像这样:“EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta”(法院诉日期,标题)。

我只想调整类型 misc 2,以在“v. YEAR”而不是“(YEAR)”中显示年份字段。我该如何调整我的代码以实现此目的?

梅威瑟:

\documentclass[graybox,envcountchap,sectrefs]{svmono}
\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}
\usepackage[bottom]{footmisc}
\bibliography{lit.bib}
\makeindex
%command for generally putting parenthesis around year/date
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\ifentrytype{misc}
    {
        \printtext[bibhyperref]{%
        %\printtext[parens]{%
        %\printfield{labelyear}%
        %\printfield{extrayear}}
        }}  
    {
        \printtext[bibhyperref]{%
        \printtext[parens]{%
        \printfield{labelyear}%
        \printfield{extrayear}}
        }}
   }
   }
\begin{document}

Test Document Group 1 (book)\autocite[2]{draftnotice}.


"Misc" is used for other legal documents, "Misc 2" is distinct and used for court rulings:


Test Document Group 2 (Misc2)\footnote{\fullcite{eugh29807}.} 


What Test Document Group 2 is supposed to be like\footnote{EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta}

\end{document}

我的 lit.bib

@book{draftnotice,
    Author = {{Karl Marx}},
    Howpublished = {Capital},
    Year = {1867}}

@misc2{eugh29807,
    Author = {{EuG}},
    Howpublished = {Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta},
    Year = {15.6.2000}}

并附有一张图片来解释我的意思:

在此处输入图片描述

答案1

您可以使用\DeclareFieldFormat它,它允许对每个条目类型进行格式化。(我已经将您的 documentclass 更改为article,因为我没有您的课程)。

笔记:这是一个临时答案,虽然有效,但如评论中所述,存在一些问题。 我将更新更好的解决方案。

\documentclass[]{article}
\begin{filecontents}{\jobname.bib}
@book{draftnotice,
    Author = {{Karl Marx}},
    Howpublished = {Capital},
    Year = {1867}}

@misc2{eugh29807,
    Author = {{EuG}},
    Howpublished = {Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta},
    Year = {15.6.2000}}
\end{filecontents}
\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}
\usepackage[bottom]{footmisc}
\bibliography{\jobname.bib}

%command for generally putting parenthesis around year/date
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\printtext[bibhyperref]{%
   \printtext[parens]{%
   \printfield{labelyear}%
   \printfield{extrayear}}%
   }}%
   }

\DeclareFieldFormat[misc2]{parens}{v. #1\addcomma}
\begin{document}

Test Document Group 1 (book)\autocite[2]{draftnotice}.


"Misc" is used for other legal documents, "Misc 2" is distinct and used for court rulings:


Test Document Group 2 (Misc2)\footnote{\fullcite{eugh29807}.} 


What Test Document Group 2 is supposed to be like\footnote{EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta}

\end{document}

脚注输出

相关内容