我需要在tufte-book
引用中author-year
使用建议风格author-year
。与那里的情况不同,我想要
autocite=footnote
常规文本中的简单引用作为旁注(与tufte 样式自动生成)和- 脚注中的简单引用。
我曾尝试更改那里给出的代码,使其在常规文本中自动引用脚注,并在脚注中自动引用普通引用,但没有成功。
必须改变什么?
% \documentclass[a4paper,openany,nobib]{tufte-book}
\documentclass{article}
\usepackage[style=authoryear,
autocite=footnote]{biblatex}
\DeclareAutoCiteCommand{inlineplainfootnote}{\mysmartcite}{\mysmartcites}
\DeclareCiteCommand{\mysmartcite}[\iffootnote\textnormal\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\mysmartcites}
[\iffootnote\textnormal\mkbibparens]{\mysmartcite}{\multicitedelim}
\ExecuteBibliographyOptions{autocite=inlineplainfootnote}
% \usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Poet, B.},
year = {2002},
title = {Beta},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill% just for the example
Some text with a reference \autocite{A01} which should become a sidenote i.e. 1 and the sidenote should say: (Author 2001) .
Some more text with a citation which should become a footnote or sidenote saying: Author 2001, Poet 2002 \autocite{A01, B02}.
Some text with a footnote \footnote{A footnote with \autocite{B02}.} which should say: 1 A footnote with (Poet 2002).
And some text with a footnote with two citations \footnote{Two citations\autocite{B02, A01}} which should say: 2 Two citations(Poet 2002; Author 2001).
\printbibliography
\end{document}
另外:我已经添加了第二个 bib 条目,但找不到它。那里出了什么问题?
答案1
我认为您不需要定义任何新的引用命令:\smartcite
如果不是因为biblatex
无法检测脚注,您可能会对标准方法感到满意tufte-book
。所以我们需要做的就是让它检测脚注。这是通过\toggletrue{blx@footnote}
在脚注实现中的正确位置插入来完成的。
\documentclass[a4paper,openany,nobib]{tufte-book}
\usepackage[style=authoryear, autocite=footnote]{biblatex}
\makeatletter
\renewcommand\@footnotetext[2][0pt]{%
\marginpar{%
\hbox{}\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\@tufte@margin@par% use parindent and parskip settings for marginal text
\vspace*{-1\baselineskip}\noindent%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
\@makefntext{%
\toggletrue{blx@footnote}%
\ignorespaces #2%
}%
\color@endgroup%
}%
}%
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
Some text with a reference \autocite{sigfridsson}
Some more text with a citation\autocite{sigfridsson, nussbaum}.
Some text with a footnote \footnote{A footnote with \autocite{nussbaum}.}
And some text with a footnote with two citations \footnote{Two citations\autocite{nussbaum, sigfridsson}}
\printbibliography
\end{document}
请注意,这不包括仅包含引用的脚注中的括号。