使用给出的示例这里(第 3 部分),我希望\autocite
命令生成两列部分引用列表。
下面的 MWE 无法编译。我收到以下错误:
LaTeX Error: \begin{description} on input line 81 ended by \end{multicols}.
通过删除description
环境或multicol
环境,它可以编译。我怎样才能使用两个环境进行编译?
\documentclass{article}
\usepackage{multicol}
\usepackage{filecontents}
\begin{filecontents}{jobname.bib}
@Book{Goossens2003,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
date = {2003},
title = {The LATEX companion},
edition = {[Nachdr.]},
isbn = {0201775913},
location = {Boston},
pagetotal = {528},
publisher = {Addison-Wesley},
series = {Addison-Wesley series on tools and techniques for computer typesetting},
}
@Article{Knuth1984,
author = {D. E. Knuth},
date = {1984-02},
journaltitle = {The Computer Journal},
title = {Literate Programming},
doi = {10.1093/comjnl/27.2.97},
number = {2},
pages = {97--111},
volume = {27},
publisher = {Oxford University Press ({OUP})},
}
\end{filecontents}
\usepackage{biblatex}
\addbibresource{jobname.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=doi, null]
}
}
}
\newbibmacro*{fajycite}{%
\iffieldundef{shorthand}
{\printnames{labelname}%
\setunit*{\space}%
\printtext[bibhyperref]{%
\printdate}%
\setunit*{\addcolon\space}%
\printfield[citetitle]{labeltitle}%
\addperiod%
}
{\usebibmacro{cite:shorthand}}%
}
\DeclareCiteCommand{\fajycite}
{\usebibmacro{prenote}%
\begin{multicols}{2}%
\begin{description}\item%
}
{\usebibmacro{citeindex}%
\usebibmacro{fajycite}}
{\item
}
{\usebibmacro{postnote}%
\end{description}%
\end{multicols}%
}
\DeclareMultiCiteCommand{\fajycites}{\fajycite}{}
\DeclareAutoCiteCommand{fajy}{\fajycite}{\fajycites}
\ExecuteBibliographyOptions{autocite=fajy}
\let\myautocite\autocite
\renewcommand{\autocite}{\noindent\myautocite}
\begin{document}
\autocite{Goossens2003, Knuth1984}
\end{document}