使用时,biblatex
我想在脚注中显示完整的引文,并在文本中使用以下格式author (year)^citation number
。现在我使用的是 MWE 中的格式。有没有更好的方法来实现相同的格式,并且对于同一本书的引文,使用相同的数字,即1
在 中使用 just 而rappaport:2002
不是1
and 3
?
\documentclass{article}
\usepackage[backend=biber,style=footnote-dw]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{xparse}
\DeclareDocumentCommand{\myfootcite}{ O{} O{} m }{\citeauthor*[#1][]{#3}~(\citedate[][]{#3})\cite[][#2]{#3}}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{rappaport:2002,
title={Wireless Communications: Principles and Practice},
author={Theodore S.~Rappaport},
publisher={Prentice Hall},
month=jan,
year=2002,
isdn={978-0130422323},
edition=2,
}
@book{goldsmith:2004,
title={Wireless Communications},
author={Andrea Goldsmith},
publisher={Stanford University},
year=2004,
url={http://www.cs.ucdavis.edu/~liu/289I/Material/book-goldsmith.pdf},
urldate={2013-06},
}
\end{filecontents*}
\begin{document}
Test1~\myfootcite[p.~165][]{rappaport:2002}
\par
Test2~\myfootcite[p.~230][]{goldsmith:2004}
\par
Test3~\myfootcite[][]{rappaport:2002}
\end{document}
答案1
如果我们将\textcite
命令与footnote-dw
脚注中多次引用的参考文献,它不打印年份,前后注的位置也不同。不过幸运的是,在authoryear.cbx
我们的帮助下,我们可以实现您想要的输出。
这是来自authoryear.cbx
(经过一些修改)
\newbool{cbx:parens}
\newbibmacro*{ay:textcite}{%
\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
\printdate}
\newbibmacro*{ay:textcite:postnote}{%
\iffieldundef{postnote}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}}
{\ifbool{cbx:parens}
{\setunit{\postnotedelim}}
{\setunit{\addspace\bibopenparen}}%
\printfield{postnote}\bibcloseparen}}
然后
\DeclareCiteCommand{\etextcite}[\footnotecheck\cbx@textcite\superfootcite]
{\usebibmacro{prenote}%
\gdef\cbx@savedkeys{}}
{\usebibmacro{ay:textcite}%
\ifciteseen
{\global\boolfalse{cbx:textcitefull}}
{\global\booltrue{cbx:textcitefull}}%
\xappto\cbx@savedkeys{\thefield{entrykey},}}
{\multinamedelim}
{\usebibmacro{ay:textcite:postnote}%
\protected@xappto\cbx@savedcites{{\cbx@savedkeys}}}
\textcite
是的修改footnote-dw.cbx
。
最后,我们需要奥黛丽的 \superfullcite
从脚注中多次引用的参考文献。
平均能量损失
\documentclass{article}
\usepackage[backend=biber,style=footnote-dw]{biblatex}
\addbibresource{biblatex-examples.bib}
\newbool{cbx:parens}
\newbibmacro*{ay:textcite}{%
\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
\printdate}
\newbibmacro*{ay:textcite:postnote}{%
\iffieldundef{postnote}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}}
{\ifbool{cbx:parens}
{\setunit{\postnotedelim}}
{\setunit{\addspace\bibopenparen}}%
\printfield{postnote}\bibcloseparen}}
\makeatletter
\DeclareCiteCommand{\etextcite}[\footnotecheck\cbx@textcite\superfootcite]
{\usebibmacro{prenote}%
\gdef\cbx@savedkeys{}}
{\usebibmacro{ay:textcite}%
\ifciteseen
{\global\boolfalse{cbx:textcitefull}}
{\global\booltrue{cbx:textcitefull}}%
\xappto\cbx@savedkeys{\thefield{entrykey},}}
{\multinamedelim}
{\usebibmacro{ay:textcite:postnote}%
\protected@xappto\cbx@savedcites{{\cbx@savedkeys}}}
\DeclareCiteCommand{\superfootcite}[\cbx@wrap]
{\gdef\cbx@keys{}\citetrackerfalse}
{\xappto\cbx@keys{\thefield{entrykey},}}
{}
{\ifcsundef{cbx@lastin@\cbx@keys @\strfield{postnote}}
{\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{-1}}{}%
\ifsamepage{\value{instcount}}{\csuse{cbx@lastin@\cbx@keys @\strfield{postnote}}}
{\footnotemark[\csuse{cbx@lastfn@\cbx@keys @\strfield{postnote}}]}
{\xappto\cbx@cite{\noexpand\footcite%
[\thefield{prenote}][\thefield{postnote}]{\cbx@keys}%
\csnumgdef{cbx@lastfn@\cbx@keys @\strfield{postnote}}{\value{\@mpfn}}%
\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{\value{instcount}}}}}
\newrobustcmd{\cbx@wrap}[1]{#1\cbx@cite\gdef\cbx@cite{}}
\def\cbx@cite{}
\makeatother
\begin{document}
Lorem \etextcite[cf.][12]{sigfridsson} ipsum \etextcite{geer}
dolor \etextcite{sigfridsson} sit \etextcite{geer} amet \etextcite{wilde}.
\end{document}