如何设置 \cite

如何设置 \cite

我使用脚注\footcite{quante2012person}并在我的文件中定义源,.bib如下所示:

@book{quante2012person,
  title={Person},
  author={Quante, Michael},
  year={2012},
  publisher={Walter de Gruyter}
}

现在我还想使用 \cite{quante2012person},这样就不会出现 footcite。它可以工作,但我只想获取姓氏、年份和页码,而不是 -tag 中设置的全部数据@book。我该如何实现呢?

编辑: 我得到这样的结果: 在此处输入图片描述

我不确定我使用的是哪种风格,但这在我的序言中:

\usepackage{csquotes}
\usepackage[style=verbose, backend=biber]{biblatex}
\usepackage{hyperref}

\bibliography{biblio}
\addbibresource{references/biblio.bib}

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhyperref]{\printtext[bibhypertarget]{%
     \usedriver
        {\DeclareNameAlias{sortname}{default}}
        {\thefield{entrytype}}}%
    \usebibmacro{shorthandintro}}}

答案1

我们可以从以下位置窃取作者年份引用所需的代码:authoryear.cbx

\newbibmacro*{cite:labelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{%
       \printfield{labelyear}%
       \printfield{extrayear}}}}

\renewbibmacro*{cite:authoryear}{%
  \printnames{labelname}%
  \setunit*{\printdelim{nameyeardelim}}%
  \printtext[bibhyperlink]{%
    \usebibmacro{cite:labelyear+extrayear}}}

然后我们要求作者年份\cite样式\parencite

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:authoryear}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:authoryear}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

您应该加载biblatex选项labeldate并添加

\renewbibmacro*{date}{\printdateextralabel}

获得参考书目中的年份歧义。

平均能量损失

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[style=verbose, backend=biber, labeldate]{biblatex}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhyperref]{%
    \printtext[bibhypertarget]{%
      \usedriver
        {\DeclareNameAlias{sortname}{default}}
        {\thefield{entrytype}}}%
    \usebibmacro{shorthandintro}}}

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:authoryear}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:authoryear}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\newbibmacro*{cite:labelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{%
       \printfield{labelyear}%
       \printfield{extrayear}}}}

\renewbibmacro*{cite:authoryear}{%
  \printnames{labelname}%
  \setunit*{\printdelim{nameyeardelim}}%
  \printtext[bibhyperlink]{%
    \usebibmacro{cite:labelyear+extrayear}}}

\renewbibmacro*{date}{\printdateextralabel}

\begin{document}
Lorem\footcite{sigfridsson} \cite{worman} ipsum\footcite{geer}

Lorem\footcite{sigfridsson} \cite{worman} ipsum\footcite{geer}

Lorem\footcite{knuth:ct:b,knuth:ct:c} ipsum\footcite{knuth:ct:b,knuth:ct:c} dolor \cite{knuth:ct:b,knuth:ct:c}

\cite{cicero} lorem\footcite{cicero}

\printbibliography
\end{document}

给出

示例输出

相关内容