我希望这是一个简单的问题。我终于弄清楚了如何让多个参考书目(大部分)按照我想要的方式工作。我想要的另一种格式是让“参考”标题居中。我现在得到的是标题“参考”左对齐。
这是我的代码:
{\documentclass[a4paper,12pt]{article}
\usepackage[backend=biber,natbib=true,citestyle=numeric-comp,bibstyle=authoryear,sorting=none,doi=false,url=false,isbn=false]{biblatex}
\addbibresource{simple_example.bib}
\title{Here is the title.}
\author{ John S. Doe }
\begin{document}
\maketitle
\include{Chapter01}
\printbibliography[section=1,heading=References]
\include{Chapter02}
\printbibliography[section=2,heading=References]
\end{document}
Chapter01.tex 的代码
\chapter{This is Chapter 01}
\begin{refsection}
Blah, blah, blah, ba-blah \cite{goossens93}.
Blah, blah, blah, ba-blah \cite{knuth79}.
\end{refsection}'
Chapter02.tex 的代码
\chapter{This is Chapter 02}
\begin{refsection}
Blah, blah, blah, ba-blah \cite{knuth79}.
Blah, blah, blah, ba-blah \cite{greenwade93,knuth79}.
\end{refsection}
bib 文件的代码如下:
% This file was created with JabRef 2.6.
% Encoding: ISO8859_1
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The Latex Companion A",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {T}ex {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"
}
答案1
您的示例代码不一致:您将其用作article
文档类,然后\chapter
在附属文件中使用。
无论如何,你可以使用\defbibheading
它来格式化参考书目标题;语法是
\defbibheading{<name>}[<title>]{<code>}
其中,是在选项<name>
中使用的标识符,应该是一些用于生成标题的 LaTeX 代码;有关详细信息,请参阅第节heading
\printbibliography
<code>
3.5.7 书目标题和环境手册biblatex
。
一个小例子,以所用的样式生成居中的标题“参考文献”,\chapter*
并处理运行标题:
\begin{filecontents*}{simpleexample.bib}
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The {LaTeX} {C}ompanion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {T}ex {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 {M}etafont, {N}ew {D}irections in {T}ypesetting",
year = "1979",
publisher = "American Mathematical Society and Digital Press",
address = "Stanford"
}
\end{filecontents*}
\documentclass[a4paper,12pt]{book}
\usepackage[backend=biber,natbib=true,citestyle=numeric-comp,bibstyle=authoryear,sorting=none,doi=false,url=false,isbn=false]{biblatex}
\addbibresource{simpleexample.bib}
\defbibheading{references}[\refname]{\chapter*{\centering#1}
\markboth{#1}{#1}}
\begin{document}
\chapter{This is Chapter 01}
\begin{refsection}
Blah, blah, blah, ba-blah \cite{goossens93}.
Blah, blah, blah, ba-blah \cite{knuth79}.
\end{refsection}
\printbibliography[section=1,heading=references]
\chapter{This is Chapter 02}
\begin{refsection}
Blah, blah, blah, ba-blah \cite{knuth79}.
Blah, blah, blah, ba-blah \cite{greenwade93,knuth79}.
\end{refsection}
\printbibliography[section=2,heading=references]
\end{document}