backtracking / bibtex2html

Other
97 stars 27 forks source link

Support for biber/biblatex? #31

Open ghost opened 3 years ago

ghost commented 3 years ago

Thank you for your excellent tool!

I wanted to ask whether support for biblatex files is planned? biblatex files are slightly different from bibtex, they allow braced expressions. In case of plainnat style, this results in mis-formatted citations. (They are "almost" correct, but not quite.)

Biblatex is slightly different from bibtex, there are no "aux" files, but it should be possible to create "empty" latex documents, with biblatex' preamble, run xelatex, and get the required bcf files, in order to run biber on them and get the bbl file. Afterwards, the process should be the same.

May this option be considered?

claudemarche commented 3 years ago

Hello

Jean-Christophe and I are not familiar with biber, although it appears that I had to use it recently.

Could you give us more details about the issues? Give some sample .bib file and tell why bibtex2html does not proceed with it correctly?

Le 09/02/2021 à 04:20, Lockywolf a écrit :

Thank you for your excellent tool!

I wanted to ask whether support for biblatex files is planned? biblatex files are slightly different from bibtex, they allow braced expressions. In case of |plainnat| style, this results in mis-formatted citations. (They are "almost" correct, but not quite.)

Biblatex is slightly different from bibtex, there are no "aux" files, but it should be possible to create "empty" latex documents, with biblatex' preamble, run xelatex, and get the required bcf files, in order to run biber on them and get the bbl file. Afterwards, the process should be the same.

May this option be considered?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/backtracking/bibtex2html/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6PRRFSHKBNC3QHIKJ4E7DS6CSXHANCNFSM4XKF3XIQ.

ghost commented 3 years ago

Sure.

File:

@Article{Abelson1989,
        author = {Harold Abelson and Michael Eisenberg and Matthew
                  Halfant and Jacob Katzenelson and Elisha Sacks and
                  Gerald J. Sussman and Jack Wisdom and Kenneth Yip},
        journaltitle = "Commun. {ACM}",
        title = "Intelligence in Scientific Computing",
        year = 1989,
        number = 5,
        pages = "546--562",
        volume = 32,
        bibsource = "dblp computer science bibliography,
                  https://dblp.org",
        biburl = "https://dblp.org/rec/journals/cacm/AbelsonEHKSSWY89.bib",
        DOI = "10.1145/63485.63486",
        file = "Full Text:abelson1989.pdf:PDF"
}

Build as: bibtex2html --style plainnat example.bib

Resulting html:

<td align="right" class="bibtexnumber">
 [<a name="Abelson1989">Abelson et&nbsp;al.(1989)Abelson, Eisenberg, Halfant, Katzenelson, Sacks,
 Sussman, Wisdom, and Yip</a>]
 </td>

Clearly, this is wrong. Full names shouldn't be appended to the date.

claudemarche commented 3 years ago

Le 09/02/2021 à 09:25, Lockywolf a écrit :

Sure.

File:

|@Article{Abelson1989, author = {Harold Abelson and Michael Eisenberg and Matthew Halfant and Jacob Katzenelson and Elisha Sacks and Gerald J. Sussman and Jack Wisdom and Kenneth Yip}, journaltitle = "Commun. {ACM}", title = "Intelligence in Scientific Computing", year = 1989, number = 5, pages = "546--562", volume = 32, bibsource = "dblp computer science bibliography, https://dblp.org", biburl = "https://dblp.org/rec/journals/cacm/AbelsonEHKSSWY89.bib", DOI = "10.1145/63485.63486", file = "Full Text:abelson1989.pdf:PDF" } |

Seems a perfectly regular Bibtex file to me. I don't understand your previous remark "biblatex files are slightly different from bibtex, they allow braced expressions"

Build as: |bibtex2html --style plainnat example.bib|

