shyamd/mkdocs-bibtex

strange behavior - results in wrong inline numbering

Closed this issue · 6 comments

I have paper.bib file like:

@book{PM18,
  author = {Pearl, Judea and Mackenzie, Dana},
  publisher = {Basic Books},
  title = {The Book of Why: The New Science of Cause and Effect},
  year = {2018},
  address = {New York}
}

@book{Hamilton,
  author = {Hamilton, James D.},
  publisher = {Princeton University Press},
  title = {Time Series Analysis},
  year = {1994},
}

and index.md as

# Citations

- Book of Why[@PM18]
- Time Series Analysis[@Hamilton]

\bibliography 

but the resulting html is not quite right:

    Book of Why[1](file:///Q:/bib/site/index.html#fn:1)
    Time Series Analysis[^2]

    James D. Hamilton. Time Series Analysis. Princeton University Press, 1994. [↩](file:///Q:/bib/site/index.html#fnref:1)

What can be going wrong? I tried runnng mkdocs on bith Windows and WSL. Many thanks for clues.

In quads third element is always 1:

quads = [('[@PM18]', 'PM18', '1', 'Judea Pearl and Dana Mackenzie. *The Book of Why: The New Science of Cause and Effect*. Basic Books, New York, 2018.'), ('[@Hamilton]', 'Hamilton', '1', 'James D. Hamilton. *Time Series Analysis*. Princeton University Press, 1994.')]

because of:

quads.append((key_set, key, "1", self.all_references[key]))

so then we get:

>>> format_bibliography(quads)
'[^1]: James D. Hamilton. *Time Series Analysis*. Princeton University Press, 1994.'

So then here new_bib is always a dictionary like {"1": ...}:

new_bib = {quad[2]: quad[3] for quad in citation_quads}

Ooh! Good catch! Thanks for the test as well. I'll go ahead and get this in over the weekend.

Should be fixed as of v2.0.1 from changes in #108

@shyamd - thanks for doing a fix!