Skip to content

Add biblatex numeric bibliography style#10

Open
nvooijs wants to merge 5 commits into
EPTCS:mainfrom
nvooijs:main
Open

Add biblatex numeric bibliography style#10
nvooijs wants to merge 5 commits into
EPTCS:mainfrom
nvooijs:main

Conversation

@nvooijs

@nvooijs nvooijs commented Apr 29, 2026

Copy link
Copy Markdown

An attempt at issue #6.

Adds a BibLaTeX numeric bibliography style based the EPTCS bibliography documentation https://biblio.eptcs.org/ and the example output of the BibTeX implementation https://cgi.cse.unsw.edu.au/~eptcs/example.pdf#page.4.

Deviations from BibTeX style

I focused on the spirit of the bibliography style; bit-for-bit compatibility is not possible anyway due to differences between the bibtex and biblatex datamodel.

For example, in the biblatex datamodel an @inbook is like an @inproceedings: an independent part of a book, with its own title and (usually) its own authors. Thus, I implemented it as an alias to @inproceedings.

There is one main difference between my implementation and what the documentation specifies: I did put all links (that is dois, eprints and urls) in \texttt. I can change this if you like, but I really suggest you consider putting these items in typewriter (\texttt) or sans serif (\textsf) font; a url or long doi in standard font looks pretty ugly to me, and, more importantly, is quite unreadable, in my opinion.

Usage

Pass bibstyle=eptcs-numeric to BibLaTeX. For automatically turning first names into initials, pass giveninits.

\usepackage[bibstyle=eptcs-numeric,giveninits]{biblatex}
\addbibresource{references.bib}

\begin{document}
    \nocite{*}
    \printbibliography
\end{document}

Example output

For generic.bib the output is attached. I modified the .bib file slightly; most importantly key should not be used (since in BibLaTeX it is the sortkey, so it overrides the default sorting), and edition should be either an integer or a full textual description (so 2 for a second edition, but "The Second and Revised Edition"), but never "Second". The modified generic.bib is also attached.

Future

The BibLaTeX datamodel vastly extends the BibTeX one, and currently only very little extra information is rendered. I implemented subtitles (and journalsubtitles, booksubtitles), and in the notes part of the reference I render translation information (e.g. "Translated from the Russian by J. Doe", using origlanguage and translator) (since I have a need for this feature). I suppose the style can be extended and modified as needs occur.

@k4rtik k4rtik self-requested a review May 5, 2026 12:02

@k4rtik k4rtik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Could you also update the Makefile targets such as dist to include these new files? It might also help to have an example-biblatex.tex that demonstrates how to use the template along with a new make target.

I noticed a few discrepancies in the rendering of References:

  1. Organization is missing in @inproceedings and @proceedings, also note the difference in the entries vs the original:

Original:

Image

PR:

Image

