Add biblatex numeric bibliography style#10
Conversation
There was a problem hiding this comment.
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:
- Organization is missing in
@inproceedingsand@proceedings, also note the difference in the entries vs the original:
Original:
PR:
Specifically, @proceedings should include the editors not authors.
@phdthesis,@mastersthesis, and@manualall 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:
PR:
- 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?
* Add organization in proceedings-like entry types * Remove number from theses and manuals
|
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 What is your opinion on the doi, eprint and url font? |
|
Sorry, it will take me some time to review the changes in detail.
I personally prefer them to be |
|
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. |
|
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
|
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 |
|
So to comment on the chapter issue: In the biblatex documentation, the chapter field is documented as follows:
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 or Now, if you specify this on a but in the latter case it should be part of the second part, i.e. Note that for pages we have the same problem. Citing the EPTCS bibliography style webpage:
My proposal would be to only allow 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:
(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.) |
There was a problem hiding this comment.
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.
Here's the final rendering:
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 theversion,organization, andpublisherlists, as well as URL/DOI details.@dataset: Supports printingversion,publisher, and DOI/URL details.
- Sourcemap Correction: Fixed the
\DeclareSourcemapconfiguration to use\pertype{proceedings}and\pertype{mvproceedings}instead of atypesourcestep. The previous configuration was clearing the entry type completely in Biber's output, generating thePackage biblatex Warning: No driver for ''warning and fallback errors. - Dedicated
@bookletDriver: Created a dedicated@bookletdriver that properly prints thehowpublishedandaddress(location) fields, matching the original BibTeX booklet behavior. - Dedicated
@unpublishedDriver: Created a dedicated@unpublisheddriver that ignores thehowpublishedfield (which is not supported on unpublished entries ineptcs.bst). @inbookDriver Field Order & Punctuation: Corrected theinbookdriver field order to print pages immediately afterchapter+type(separated by a comma), followed by a block period and the series/publisher details, aligning exactly with theinbookfunction ineptcs.bst.- Chapter Formatting & Double Prefixing: Redefined the
chapterfield format to raw (#1) and created a customchapter+typemacro to format the fields sequentially, preventing double-prefixing. - Dedicated Drivers for Book/Collection Sections: Created dedicated
@inproceedingsand@incollectiondrivers, separating them from the previous combined alias. This correctly restricts edition and chapter fields from@inproceedingswhile enabling them on@incollection. - Editor Fallback for
@inbook: Added support forinbooklikeauthor formatting in theentryauthormacro, which falls back to editors when the author field is empty (matchinginbookErendering). - Volume to Number Fallback: Redefined
series+numberto fall back to thevolumefield ifnumberis missing. This prevents LNCS-style volume numbers from disappearing. - Dedicated
@manualDriver: Implemented a dedicated driver for@manualentries to properly print theorganizationlist and address fields, while omitting theseriesandnumberfields to match the BibTeX template behaviour. - Dedicated
@proceedingsDriver: Defined a dedicated@proceedingsdriver separate from@collectionto omit printing theeditionfield, matching the original BibTeX template behavior. - Misc Driver Conditional Type Check: Added a conditional check so that the
typefield is only printed for actual@miscentries. - Eprint Format Typo Correction: Discovered that lines 105 to 110 in
eptcs-base.bbxhad 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\DeclareEprintFieldFormatmacro 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 (latexprojectof type@online,numpyof type@software, andclimate_dataof 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 withhttps://for bothbibliographystylewebpageandmultipleauthorsentries. - Removed Workarounds: Reverted the database workarounds in
inbookA,inbookE,proceedings,inproceedings, andincollectionback to the originalVOLUMEfields.
| @INBOOK{inbookE, | ||
| noAUTHOR = "A. Ut and H. Or and Co Author", | ||
| EDITOR = "E. D. I. Thor and E. di Thor", |
There was a problem hiding this comment.
I believe this entry should list the editors first:
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:
Also note other discrepancies.
There was a problem hiding this comment.
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.)
| \usebibmacro{finentry}% | ||
| } | ||
| \DeclareBibliographyAlias{thesis}{report} | ||
| \DeclareBibliographyAlias{manual}{report} |
There was a problem hiding this comment.
Consider a dedicated manual driver instead of aliasing to report.
-
Aliasing it incorrectly prints the type field (which is ignored in BibTeX).
-
\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.
There was a problem hiding this comment.
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.
|
Addressing the concerns you raised: On While it is correct that the BibLaTeX datamodel uses On To implement your proposal for chapter formatting while preventing double-prefixing (e.g., rendering \DeclareFieldFormat{chapter}{#1}
\newbibmacro*{chapter+type}{%
\iffieldundef{chapter}
{}
{%
\iffieldundef{type}
{\bibstring{chapter}}
{\printfield{type}}%
\setunit{\addspace}%
\printfield{chapter}%
}%
}When we print this in the |
… 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
|
Yes, Regarding Biblatex does not have a field for the chapter type. I am quite strongly opposed to reusing
We could add a non-standard field, say |
k4rtik
left a comment
There was a problem hiding this comment.
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.
| @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"} | ||
|
|
There was a problem hiding this comment.
| @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.
| \ifnumeral{#1} | ||
| {\bibstring{chapter}~#1} | ||
| {#1\isdot}% | ||
| } |
There was a problem hiding this comment.
| } | |
| } | |
| \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.
| \usebibmacro{notes}% | ||
| \usebibmacro{finentry}% | ||
| } | ||
| \DeclareBibliographyAlias{inbook}{incollection} |
There was a problem hiding this comment.
| \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).
|
Sorry for the long silence, I am very busy at the moment. I'll try to get back to this in two weeks. |
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
@inbookis 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-numericto BibLaTeX. For automatically turning first names into initials, passgiveninits.Example output
For
generic.bibthe output is attached. I modified the.bibfile slightly; most importantlykeyshould not be used (since in BibLaTeX it is the sortkey, so it overrides the default sorting), andeditionshould be either an integer or a full textual description (so2for a second edition, but"The Second and Revised Edition"), but never"Second". The modifiedgeneric.bibis 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
origlanguageandtranslator) (since I have a need for this feature). I suppose the style can be extended and modified as needs occur.