asciidoctor / asciidoctor-bibtex

Add bibtex citation support for asciidoc documents
Other
69 stars 27 forks source link

3+ consecutive citations hyphens #78

Open JurTam opened 3 years ago

JurTam commented 3 years ago

Dear Mr. Zhang Yang!

I assume I might be missing something in the readme. But as we discussed via email, I am still opening a new issue here, so anyone can benefit from the answers provided.

May I ask, is there a default way to have the gem:

(1) construct consecutive references like [1-3] instead of [1,2,3] and like [1,3-5] instead of [1,3,4,5]

(2) and to change the brackets from [] to ()

(3) and possibly even to change the numbering template in the bibliography, for example from this: [1] foo [2] bar [3] baz to this: 1) foo 2) bar 3) baz

Looking at the code, I assume (1) is already implemented in citation_macro.rb, but I don't know how to invoke it through asciidoc. As for (2), I got it to work using the :bibtex-citation-template: attribute, by setting the string to ($id), but I can't figure out how exactly the string specified by the attribute is interpreted, and what else it is capable of. I assume I can achieve (3) by tweaking bibitem_macro.rb. No problem, but I would like to know if a setting that allows tweaking this is already implemented.

Thank you, with kind regards

ProgramFan commented 3 years ago
  1. In principle, this can be done. But many more code shall be changed, since the 2 in [1,2,3] are used to link to bibliography item 2. If we want that link, we have to add more code in generating correct links.
  2. the template is used by substituting $id with a string representing the citation id.
  3. No settings at the moment. I think we need to rethink the design.