关于LaTex中分章节参考文献

LaTeX \LaTeX LATEX写书的时候,常常想每个章后面放该章的参考文献,而不是把所有章的参考文献放在整本书的后面。但目前没有特别简单的办法。

最初,我用的是TexStudio。

遇到的第一个问题是\usepackage{chapterbib}

很多帖子说要用到这个包,但是用``来安装这个包的时候,总是不成功,说库里找不到这个包。

tlmgr install: package chapterbib not present in repository.

但是在CTAN中是能搜到这个包的。这个包下载下来后的文件是cite.zip。但下载后我又不知道怎么手动安装。网上能搜到的教你怎么安装的都很“不友好”,根本学不会。
在这里插入图片描述
直到我搜到一个外文的帖子说

a “package” to tlmgr is a unit of files that are installed together. it does not necessarily relate directly to a latex “package” (it may just contain fonts, or a binary program, for example) In the case of color that is part of the texlive graphics package. (an easy way to see the texlive package any file is contained in is to look at the ctan page for the file … …

大概意思就是,usepackage是用的包,不一定就是安装包时包的名字,有时一些package是打包在一起叫了另外一个名字,得在CTAN上查到这个真正的包的名字,然后用tlmgr安装这个包。
于是我恍然大悟,赶紧试了一下

sudo tlmgr install cite

安装成功!tex文件中导言区的\usepackage{chapterbib} 下面的波浪线消失了。(如果下面有波浪线,说明包没安装)

按道理说,在每个Chapter的tex文件末尾写上

\bibliographystyle{plainnat} %参考文献,plain,unsrt,
\bibliography{ref/Cha3_ref}

再编译就能够为各章添加参考文献,但还是不行。似乎编译的时候需要先各章编译,然后再总体编译,比较麻烦,而TexStudio无法单独编译某一章的tex文件。

于是,我想到试一下Overleaf和slager这些在线的 LaTeX \LaTeX LATEX平台。首先将项目文件夹打包成.zip文件,然后上传到这些系统,运行,居然成功了!

因为在Overleaf的文档中说的很清楚:

If compiling on a local machine: Compiling your main document .tex will generate multiple .aux files, one for each chapter .tex file you had included. You must now run bibtex on all these .aux files, before compiling the main document .tex file again. Overleaf’s build tool, latexmk, will take care of all these processing steps automatically, so all you need to do is to click the “Recompile” button once.

Overleaf太贵。slagger价格可以接受。但在网上平台写latex的体验与TexStudio相比差太多。所以,我想还是先在TexStudio上写好,最后再到网上平台去编译生成pdf。

这篇文章似乎说了如何实现各章节的独立编译,但不想试了。暂时搬到slagger上写吧。希望TexStudio能够尽快更新,增加更好的管理大型项目的功能。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值