riboseinc / asciidoctor-bibliography

Citations in AsciiDoc
MIT License
30 stars 8 forks source link

The generated bibliography is incomplete #84

Closed remohammadi closed 5 years ago

remohammadi commented 5 years ago

While I don't get any error or warning when compiling, the generated bibliography misses multiple items.

The bibliography section of my thesis:

[bibliography]
== Bibliography

bibliography::[]

A paragraph from my thesis:

The Advanced Research Projects Agency Network (ARPANET),
an early network connecting many major universities and
research institutions in the USA,
was first demonstrated publicly in October 1972
cite:[roberts_arpanet_1986, page=3].
It was initially funded by the United States
Department of Defense during the cold war as a part of
"the command and control assignment" of the ARPA program
cite:[lukasik_why_2011, page=10].
The ((ARPANET)) was designed to be "as distributed as possible,"
because its routing algorithm was adapted from an article by Paul Baran,
written at the time he was at the RAND Corporation researching
on highly survivable communication networks "in the thermonuclear era"
cite:[baran_distributed_1964, page=18].
With the support of the US National Science Foundation, ARPANET gradually
"evolved into a commercial, worldwide open network" -- the Internet
cite:[dommering_internet:_2015, page=13].

While all the citations are generated as expected, the lukasik_why_2011 is missing in the bibliography section. Its citation is linked to #bibliography-default-lukasik_why_2011, but the target is missing.

I event tried to generate it by putting bibliography::lukasik_why_2011[] in the text, but the result was empty.

Here is the article entry in my database:

@article{lukasik_why_2011,
    title = {Why the {Arpanet} {Was} {Built}},
    volume = {33},
    issn = {1058-6180},
    url = {http://ieeexplore.ieee.org/document/5432117/},
    doi = {10.1109/MAHC.2010.11},
    language = {en},
    number = {3},
    urldate = {2019-02-20},
    journal = {IEEE Annals of the History of Computing},
    author = {Lukasik, Stephen},
    month = mar,
    year = {2011},
    pages = {4--21},
    file = {Lukasik - 2011 - Why the Arpanet Was Built.pdf:/Users/reza/Zotero/storage/I4F9Y8VI/Lukasik - 2011 - Why the Arpanet Was Built.pdf:application/pdf}
}

Is there any way to get more logs from the tool when compiling?

remohammadi commented 5 years ago

My Gemfile.lock:

GIT
  remote: https://github.com/riboseinc/asciidoctor-bibliography
  revision: 622aecac7527549b51d40c39311fc5ba1295dad6
  specs:
    asciidoctor-bibliography (0.9.0)
      asciidoctor (~> 1.5.6)
      bibtex-ruby (~> 4.4.4)
      citeproc-ruby (~> 1.1.7)
      csl-styles (~> 1.0.1)
      latex-decode (~> 0.2.2)
      nokogiri (~> 1.8.1)

GEM
  remote: https://rubygems.org/
  specs:
    Ascii85 (1.0.3)
    addressable (2.6.0)
      public_suffix (>= 2.0.2, < 4.0)
    afm (0.2.2)
    asciidoctor (1.5.8)
    asciidoctor-pdf (1.5.0.alpha.16)
      asciidoctor (>= 1.5.0)
      prawn (>= 1.3.0, < 2.3.0)
      prawn-icon (= 1.3.0)
      prawn-svg (>= 0.21.0, < 0.28.0)
      prawn-table (= 0.2.2)
      prawn-templates (>= 0.0.3, <= 0.1.1)
      safe_yaml (~> 1.0.4)
      thread_safe (~> 0.3.6)
      treetop (= 1.5.3)
    awesome_print (1.8.0)
    bibtex-ruby (4.4.7)
      latex-decode (~> 0.0)
    citeproc (1.0.9)
      namae (~> 1.0)
    citeproc-ruby (1.1.10)
      citeproc (~> 1.0, >= 1.0.9)
      csl (~> 1.5)
    coderay (1.1.2)
    csl (1.5.0)
      namae (~> 1.0)
    csl-styles (1.0.1.9)
      csl (~> 1.0)
    css_parser (1.7.0)
      addressable
    epubcheck (3.0.1)
    hashery (2.1.2)
    json (2.2.0)
    kindlegen (3.0.3)
      rake
      rubyzip
    latex-decode (0.2.2)
      unicode (~> 0.4)
    mini_portile2 (2.3.0)
    multi_json (1.13.1)
    namae (1.0.1)
    nokogiri (1.8.5)
      mini_portile2 (~> 2.3.0)
    pdf-core (0.7.0)
    pdf-reader (2.2.0)
      Ascii85 (~> 1.0.0)
      afm (~> 0.2.1)
      hashery (~> 2.0)
      ruby-rc4
      ttfunk
    polyglot (0.3.5)
    prawn (2.2.2)
      pdf-core (~> 0.7.0)
      ttfunk (~> 1.5)
    prawn-icon (1.3.0)
      prawn (>= 1.1.0, < 3.0.0)
    prawn-svg (0.27.1)
      css_parser (~> 1.3)
      prawn (>= 0.11.1, < 3)
    prawn-table (0.2.2)
      prawn (>= 1.3.0, < 3.0.0)
    prawn-templates (0.1.1)
      pdf-reader (~> 2.0)
      prawn (~> 2.2)
    public_suffix (3.0.3)
    pygments.rb (1.2.1)
      multi_json (>= 1.0.0)
    rake (12.3.2)
    ruby-rc4 (0.1.5)
    rubyzip (1.2.2)
    safe_yaml (1.0.5)
    thread_safe (0.3.6)
    treetop (1.5.3)
      polyglot (~> 0.3)
    ttfunk (1.5.1)
    unicode (0.4.4.4)

PLATFORMS
  ruby

DEPENDENCIES
  asciidoctor
  asciidoctor-bibliography!
  asciidoctor-pdf
  awesome_print
  coderay
  epubcheck
  json
  kindlegen
  pygments.rb
  rake
  thread_safe

BUNDLED WITH
   2.0.1
remohammadi commented 5 years ago

A minimal reproduction of the issue: https://github.com/remohammadi/BibliographyIssue84

remohammadi commented 5 years ago

It's related to CiteProc::Bibliography silently putting one of the references into errors instead of its references attribute. That messes a lot with the internal state because you are using the indices of the filtered_db in the render step. That is a potential source of many evils!

#<CiteProc::Bibliography @references=[3], @errors=[1]>

I'm currently going to focus on the error for the reference, which is: NoMethodError: undefined methodbibliography' for #`

remohammadi commented 5 years ago

The problem is with the 'month' field. month = mar doesn't work, while month = "3~" works.

CAMOBAP commented 5 years ago

@ronaldtse @remohammadi PR is ready for review

ronaldtse commented 5 years ago

Fixed in #89. Thank you @remohammadi for supplying the test and reporting it!