引用格式要求

引用格式要求

我正在寻找一种特定的引用样式。我的整篇论文都是使用 biblatex 和 biber 编写的。我使用的是命令\footcite[][]{}\cite[]{}

有没有快速的解决方案来接收以下样式:

行内引用:

姓氏(年份),页码 --> Becker, Schuette (1996), S. 22 ff.

答案1

您可以使用\textcite。但是,这也会改变后注和前注的位置,输出也会与正常的\citeshorthand“同上”不同。


下面展示了如何修改\cite以获得完全相同的输出,只是年份用括号括起来。我们已小心处理以提供令人满意的压缩样式结果。

适合authoryear搭配

\makeatletter
\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
     \usebibmacro{cite:parenlabelyear+extrayear}}
    {\usebibmacro{cite:shorthand}}}

\newbibmacro*{cite:parenlabelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{\printtext[parens]{%
     \ifdefstring\blx@dateformat@labeldate{edtf}
       {}
       {\datecircaprint}%
     \dateeraprintpre{labelyear}%
     \printfield{labelyear}%
     \printfield{extrayear}%
     \dateuncertainprint%
     \iffieldsequal{labeldateera}{labelenddateera}{}
       {\dateeraprint{labelyear}}%
     \ifdefstring\blx@dateformat@labeldate{edtf}
       {\datecircaprintedtf}
       {}%
     \iffieldundef{labelendyear}
       {}
       {\iffieldsequal{labelyear}{labelendyear}{}
        {\ifdefstring\blx@dateformat@labeldate{edtf}
          {\slash}% strict EDTF
          {\bibdaterangesep
           \enddatecircaprint}%
         \dateeraprintpre{labelendyear}%
         \printfield{labelendyear}%
         \enddateuncertainprint
         \ifdefstring\blx@dateformat@labeldate{edtf}
           {\enddatecircaprintedtf}
           {}%
         \dateeraprint{labelendyear}}}}}}}
\makeatother

<code>authoryear</code> 示例

为了authoryear-ibid

\makeatletter
\renewbibmacro*{cite}{%
  \global\boolfalse{cbx:loccit}%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
          {\usebibmacro{cite:label}%
           \setunit{\printdelim{nonameyeardelim}}}
          {\printnames{labelname}%
           \setunit{\printdelim{nameyeardelim}}}%
        \usebibmacro{cite:parenlabelyear+extrayear}}}
    {\usebibmacro{cite:shorthand}}}

\newbibmacro*{cite:parenlabelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{\printtext[parens]{%
     \ifdefstring\blx@dateformat@labeldate{edtf}
       {}
       {\datecircaprint}%
     \dateeraprintpre{labelyear}%
     \printfield{labelyear}%
     \printfield{extrayear}%
     \dateuncertainprint%
     \iffieldsequal{labeldateera}{labelenddateera}{}
       {\dateeraprint{labelyear}}%
     \ifdefstring\blx@dateformat@labeldate{edtf}
       {\datecircaprintedtf}
       {}%
     \iffieldundef{labelendyear}
       {}
       {\iffieldsequal{labelyear}{labelendyear}{}
        {\ifdefstring\blx@dateformat@labeldate{edtf}
          {\slash}% strict EDTF
          {\bibdaterangesep
           \enddatecircaprint}%
         \dateeraprintpre{labelendyear}%
         \printfield{labelendyear}%
         \enddateuncertainprint
         \ifdefstring\blx@dateformat@labeldate{edtf}
           {\enddatecircaprintedtf}
           {}%
         \dateeraprint{labelendyear}}}}}}}
\makeatother

作者年份同上` 示例

适合authoryear-comp搭配

\makeatletter
\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{%
          \global\booltrue{cbx:parens}%
          \printdelim{nonameyeardelim}\bibopenparen}
        \usebibmacro{cite:labelyear+extrayear}%
        \usebibmacro{cite:reinit}}
       {\iffieldequals{namehash}{\cbx@lasthash}
          {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                       \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
             {\setunit{\addcomma}%
              \usebibmacro{cite:extrayear}}
             {\setunit{\compcitedelim}%
              \usebibmacro{cite:labelyear+extrayear}%
              \savefield{labelyear}{\cbx@lastyear}}}
          {\printnames{labelname}%
           \setunit{%
             \global\booltrue{cbx:parens}%
             \printdelim{nameyeardelim}\bibopenparen}
           \usebibmacro{cite:labelyear+extrayear}%
           \savefield{namehash}{\cbx@lasthash}%
           \savefield{labelyear}{\cbx@lastyear}}}}
    {\usebibmacro{cite:shorthand}%
     \usebibmacro{cite:reinit}}%
  \setunit{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}%
    \multicitedelim}}

\newbibmacro*{parenpostnote}{%
  \setunit{}%
  \printtext{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}}%
  \iffieldundef{postnote}
    {}
    {\setunit{\postnotedelim}%
     \printfield{postnote}}}

\DeclareCiteCommand{\cite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {}
  {\usebibmacro{parenpostnote}}
\makeatother

<code>authoryear-comp</code> 示例

最后authoryear-icomp使用

\makeatletter
\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
          {\usebibmacro{cite:label}%
           \setunit{%
             \global\booltrue{cbx:parens}%
             \printdelim{nonameyeardelim}\bibopenparen}
           \usebibmacro{cite:labelyear+extrayear}%
           \usebibmacro{cite:reinit}}
          {\iffieldequals{namehash}{\cbx@lasthash}
             {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                          \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
                {\setunit{\addcomma}%
                 \usebibmacro{cite:extrayear}}
                {\setunit{\compcitedelim}%
                 \usebibmacro{cite:labelyear+extrayear}%
                 \savefield{labelyear}{\cbx@lastyear}}}
             {\printnames{labelname}%
              \setunit{%
                \global\booltrue{cbx:parens}%
                \printdelim{nameyeardelim}\bibopenparen}
              \usebibmacro{cite:labelyear+extrayear}%
              \savefield{namehash}{\cbx@lasthash}%
              \savefield{labelyear}{\cbx@lastyear}}}}}
    {\usebibmacro{cite:shorthand}%
     \usebibmacro{cite:reinit}}%
  \setunit{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}%
    \multicitedelim}}

\newbibmacro*{cite:parenpostnote}{%
  \ifbool{cbx:loccit}
    {}
    {\usebibmacro{parenpostnote}}}

\newbibmacro*{parenpostnote}{%
  \setunit{}%
  \printtext{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}}%
  \iffieldundef{postnote}
    {}
    {\setunit{\postnotedelim}%
     \printfield{postnote}}}

\DeclareCiteCommand{\cite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {}
  {\usebibmacro{cite:parenpostnote}}
\makeatother

<code>authoryear-icomp</code> 示例

相关内容