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:
mkdocs-bibtex/src/mkdocs_bibtex/plugin.py
Line 144 in 8f73346
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": ...}
:
mkdocs-bibtex/src/mkdocs_bibtex/utils.py
Line 169 in 8f73346
Here is a new test that fails:
https://github.com/epogrebnyak/mkdocs-bibtex/blob/master/test_files/test_two_items.py
Ooh! Good catch! Thanks for the test as well. I'll go ahead and get this in over the weekend.
@shyamd - thanks for doing a fix!