A standalone bibliography file, and conversions to and from BibTeX

オープン
#3,265 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
python, xml
領域
tooling

調査の方向性

Start with the existing experiment: the pretext-biblios template in xsl/pretext-assembly.xsl and examples/sample-article/bibliography.xml, then check how references and xref are handled in the schema and Guide. The issue is a design proposal with five open questions, so the first deliverable is a settled specification for file naming, citation filtering, ordering, conversion entry points, and lossy BibTeX fields. Done means those decisions are recorded and a concrete implementation plan points to the affected stylesheets and tests.

索引モデルが issue の本文から書いたものです。

説明

Two related suggestions, as a next step in the bibliography work of #2208.

(a) A standalone bibliography file

An author's bibliography entries would live in a file of their own, separate from the document, the way a BibTeX .bib file does. The file would be PreTeXt XML: a collection of biblio elements, each with an @xml:id, in the CSL-style form added in #2969. A document names the file, cites its entries with xref exactly as now, and the references division is built from the file.

This lets one bibliography serve several documents, such as a book and the papers around it. It keeps hundreds of entries out of the document's source. And it gives other tools one well-defined file to read and write.

An experiment from 2020 already does part of this. It came in with e8977a78cb10f3c86aefc6c44a3017517174e604, and today it is a template in xsl/pretext-assembly.xsl. A references in the backmatter with a @source attribute reads a file whose root element is pretext-biblios, and takes from it each biblio that some xref points to, in the order of the file. It still runs on master (a9988c9d0): with source="bibliography.xml" added to the back-matter references of the sample article, the two cited entries of examples/sample-article/bibliography.xml appear and the two uncited ones do not. But it is in neither the schema nor the Guide, the entries it brings in replace any authored inside that references, and its own comment says it "needs a rethink when revisited".

(b) Conversions to and from BibTeX

  • From BibTeX. A .bib file becomes a PreTeXt bibliography file. Many authors arrive with a .bib file from their LaTeX projects, and reference managers export the format.
  • To BibTeX. A PreTeXt bibliography file becomes a .bib file, for a co-author or a journal working in LaTeX.

citeproc-py, which PreTeXt already uses to format CSL-style entries, includes a reader for BibTeX files. PreTeXt does not use that reader today; it may be a start on the first direction.

Questions to settle

  1. Where a document names its bibliography file: an attribute on references, as the experiment does, or docinfo, or the publication file.
  2. Whether only cited entries appear, as with BibTeX and the experiment, or an author can also ask for every entry in the file.
  3. The order of the entries: the order of the file, as the experiment does, or the order the citation style calls for.
  4. Where the conversions live, and how an author runs them.
  5. What to do with what does not survive a conversion: LaTeX markup inside BibTeX fields, @string abbreviations, cross-references between entries, and fields outside the current CSL-style vocabulary.

Claude Opus 5.5, acting as a coding assistant for Rob Beezer

主要言語
XSLT
スター
466
フォーク
251
平均マージ
4分
マージ済み PR(30日)
13

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PreTeXtBook/pretext のほかの issue

PreTeXtBook/pretext の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。