Specifically, @proceedings should include the editors not authors.

  1. @phdthesis, @mastersthesis, and @manual all print the number field (PhD thesis 21, Master's thesis 21, Type 21), whereas the existing EPTCS BibTeX style does not treat them as numbered technical reports. See

Original:

Image

PR:

Image
  1. Some initials are incorrect, e.g. "Stack Exchange" -> "S.E." and "R.J. van Glabbeek" -> "R. van Glabbeek".

There might be other variations but these are the ones that stood out to me. Could you ensure these and other discrepancies from the original are fixed and I will take another pass at reviewing?

Niels and others added 2 commits May 6, 2026 15:46
* Add organization in proceedings-like entry types
* Remove number from theses and manuals
@nvooijs

nvooijs commented May 7, 2026

Copy link
Copy Markdown
Author

Thank you for the comments. I fixed issues 1 and 2 in the style file (I thought I had already fixed 2 previously, but I had used a wrong \if... command). Issue 3 was caused by issues with the .bib file, not the style. I improved the .bib file for use with biblatex and committed it (generic-biblatex.bib) together with an example usage file example-biblatex.tex.

What is your opinion on the doi, eprint and url font?

@k4rtik

k4rtik commented May 18, 2026

Copy link
Copy Markdown
Member

Sorry, it will take me some time to review the changes in detail.

What is your opinion on the doi, eprint and url font?

I personally prefer them to be \texttt. @rvglabbeek do you have any objections to switching to monospace fonts for these fields?

@rvglabbeek

Copy link
Copy Markdown

Hi K4rtik, thanks for alerting me; I had not spotted this conversation yet. No, I do not have any objections to the use of monospace fonts for doi, eprint and url.

@k4rtik k4rtik self-requested a review May 20, 2026 09:42
k4rtik

This comment was marked as resolved.

@k4rtik

k4rtik commented May 20, 2026

Copy link
Copy Markdown
Member

I am also including a patch with all the suggestions: fix_alignment.patch

* Resolve warnings
* Correct author rendering for collections (ignore author)
* Mandate author for articles, incollections, theses
* Do abbreviate page/pages
* Add organization and edition to manuals
@nvooijs

nvooijs commented May 26, 2026

Copy link
Copy Markdown
Author

1, 4, 5, 8, 9: Solved

2, 3: Hallucinated. However, there is an underlying issue, I don't print the chapter field yet; it is a bit problematic for reasons I'll follow up on.

6, 7: The biblatex documentation indicates that the number within a series for a book must be given in the number field, not the volume field. volume is the volume of n item in a multi-volume work, not the volume in a series. So I think the current behaviour is correct. I think we should adhere to biblatex's datamodel, so a .bib file written for use with biblatex can be used without modification with our style. That is one of the major advantages of providing a biblatex style to begin with.

@nvooijs

nvooijs commented May 27, 2026

Copy link
Copy Markdown
Author

So to comment on the chapter issue:

In the biblatex documentation, the chapter field is documented as follows:

chapter field (literal)
A chapter or section or any other unit of a work.

So it can refer to a part, chapter, section, subsection, etc. The field is literal and there is no field for describing the chapter kind (part, chapter, section, ...), so it could for example be

chapter = {section 2.1}

or

chapter = {chapter 2}

Now, if you specify this on a @book entry, it is clear what it means: you cite a chapter in this book. But for an @inbook it is ambiguous: it could either be that you cite a section in the inbook, or it could mean that the inbook is that chapter in the book that contains it. In the first case, it should be rendered as part of the first part of the reference, i.e.

J. Doe (2026): \textit{A Chapter from the Handbook}, section 2.1, pp. 123 -- 137. In E. Tor: \textsl{The Handbook} [...]

but in the latter case it should be part of the second part, i.e.

J. Doe (2026): \textit{A Chapter from the Handbook}. In E. Tor: \textsl{The Handbook}, Publisher, chapter 2, pp. 110 -- 150, doi:DOI.

Note that for pages we have the same problem. Citing the EPTCS bibliography style webpage:

Note that there is a semantic difference between page numbers in the first sentence and page numbers in the second.

My proposal would be to only allow chapter on @inbook and @incollection, and always interpret it in the latter way, i.e. indicating which chapter an inbook or incollection is in the book or collection that contains it. If it is an integer, we can prefix the "chapter" automatically, if it is a string literal we print it as is.

The reason to assume chapter indicates which chapter the inbook is in a book is that the other use is controversial. Citing the biblatex manual:

Whether a bibliography should at all include references to chapters or sections is controversial because a chapter is not a bibliographic entity.

(This would be consistent with how I handle pages currently, and the rendering of pages gives the same output as the bibtex style on the test file.)

(Maybe cc @rvglabbeek since this is a question about style.)

@k4rtik k4rtik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am including a patch that handles all the issues I identified and fixed with the help of Gemini/Antigravity.

If you choose to apply this patch, you can ignore my inline suggestions as part of the review.

biblatex.patch

Here's the final rendering:

Image
Changes Made

1. Style Package Enhancements (eptcs-base.bbx)

  • Dedicated Modern Drivers (@online, @software, @dataset): Instead of aliasing modern entry types to @misc (which would ignore key fields), we implemented dedicated drivers to render them naturally:
    • @online: Correctly prints author/editor, title, date, URL, and the formatted access date (urldate).
    • @software: Supports printing the version, organization, and publisher lists, as well as URL/DOI details.
    • @dataset: Supports printing version, publisher, and DOI/URL details.
  • Sourcemap Correction: Fixed the \DeclareSourcemap configuration to use \pertype{proceedings} and \pertype{mvproceedings} instead of a typesource step. The previous configuration was clearing the entry type completely in Biber's output, generating the Package biblatex Warning: No driver for '' warning and fallback errors.
  • Dedicated @booklet Driver: Created a dedicated @booklet driver that properly prints the howpublished and address (location) fields, matching the original BibTeX booklet behavior.
  • Dedicated @unpublished Driver: Created a dedicated @unpublished driver that ignores the howpublished field (which is not supported on unpublished entries in eptcs.bst).
  • @inbook Driver Field Order & Punctuation: Corrected the inbook driver field order to print pages immediately after chapter+type (separated by a comma), followed by a block period and the series/publisher details, aligning exactly with the inbook function in eptcs.bst.
  • Chapter Formatting & Double Prefixing: Redefined the chapter field format to raw (#1) and created a custom chapter+type macro to format the fields sequentially, preventing double-prefixing.
  • Dedicated Drivers for Book/Collection Sections: Created dedicated @inproceedings and @incollection drivers, separating them from the previous combined alias. This correctly restricts edition and chapter fields from @inproceedings while enabling them on @incollection.
  • Editor Fallback for @inbook: Added support for inbooklike author formatting in the entryauthor macro, which falls back to editors when the author field is empty (matching inbookE rendering).
  • Volume to Number Fallback: Redefined series+number to fall back to the volume field if number is missing. This prevents LNCS-style volume numbers from disappearing.
  • Dedicated @manual Driver: Implemented a dedicated driver for @manual entries to properly print the organization list and address fields, while omitting the series and number fields to match the BibTeX template behaviour.
  • Dedicated @proceedings Driver: Defined a dedicated @proceedings driver separate from @collection to omit printing the edition field, matching the original BibTeX template behavior.
  • Misc Driver Conditional Type Check: Added a conditional check so that the type field is only printed for actual @misc entries.
  • Eprint Format Typo Correction: Discovered that lines 105 to 110 in eptcs-base.bbx had prefixing colons in eprint types (e.g. :arxiv), causing double colons during macro generation. We removed the colon prefix from the type names and updated the \DeclareEprintFieldFormat macro definition to use \ifstrempty{#1} for properly mapping empty formatting fallbacks.

2. Database Cleanup & Example Expansion

  • Modern Entries in generic-biblatex.bib: Appended three modern example entries (latexproject of type @online, numpy of type @software, and climate_data of type @dataset) to demonstrate correct formatting of modern BibLaTeX features.
  • Citations in example-biblatex.tex: Added a "Modern Entry Types" section and cited all three new entries to verify they render correctly in the bibliography.
  • Security Improvements: Replaced insecure http:// URLs with https:// for both bibliographystylewebpage and multipleauthors entries.
  • Removed Workarounds: Reverted the database workarounds in inbookA, inbookE, proceedings, inproceedings, and incollection back to the original VOLUME fields.

Comment thread generic-biblatex.bib Outdated
Comment thread generic-biblatex.bib Outdated
Comment thread generic-biblatex.bib
Comment on lines +111 to +113
@INBOOK{inbookE,
noAUTHOR = "A. Ut and H. Or and Co Author",
EDITOR = "E. D. I. Thor and E. di Thor",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this entry should list the editors first:

Image

Add inbooklike author logic in eptcs-base.bbx in entryauthor macro (see my inline comment there) so that @inbook entries with empty authors can fall back to editors at the start of the reference, matching the behavior of BibTeX:

Image

Also note other discrepancies.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an inbook/incollection is missing the author field than that is an error in the database I think (unless it was meant as anonymous/unknown authors, but then rendering the editors instead is wrong). I now changed the code to emit \textbf{??} for the missing authors, plus a warning in the log. I think that is a better solution than silently rendering the inbook/incollection as if it was a book/collection instead.

(Note that according to the biblatex documentation, an inbook or incollection is a work within a book or collection (the main work) respectively, with authors separate from those of the main work. So not specifying author is almost certainly an error in the database.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me.

Comment thread eptcs-base.bbx Outdated
Comment thread eptcs-base.bbx Outdated
Comment thread eptcs-base.bbx Outdated
Comment thread eptcs-base.bbx
\usebibmacro{finentry}%
}
\DeclareBibliographyAlias{thesis}{report}
\DeclareBibliographyAlias{manual}{report}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a dedicated manual driver instead of aliasing to report.

  1. Aliasing it incorrectly prints the type field (which is ignored in BibTeX).

  2. \printfield{organization} was being used (see suggestion on line 395 above), but organization is a list, not a field, in BibLaTeX (so it fails to print). Implementing a dedicated manual driver solves both issues.

@nvooijs nvooijs Jun 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like the code duplication a separate driver would entail, but I can change it if you prefer a separate driver instead of a few ifs.

I fixed the second issue.

Regarding the first, I thought it might make sense to actually print the type field if the database provides one. So you could specify something like user manual, package documentation (the manual of a latex package for example), code documentation (documented source code of a latex package) or API documentation.

Note that manual is described in the biblatex documentation as

Technical or other documentation, not necessarily in printed form.

so it is quite broad, and type could really help making the bibliography entry clearer. Also biblatex lists the type field as an optional field for manual.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, sounds good.

Comment thread eptcs-base.bbx Outdated
@k4rtik

k4rtik commented May 31, 2026

Copy link
Copy Markdown
Member

Addressing the concerns you raised:

Onseries+number fallback:

While it is correct that the BibLaTeX datamodel uses number for series volume/number, many authors will compile papers using existing .bib files where the series volume is set in volume = {443} (following traditional BibTeX conventions for LNCS, LIPIcs, etc.). Under the current PR code, these volume numbers completely disappear from the references. To support seamless backward compatibility, we can implement a fallback that checks number first, and if undefined, falls back to volume. This accommodates legacy databases without violating standard BibLaTeX datamodel compliance for new files. My patch includes this.

On chapter+type rendering:

To implement your proposal for chapter formatting while preventing double-prefixing (e.g., rendering Type (of chapter) chapter II), we can redefine the chapter field format to output the raw value and use a custom chapter+type macro:

\DeclareFieldFormat{chapter}{#1}

\newbibmacro*{chapter+type}{%
    \iffieldundef{chapter}
        {}
        {%
            \iffieldundef{type}
                {\bibstring{chapter}}
                {\printfield{type}}%
            \setunit{\addspace}%
            \printfield{chapter}%
        }%
}

When we print this in the @incollection and @inbook drivers (but omit it from the @inproceedings driver), it aligns with the BibTeX formatting and resolves the ambiguity exactly as you proposed. Again, included in the patch.

… fix some more issues

* Implement proposed chapter rendering for inbook/incollection
* Set booktitle slanted instead of italic
* Add language to the notes if it is not the document language
* Don't truncate long author lists in the bibliography
* Fix rendering of eprint
* Issue warning when mandatory author or editor is missing,
  and render bold question-marks in place of the missing field
* Fix organization rendering for manual
* If `series` and `volume` are given but `number` is missing,
  fall back to `volume` and issue a warning
* Separate out inproceedings driver
* Render edition for inbook/incollection
@nvooijs

nvooijs commented Jun 8, 2026

Copy link
Copy Markdown
Author

Yes, volume as a fallback if series is provided but number is not makes a lot of sense. I implemented this, but also issue a warning (in the log), since it is technically an error in the database.

Regarding chapter, I implemented my proposal (which does not involve type). If you have chapter = {2} or chapter = {2} in the database I prefix the word chapter, so you get chapter II or chapter 2 respectively, but if the contents of chapter is not a number, e.g. chapter = {section 2.1} then I print the text as-is. (Note that the biblatex documentation describes chapter as a literal, not an integer, so the latter is definitely a valid database entry.)

Biblatex does not have a field for the chapter type. I am quite strongly opposed to reusing type for it; type has a completely different meaning in biblatex.

type (key): The type of a manual, patent, report, or thesis.

We could add a non-standard field, say chaptertype (literal), to the datamodel and then use that if it is provided, and otherwise fall back to the rendering of chapter as I described above (and implemented).

@k4rtik k4rtik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some suggestions that I'd like to be included as part of this PR before approving.

I'd have preferred inclusion of the Dedicated Modern Drivers like online/software/dataset that I included in my previous review. But I am happy to go forward and add them myself after your PR is merged.

Comment thread generic-biblatex.bib
Comment on lines +111 to +138
@INBOOK{inbookE,
noAUTHOR = "A. Ut and H. Or and Co Author",
EDITOR = "E. D. I. Thor and E. di Thor",
ORGANIZATION = "Organization",
TITLE = "Title B2: An Inbook with editors",
BOOKTITLE = "Booktitle",
TYPE = "Type (of chapter)",
CHAPTER = "II",
EDITION = 2,
YEAR = "1987",
MONTH = 1,
PAGES = "1-999",
EID = "4",
JOURNAL = "Jounal",
INSTITUTION = "Institution",
SCHOOL = "School",
HOWPUBLISHED = "Howpublished",
PUBLISHER = "Publisher",
ADDRESS = "Address",
SERIES = "Series",
noVOLUME = "443",
NUMBER = "21",
DOI = "10.4204/EPTCS",
eprint = {2042.12345},
eprinttype = {arxiv},
noURL = "https://ntrs.nasa.gov/citations/20205011579",
NOTE = "Note"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@INBOOK{inbookE,
noAUTHOR = "A. Ut and H. Or and Co Author",
EDITOR = "E. D. I. Thor and E. di Thor",
ORGANIZATION = "Organization",
TITLE = "Title B2: An Inbook with editors",
BOOKTITLE = "Booktitle",
TYPE = "Type (of chapter)",
CHAPTER = "II",
EDITION = 2,
YEAR = "1987",
MONTH = 1,
PAGES = "1-999",
EID = "4",
JOURNAL = "Jounal",
INSTITUTION = "Institution",
SCHOOL = "School",
HOWPUBLISHED = "Howpublished",
PUBLISHER = "Publisher",
ADDRESS = "Address",
SERIES = "Series",
noVOLUME = "443",
NUMBER = "21",
DOI = "10.4204/EPTCS",
eprint = {2042.12345},
eprinttype = {arxiv},
noURL = "https://ntrs.nasa.gov/citations/20205011579",
NOTE = "Note"}

Since we are going to print "??" for this entry, let's remove it from the sample.

Comment thread eptcs-base.bbx
\ifnumeral{#1}
{\bibstring{chapter}~#1}
{#1\isdot}%
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
\DeclareFieldFormat{volume}{#1}

We should add a raw field format for volume here. Without it, the new series volume fallback prints with BibLaTeX's default "volume" prefix, rendering as Series volume 443 instead of Series 443. Defining this raw format keeps the series volume formatting clean and aligned with EPTCS BibTeX output.

Comment thread eptcs-base.bbx
\usebibmacro{notes}%
\usebibmacro{finentry}%
}
\DeclareBibliographyAlias{inbook}{incollection}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\DeclareBibliographyAlias{inbook}{incollection}
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author+year+title}[incollectionlike]%
\newunit
\printfield{edition}%
\newunit
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\newunitblock
\usebibmacro{series+number}%
\newunit
\usebibmacro{publisher+location}%
\newunitblock
\usebibmacro{doi+eprint+url}%
\newunitblock
\usebibmacro{notes}%
\usebibmacro{finentry}%
}

Instead of aliasing inbook to incollection, we should define a dedicated @inbook driver. Under EPTCS style, @inbook entries should not print the "In: Booktitle" prefix (unlike @incollection).

By using a dedicated driver that calls [incollectionlike], we format @inbook entries cleanly without the "In: Booktitle" prefix while enforcing that they must have a defined author (correctly throwing warnings and rendering ?? if the author is missing, which aligns with standard BibLaTeX conventions for @inbook).

@nvooijs

nvooijs commented Jul 13, 2026

Copy link
Copy Markdown
Author

Sorry for the long silence, I am very busy at the moment. I'll try to get back to this in two weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants