我正在用 LaTeX 准备一份报告,并且我有很多参考文献想放到参考书目中。
我想知道是否可以根据主题对参考文献进行分组。我期望 LaTeX 输出类似以下内容:
[第1节]
[1] IEEE 标准
[2] 第一卷
[第二部分]
[3] 参考文献 1
[4] 参考文献 2
这样,当我们只阅读参考书目部分时会很有用,我们可以根据我们感兴趣的部分访问参考文献,而不必浏览所有参考文献。
答案1
您可以使用refsection
环境和section
选项来\printbibliography
选择参考部分。举个小例子:
\begin{filecontents*}{biblio.bib}
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The {LaTeX} Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {TeX} {A}rchive {N}etwork ({CTAN})",
year = "1993",
journal = "TUGBoat",
volume = "14",
number = "3",
pages = "342--351",
url=" www.ctan.org"
}
@book{knuth79,
author = "Donald E. Knuth",
title = "{TeX} and Metafont, New Directions in Typesetting",
year = "1979",
publisher = "American Mathematical Society and Digital Press",
address = "Stanford"
}
@book{lamport94,
author = "Leslie Lamport",
title = "{LaTeX}: A Document Preparation System",
year = "1994",
edition = "Second",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{patashnik88,
author = "Oren Patashnik",
title = "{BibTeX}ing. Documentation for General {BibTeX} users",
year = "1988",
howpublished = "Electronic document accompanying BibTeX
distribution"
}
@techreport{rahtz89,
author = "Sebastian Rahtz",
title = "A Survey of {T}e{X} and graphics",
year = "1989",
institution = "Department of Electronics and Computer Science",
address = "University of Southampton, UK",
number = "CSTR 89-7"
}
\end{filecontents*}
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{biblio.bib}
\defbibheading{subbibliography}{%
\section*{References for Section~\ref{refsection:\therefsection}}}
\begin{document}
\section{Test Section One}
\begin{refsection}
\cite{goossens93}, \cite{lamport94}, \cite{rahtz89}
\end{refsection}
\section{Test Section Two}
\begin{refsection}
\cite{greenwade93}, \cite{patashnik88}, \cite{knuth79}
\end{refsection}
\printbibliography[section=1,heading=subbibliography]
\printbibliography[section=2,heading=subbibliography]
\end{document}
答案2
这是另一个更加自动化的解决方案:
\documentclass[]{scrreprt}
\usepackage[autostyle]{csquotes}
\usepackage[
backend=biber,
% refsection=chapter,
refsegment=chapter,
sorting=none,
style=numeric
]{biblatex}
%\defbibheading{subbibliography}{%
% \section*{References for Section~\ref{refsection:\therefsection}}}
\defbibheading{subbibliography}{%
\section*{References for Segment~\ref{refsegment:\therefsection\therefsegment}}}
\addbibresource{biblatex-examples.bib}
\usepackage[]{hyperref}
\hypersetup{
colorlinks=true,
}
%% ##############################
\begin{document}
\chapter{Introduction}
Lorem ipsum dolor sit amet~\cite{sigfridsson}.
\chapter{Another Chapter}
At vero eos et accusam et justo duo dolores et ea rebum~\cite{kastenholz}.
\chapter{Conclusions}
Cite an author not previously cited~\cite{cicero}.
And then again cite some authoprs cited previously~\cite{kastenholz}.
Note: Alphabetcially, K comes before S.
At vero eos et accusam et justo duo dolores et ea rebum~\cite{sigfridsson}.
%\printbibliography
\printbibheading
% \bibbysection[heading=subbibliography]
\bibbysegment[heading=subbibliography]
\end{document}
它或多或少与 Gonzalo Medina 的答案相同,但是
- 使用
refsegment
而不是refsection
确保唯一标签 - biblatex 选项
refsegment=chapter
自动将每个标记\chapter{}
为refsegment
\bibbysegment
自动\printbibliography
为每个命令写入一个命令refsegment
biblatex 有很多使用示例,这里使用的命令或多或少直接复制自12-references-by-segment.tex