Code Monkey home page Code Monkey logo

Comments (8)

hushidong avatar hushidong commented on September 17, 2024

from gbt7714-bibtex-style.

hushidong avatar hushidong commented on September 17, 2024

若无法解决,可发mwe给我或作者。

from gbt7714-bibtex-style.

zepinglee avatar zepinglee commented on September 17, 2024

使用 \usepackage[sectionbib]{chapterbib} 后需要给 natbib 传递选项 sectionbib,可以通过 \usepackage[sectionbib]{gbt7714}

from gbt7714-bibtex-style.

CSQ223 avatar CSQ223 commented on September 17, 2024

使用 \usepackage[sectionbib]{chapterbib} 后需要给 natbib 传递选项 sectionbib,可以通过 \usepackage[sectionbib]{gbt7714}
@zepinglee
I tried to do as you proposed but failed. Can you show me in the attached file?
Thank you a lot.
sectionbib.tar.gz

from gbt7714-bibtex-style.

muzimuzhi avatar muzimuzhi commented on September 17, 2024

@CSQ223
根据 chapterbib 宏包文档,你需要在每一个子文件中使用一次 \bibliographystyle

具体到你的例子,可以这么做:

  • 准备部分
    1. 执行 xelatex review
    2. 在生成的 review.aux 中搜索 \bibstyle,搜到 \bibstyle{gbt7714-unsrt},复制参数 gbt7714-unsrt
      (这样省去了人工判断 gbt7714 加载了哪个 bst 文件的功夫)
    3. \bibliographystyle{gbt7714-unsrt} 粘贴到 sec1.texsec2.tex
    4. 如果以后更改了 gbt7714 宏包的选项,就要重复上述三个步骤
  • 执行部分
    1. 执行一次 xelatex review
    2. 进入 body 文件夹,分别执行 bibtex sec1bibtex sec2
    3. 回到主目录,执行两次 xelatex review

单独使用 gbt7714 宏包时,它会根据传入的宏包选项,在主文件中自动加载对应的 bst 文件。这是 gbt7714 宏包文档中明确指出「不需要使用 \bibliographystyle」的原因。但以 gbt7714 目前的实现,在与 chapterbib 配合使用时,仍需要用户在子文件中手动使用 \bibliographystyle


相关文档:texdoc chapterbib, Introduction

The main point is to allow you to use BibTeX: Each included file should have its own \bibliographystyle and \bibliography commands, and you should run bibtex on each included file separately rather than on the main or root file.

from gbt7714-bibtex-style.

muzimuzhi avatar muzimuzhi commented on September 17, 2024

我在分支 https://github.com/muzimuzhi/gbt7714-bibtex-style/tree/support-chapterbib 做了一些修改:

  • 宏包加载时不再使用 \bibliographystyle{<bst file>},而是把 <bst file> 储存在 \gbt@bib@stylename
  • 每次使用 \bibliography{<bib file>} 都额外执行 \bibliography{\gbt@bib@stylename},向 aux 文件写入 \bibstyle{<bst file>} 信息

总体,兼容 gbt7714 宏包现有功能不变,简化了与 chapterbib 宏包的搭配使用(免去了在子文件中手动使用 \bibliographystyle)。

注意:目前的实现依赖 \bibliography 定义中直接包含 \immediate\write\@auxout

from gbt7714-bibtex-style.

zepinglee avatar zepinglee commented on September 17, 2024

@CSQ223
根据 chapterbib 宏包文档,你需要在每一个子文件中使用一次 \bibliographystyle

具体到你的例子,可以这么做:

  • 准备部分

    1. 执行 xelatex review
    2. 在生成的 review.aux 中搜索 \bibstyle,搜到 \bibstyle{gbt7714-unsrt},复制参数 gbt7714-unsrt
      (这样省去了人工判断 gbt7714 加载了哪个 bst 文件的功夫)
    3. \bibliographystyle{gbt7714-unsrt} 粘贴到 sec1.texsec2.tex
    4. 如果以后更改了 gbt7714 宏包的选项,就要重复上述三个步骤
  • 执行部分

    1. 执行一次 xelatex review
    2. 进入 body 文件夹,分别执行 bibtex sec1bibtex sec2
    3. 回到主目录,执行两次 xelatex review

单独使用 gbt7714 宏包时,它会根据传入的宏包选项,在主文件中自动加载对应的 bst 文件。这是 gbt7714 宏包文档中明确指出「不需要使用 \bibliographystyle」的原因。但以 gbt7714 目前的实现,在与 chapterbib 配合使用时,仍需要用户在子文件中手动使用 \bibliographystyle

相关文档:texdoc chapterbib, Introduction

The main point is to allow you to use BibTeX: Each included file should have its own \bibliographystyle and \bibliography commands, and you should run bibtex on each included file separately rather than on the main or root file.

@muzimuzhi 提供的解决方案非常正确。

另外 -unsrt-plain 两个后缀的命名有些让人困惑,在下个版本中会换成 -numerical-author-year,见 #49 (comment)

from gbt7714-bibtex-style.

muzimuzhi avatar muzimuzhi commented on September 17, 2024

另外 -unsrt-plain 两个后缀的命名有些让人困惑

同意

from gbt7714-bibtex-style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.