If you are using Biblatex, as for citing article titles, you can use it to produce bibliographies at the end of sections or chapters, or even have a combined bibliography where they are separated by chapter/section. As a package, it is intended to replace "babelbib, bibtopic, bibunits, chapterbib, cite, inlinebib, mlbib, multibib, splitbib."
You can put a bibliography after each section, in one of three ways. First, wrap the text of your section in a \begin{refsection}/\end{refsection} pair, as such
\section{SomeSectionName}
\begin{refsection}
% your text goes here
\printbibliography
\end{refsection}
\section{NextSection}
Second, after each \section statement you put a \newrefsection statement which ends the previous section and begins the new one. And, you precede the next \section with a \printbibliography statement, again. Finally, there is a refsection package option that takes either none, part, chapter, section, or subsection as an argument. To group your bibliographic entries per section in a global bibliography you use refsegment instead, using \bibbysegment to print all the segments in order. (\bibbysection can be used in the same manner for ref-sections, too.)
I don't know how much you'll have to split up your text, as per @Norman's answer, but with a little experimentation you can figure it out.
You will have to put each section in a separate .tex file which you then \include. You will have to run bibtex on each .tex file separately.
N.B. Using \input rather than \include avoids unwanted page breaks, but it will not create the .aux file that BibTeX needs to do its work. I looked at the definition of \include, and I don't see how to disable the page-breaking function except by disabling \clearpage entirely. You could try
Basically we perform surgery on the \include macro to get rid of all the \clearpage instances, but the cleanest way to do this, as you can see, is still really dirty. This is horribly brittle and will likely only work for the article class, so if you're using a different \documentclass, you're out of luck. I basically derived this by enabling \tracingcommands=1 and \tracingmacros=1 and grepping the .log file for \clearpage so that I could hack whatever gets called before it to insert a \@noclearpage.
I don't recommend this solution - it would be much better to look into how chapterbib works and fix it the right way, without depending on \include and the separate .aux files it generates... but I'm positive that would be a pretty difficult task. I guess another workaround would be to write a command to emulate \include's breaking up of .aux files, without actually doing the includes...
EDIT: okay, here's a quickie
\makeatletter
\newenvironment{auxfile}[1]{\relax
\ifnum\@auxout=\@partaux
\@latex@error{auxfile environments cannot be nested or \string\include d}
\@eha
\else\@changeaux{#1}\fi
}{\immediate\closeout\@partaux\let\@auxout\@mainaux}
\def\@changeaux#1{%
\immediate\write\@mainaux{\string\@input{#1.aux}}%
\let\@auxout\@partaux
\immediate\openout\@partaux#1.aux%
\immediate\write\@partaux{\relax}}
\makeatother
Then you can just insert \begin{auxfile}{foo}...\end{auxfile} and it will use foo.aux instead of the normal .aux file. This is fully compatible with chapterbib. I don't think CTAN has anything like this, so maybe I'll submit it as a mini-package.
发布评论
评论(4)
如果您使用 Biblatex,则 引用文章标题,您可以使用它在章节或章节末尾生成参考书目,或者甚至有一个按章/节分隔的组合参考书目。作为一个包,它旨在取代“babelbib、bibtopic、bibunits、chapterbib、cite、inlinebib、mlbib、multibib、splitbib”。
您可以通过以下三种方式之一在每个部分后放置参考书目。首先,将节的文本包装在
\begin{refsection}
/\end{refsection}
对中,如下所示其次,在每个
\section 语句,您放置一个
\newrefsection
语句,该语句结束上一节并开始新一节。并且,您再次在下一个\section
之前加上\printbibliography
语句。最后,有一个refsection
包选项,可以采用none
、part
、chapter
、section< /code> 或
subsection
作为参数。要将全局书目中每个部分的书目条目分组,请使用refsegment
代替,使用\bibbysegment
按顺序打印所有段。 (\bibbysection
也可以以相同的方式用于参考部分。)我不知道根据 @Norman 的回答,您需要将文本拆分多少,但是做一点实验你就可以弄清楚。
If you are using Biblatex, as for citing article titles, you can use it to produce bibliographies at the end of sections or chapters, or even have a combined bibliography where they are separated by chapter/section. As a package, it is intended to replace "babelbib, bibtopic, bibunits, chapterbib, cite, inlinebib, mlbib, multibib, splitbib."
You can put a bibliography after each section, in one of three ways. First, wrap the text of your section in a
\begin{refsection}
/\end{refsection}
pair, as suchSecond, after each
\section
statement you put a\newrefsection
statement which ends the previous section and begins the new one. And, you precede the next\section
with a\printbibliography
statement, again. Finally, there is arefsection
package option that takes eithernone
,part
,chapter
,section
, orsubsection
as an argument. To group your bibliographic entries per section in a global bibliography you userefsegment
instead, using\bibbysegment
to print all the segments in order. (\bibbysection
can be used in the same manner for ref-sections, too.)I don't know how much you'll have to split up your text, as per @Norman's answer, but with a little experimentation you can figure it out.
此外,
您还必须将每个部分放入单独的 .tex 文件中,然后
\include
。您必须分别对每个 .tex 文件运行bibtex
。注意:使用
\input
而不是\include
可以避免不必要的分页符,但它不会创建 BibTeX 完成其工作所需的 .aux 文件。我查看了\include
的定义,除了完全禁用\clearpage
之外,我不知道如何禁用分页功能。您可以在
\begin{document}
之后尝试,但您可能必须手动放入一些\originalclearpage
。In addition to
You will have to put each section in a separate .tex file which you then
\include
. You will have to runbibtex
on each .tex file separately.N.B. Using
\input
rather than\include
avoids unwanted page breaks, but it will not create the .aux file that BibTeX needs to do its work. I looked at the definition of\include
, and I don't see how to disable the page-breaking function except by disabling\clearpage
entirely. You could tryright after your
\begin{document}
, but you may have to put some\originalclearpage
in by hand.@celenius - 如果你真的想摆脱那个分页符,这里有一个非常脏技巧来做到这一点......
基本上我们对
\include
宏进行手术以获得摆脱所有\clearpage
实例,但最干净的方法,如您所见,仍然真的很脏。这是非常脆弱的,并且可能只适用于article
类,因此如果您使用不同的\documentclass
,那么您就不走运了。我基本上是通过启用\tracingcommands=1
和\tracingmacros=1
并 grep.log
文件来获取\clearpage 以便我可以破解在其之前调用的任何内容以插入
\@noclearpage
。我不推荐这个解决方案 - 最好研究一下
chapterbib
的工作原理并以正确的方式修复它,而不依赖于\include
和单独的>.aux
它生成的文件...但我确信这将是一项非常困难的任务。我想另一种解决方法是编写一个命令来模拟\include
对.aux
文件的分解,而不实际执行包含...EDIT: okay, here's a quickie
然后您只需插入
\begin{auxfile}{foo}...\end{auxfile}
,它将使用foo.aux
而不是正常的。 aux
文件。这与chapterbib
完全兼容。我认为 CTAN 没有这样的东西,所以也许我会将其作为迷你包提交。@celenius - if you really want to get rid of that pagebreak, here's a very dirty trick to do it...
Basically we perform surgery on the
\include
macro to get rid of all the\clearpage
instances, but the cleanest way to do this, as you can see, is still really dirty. This is horribly brittle and will likely only work for thearticle
class, so if you're using a different\documentclass
, you're out of luck. I basically derived this by enabling\tracingcommands=1
and\tracingmacros=1
and grepping the.log
file for\clearpage
so that I could hack whatever gets called before it to insert a\@noclearpage
.I don't recommend this solution - it would be much better to look into how
chapterbib
works and fix it the right way, without depending on\include
and the separate.aux
files it generates... but I'm positive that would be a pretty difficult task. I guess another workaround would be to write a command to emulate\include
's breaking up of.aux
files, without actually doing the includes...EDIT: okay, here's a quickie
Then you can just insert
\begin{auxfile}{foo}...\end{auxfile}
and it will usefoo.aux
instead of the normal.aux
file. This is fully compatible withchapterbib
. I don't think CTAN has anything like this, so maybe I'll submit it as a mini-package.我还没有尝试过,但当我读到它时,它表明:
虽然我只是猜测这些行的正确顺序。
I haven't tried it but as I read that it suggests:
though I'm only guessing at the correct order of those lines.