A standalone bibliography file, and conversions to and from BibTeX

Aperta
#3,265 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python, xml
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
XSLT
Stelle
466
Fork
251
Merge medio
4m
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PreTeXtBook/pretext

Tutte le issue di PreTeXtBook/pretext

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.