I assume here that you are using a style plainnat that is not designed for bibtex but for biber ? Is it the case ? (please give details, remind that I don't know how biber works)

claudemarche commented 3 years ago

As far as I can see:

https://www.bibtex.com/s/bibliography-style-natbib-plainnat/

appending the list of authors (sometimes, presumably when there more than two) to the citation key seems a feature of this plainnat style (a strange one I must admit).

I don't see any relation with bibtex versus biber.

I understand that it is annoying when producing the HTML version of your bibliography, but then why using this particular style plainnat if it not convenient?

Le 09/02/2021 à 09:32, Claude Marche a écrit :

Le 09/02/2021 à 09:25, Lockywolf a écrit :

Sure.

File:

|@Article{Abelson1989, author = {Harold Abelson and Michael Eisenberg and Matthew Halfant and Jacob Katzenelson and Elisha Sacks and Gerald J. Sussman and Jack Wisdom and Kenneth Yip}, journaltitle = "Commun. {ACM}", title = "Intelligence in Scientific Computing", year = 1989, number = 5, pages = "546--562", volume = 32, bibsource = "dblp computer science bibliography, https://dblp.org", biburl = "https://dblp.org/rec/journals/cacm/AbelsonEHKSSWY89.bib", DOI = "10.1145/63485.63486", file = "Full Text:abelson1989.pdf:PDF" } |

Seems a perfectly regular Bibtex file to me. I don't understand your previous remark "biblatex files are slightly different from bibtex, they allow braced expressions"

Build as: |bibtex2html --style plainnat example.bib|

I assume here that you are using a style plainnat that is not designed for bibtex but for biber ? Is it the case ? (please give details, remind that I don't know how biber works)

  • Claude
ghost commented 3 years ago

Yes, you are right. I am sorry for this report. What I wanted really, is just to get an "Author (year)" citation style. It indeed seems like a plainnat behaviour property. I am sorry for this report. But I'm really confused who would want anything like that. Especially since for many other styles it does not append author names to the year. Weird!

Sorry again.

ADD: One difference that is between bibtex and biblatex is the year and month fields in the former, and date field in the latter.

k4rtik commented 3 years ago

One difference that is between bibtex and biblatex is the year and month fields in the former, and date field in the latter.

I just ran into this issue. Would be nice to have support for biblatex style entries by default.

claudemarche commented 3 years ago

This a common misunderstanding : the set of meaningful fields is not hardcoded in bibtex or biber : the interpretation of fields is dependent of the selected style. So just select a style that interprets the year and month field

k4rtik commented 3 years ago

Sorry, I should have been more explicit.

In my case, I prepared my bib file for biblatex with no year/month fields, but only date fields; bibtex2html then complained that the year field is empty for most of the bibentries. I am not sure which style file supports date field for bibtex.

IMHO having native support for biblatex standard styles will help a lot of users like us.

claudemarche commented 3 years ago

Please provide sufficient data : a minimal .bib file and also a .tex file that illustrates how you expect the input to be.

k4rtik commented 3 years ago

Sure, thanks for reopening the issue. Here's a minimal bibentry with standard biblatex fields [1,2]:

@article{Hietala2021,
  author       = {Hietala, Kesha and Rand, Robert and Hung, Shih-Han and Wu, Xiaodi and Hicks, Michael},
  date         = {2021-01-04},
  journaltitle = {Proceedings of the ACM on Programming Languages},
  title        = {A Verified Optimizer for {{Quantum}} Circuits},
  doi          = {10.1145/3434318},
  issue        = {POPL},
  pages        = {37:1--37:29},
  urldate      = {2021-04-19},
  volume       = {5},
  shortjournal = {Proc. ACM Program. Lang.}
}

Here's the output:

$ bibtex2html test.bib
This is bibtex2html version 1.99, compiled on Mon Nov 16 10:32:21 GMT 2020
Copyright (c) 1997-2010 Jean-Christophe Filliâtre and Claude Marché
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)

Reading test.bib...ok (1 entries).
calling BibTeX...This is BibTeX, Version 0.99d (TeX Live 2020)
The top-level auxiliary file: bib2html26b1c9.aux
The style file: plain.bst
Database file #1: test.bib
Warning--empty journal in Hietala2021
Warning--empty year in Hietala2021
(There were 2 warnings)

Reading bib2html26b1c9.bbl...ok (1 entries)
Sorting...ok.
Making HTML document (test.html)...ok
Making HTML list of BibTeX entries (test_bib.html)...ok

The warnings do not apply to biblatex and the HTML output does not include the year:

[1] Kesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu, and Michael Hicks. A verified optimizer for Quantum circuits. 5:37:1--37:29. [ bib | DOI ]

I am currently only using bibtex2html to produce a large HTML bibliography for future reference (easy copy/pasting of bibentries and sharing), so there is no .tex file to show.

[1]: Cheatsheet: http://tug.ctan.org/info/biblatex-cheatsheet/biblatex-cheatsheet.pdf [2]: Doc: http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf which says:

2.3.9 Year, Month and Date The fields year and month are still supported by biblatex, but the full set of date features (day and time precision, ranges, …) can only be used with date. It is therefore recommended to prefer date over year and month unless backwards compatibility of the bib file with classical BibTeX is required.

k4rtik commented 2 years ago

Hi @claudemarche, does this example suffice?