Bibliography plugin (or a compromise solution)

I would like to suggest a new plugin (or a new core feature) allowing citing bibliography within an Inkdrop note. It could be something similar to what it is done in Pandoc (https://pandoc.org/MANUAL.html#citations), but it could also be something simpler.

Ideally, one would have a list of bibliographic references in raw ‘bib’ style (this list could be placed in the same Inkdrop note, or in another Inkdrop note or a ‘bib’ external file), maybe hidden within HTML comment tags; and these references could be cited within the note.

As a compromise solution, do you have any suggestion about how to do this using the current Inkdrop features (either core ones or plugins)? I mean, I could live with just some way to create an in-document/in-note link (something similar to what the ‘footnotes’ plugin does). By the way, is there a canonical way to create links to anchors which are defined in the same document in Markdown, or should I use HTML code instead?

Please, let me know whether my request is clear enough or not.

I tried the following code as a way to have a ‘References’ section in an Inkdrop note:

# Bibliography example

## Main text

Lorem ipsum dolor sit amet, consectetur adipiscing elit ([Nguyen et al., 2021](#nguyen2021)). Pellentesque cursus lacus id ante pretium luctus. Mauris nisl massa, cursus id lorem sit amet, vehicula condimentum arcu. Integer leo augue, efficitur et ornare eget, bibendum et neque. Duis id volutpat enim. Curabitur pharetra venenatis maximus. Donec sed dapibus mauris, in viverra mauris. Sed enim lectus, ultricies ac sapien porta, venenatis faucibus metus.

As stated by [Kummer (1836)](#kummer1836) and [Giner-Bosch (2020)](#ginerbosch2020), Mauris sit amet pharetra magna. Maecenas mi turpis, fringilla vel metus vitae, egestas vulputate nisl. Nulla eget ultrices justo, non dapibus felis. Suspendisse tempus nunc erat, sit amet feugiat odio sagittis sit amet. Nam finibus vel sem vel convallis. Sed sagittis cursus diam, ultrices tincidunt est eleifend ut. Aenean mauris neque, ultrices et luctus non, pretium eget elit. Phasellus posuere lorem vitae libero tincidunt cursus. Ut blandit mi ligula, ac egestas magna pulvinar vitae. Suspendisse sem sapien, tristique id erat a, sollicitudin vulputate justo. Phasellus eget turpis interdum, aliquet sem ac, dapibus mauris. Proin condimentum auctor tortor, sit amet eleifend nunc porttitor quis. Vivamus ornare accumsan commodo.

[Kummer (1836)](#kummer1836) and [Nguyen et al. (2021)](#nguyen2021) both deduced that sed vestibulum mi sem, at aliquam libero mattis nec. Proin vitae eros sit amet lectus porttitor sodales. Nullam blandit egestas sem, eu sodales diam tincidunt quis. In nec nisi tincidunt, tristique lectus quis, dictum lectus. Integer vel risus elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut urna magna, imperdiet et nibh quis, vehicula vulputate odio. In euismod tempor diam, tempus pharetra lectus suscipit nec. Donec eros metus, varius non augue ac, euismod commodo dui. Maecenas purus arcu, malesuada id scelerisque at, tristique sed purus. Pellentesque faucibus volutpat orci, posuere consequat augue efficitur in. Duis varius lorem id quam maximus fringilla. Vivamus quis diam porttitor, congue nunc eu, luctus mauris. Nam ac erat id ipsum euismod ultricies. Integer efficitur nulla in lectus pellentesque congue. Donec ultricies dui nec odio mattis consectetur.

Mauris scelerisque purus nec orci ullamcorper, ut fringilla mi vehicula ([Giner-Bosch, 2020](#ginerbosch2020); [Nguyen et al., 2021](#nguyen2021)). Ut sit amet sem vel massa vulputate hendrerit. Integer at sem sed purus semper egestas. Cras sed rutrum ipsum. Curabitur vestibulum a nisi quis gravida. Mauris augue lorem, vehicula pellentesque tempus ut, faucibus id urna. Nulla quis sem purus. Suspendisse nulla eros, luctus eget faucibus quis, pretium at leo. Nulla facilisi. Donec laoreet sed nibh id posuere. Integer fermentum risus risus, nec sagittis turpis venenatis ac. Sed cursus, augue quis vehicula ullamcorper, felis sapien lobortis arcu, in efficitur risus ante quis risus. Vestibulum ac massa molestie, finibus quam porttitor, rutrum ex. Etiam ultrices lacus sit amet orci vestibulum, venenatis vulputate odio luctus. Fusce sagittis dolor nec bibendum tincidunt.

Nunc maximus ipsum dolor, in sodales ligula vehicula et. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Ut semper venenatis lorem, id pretium ex finibus sollicitudin. Aenean dui felis, posuere sed tempor ac, viverra vel felis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam tristique porta consectetur. Sed vel nisl enim.

## References

These references have been formated 'by hand'. Ideally, a plugin should create this list from a 'bib' package and a bibliography style.

<a name="ginerbosch2020"> </a> Giner-Bosch&nbsp;V&nbsp;(2020). _Efficient evaluation of a continued fraction involved in the calculation of the moments of the sample multivariate coefficient of variation squared_. Tech.&nbsp;report DEIOAC-2020-01. Department of Applied Statistics, Operations Research and Quality, Universitat Politècnica de València. [[http://hdl.handle.net/10251/156814](http://hdl.handle.net/10251/156814)]

<a name="kummer1836"> </a> Kummer&nbsp;EE&nbsp;(1836). Über die hypergeometrische Reihe $1 + (\alpha\beta / (1\gamma))x + (\alpha(\alpha+1)\beta(\beta+1) / (1\cdot 2\gamma(\gamma+1)))x^2 + (\alpha(\alpha+1)(\alpha+2)\beta(\beta+1)(\beta+2) / (1\cdot 2\cdot 3\gamma(\gamma+1)(\gamma+2)))x^3 + \cdots$. _Journal für die reine und angewandte Mathematik_, 15:39&ndash;83. [[DOI:10.1515/crll.1836.15.39](https://doi.org/10.1515/crll.1836.15.39)]

<a name="nguyen2021"> </a> Nguyen&nbsp;QT, Giner-Bosch&nbsp;V, Tran&nbsp;KD, Heuchenne&nbsp;C, Tran&nbsp;KP&nbsp;(2021). One-sided Variable Sampling Interval EWMA Control Charts for Monitoring the Multivariate Coefficient of Variation in the Presence of Measurement Errors. _International Journal of Advanced Manufacturing Technology_, online first. [[DOI:10.1007/s00170-021-07138-8](https://doi.org/10.1007/s00170-021-07138-8)]

As you can see, I am using HTML ‘a’ tags to create anchors within the note. The problem is that, when creating an HTML page from this note, the names of the anchors are modified by Inkdrop. See how this note is shared as an HTML public document:

https://community.inkdrop.app/note/945fdd961639dffd77c853a6bbfe07aa/note:k0OW07cvv

As you can see, the inner links don’t work because the name of the anchor “ginerbosch2020” has been replaced by “user-content-ginerbosch”, for instance.

So… How can I address this issue? Any other solution…?

Hi VGB,

Thank you for the suggestion and report.
Why anchor links have user-content- prefix is due to the HTML sanitizer, particularly this line:

Because sharing arbitrary content is dangerous, and adding the prefix would prevent some abuses.
So, this is a security issue.
But I can see the anchors are working on the Inkdrop preview and exported HTML files.

Can you tell me why the footnotes plugin does not solve your issue?

Hello, Takuya,

Thank you for your answer.

The reason for not using the footnotes plugin is that I prefer not to use super-indexes to refer to the bibliography items, but instead I prefer to make the surname of the author and the publication year clickable. Is there a way to achieve this using the footnotes plugin?

I thought that Markdown provided a way to create and refer to inner anchors. Actually, I see that, as you said, my solution works except in the shared version of the note (which I am very interested in, though).

No, the footnotes plugin doesn’t support it.
The user-content- prefix is necessary to prevent DOM clobbering. It’s one of the practices of GitHub.
So, your solution would be the best at the moment.
Extending Markdown is basically not recommended because it doesn’t work elsewhere.

Here you can see my solution using the footnotes plugin:

# Bibliography example 2

## Main text

Lorem ipsum dolor sit amet, consectetur adipiscing elit Nguyen et al., 2021[^NGTHT21]). Pellentesque cursus lacus id ante pretium luctus. Mauris nisl massa, cursus id lorem sit amet, vehicula condimentum arcu. Integer leo augue, efficitur et ornare eget, bibendum et neque. Duis id volutpat enim. Curabitur pharetra venenatis maximus. Donec sed dapibus mauris, in viverra mauris. Sed enim lectus, ultricies ac sapien porta, venenatis faucibus metus.

As stated by Kummer (1836)[^Kum36] and Giner-Bosch (2020)[^Gin20], Mauris sit amet pharetra magna. Maecenas mi turpis, fringilla vel metus vitae, egestas vulputate nisl. Nulla eget ultrices justo, non dapibus felis. Suspendisse tempus nunc erat, sit amet feugiat odio sagittis sit amet. Nam finibus vel sem vel convallis. Sed sagittis cursus diam, ultrices tincidunt est eleifend ut. Aenean mauris neque, ultrices et luctus non, pretium eget elit. Phasellus posuere lorem vitae libero tincidunt cursus. Ut blandit mi ligula, ac egestas magna pulvinar vitae. Suspendisse sem sapien, tristique id erat a, sollicitudin vulputate justo. Phasellus eget turpis interdum, aliquet sem ac, dapibus mauris. Proin condimentum auctor tortor, sit amet eleifend nunc porttitor quis. Vivamus ornare accumsan commodo.

Kummer (1836)[^Kum36] and Nguyen et al. (2021)[^NGTHT21] both deduced that sed vestibulum mi sem, at aliquam libero mattis nec. Proin vitae eros sit amet lectus porttitor sodales. Nullam blandit egestas sem, eu sodales diam tincidunt quis. In nec nisi tincidunt, tristique lectus quis, dictum lectus. Integer vel risus elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut urna magna, imperdiet et nibh quis, vehicula vulputate odio. In euismod tempor diam, tempus pharetra lectus suscipit nec. Donec eros metus, varius non augue ac, euismod commodo dui. Maecenas purus arcu, malesuada id scelerisque at, tristique sed purus. Pellentesque faucibus volutpat orci, posuere consequat augue efficitur in. Duis varius lorem id quam maximus fringilla. Vivamus quis diam porttitor, congue nunc eu, luctus mauris. Nam ac erat id ipsum euismod ultricies. Integer efficitur nulla in lectus pellentesque congue. Donec ultricies dui nec odio mattis consectetur.

Mauris scelerisque purus nec orci ullamcorper, ut fringilla mi vehicula (Giner-Bosch, 2020[^Gin20]; Nguyen et al., 2021[^NGTHT21]). Ut sit amet sem vel massa vulputate hendrerit. Integer at sem sed purus semper egestas. Cras sed rutrum ipsum. Curabitur vestibulum a nisi quis gravida. Mauris augue lorem, vehicula pellentesque tempus ut, faucibus id urna. Nulla quis sem purus. Suspendisse nulla eros, luctus eget faucibus quis, pretium at leo. Nulla facilisi. Donec laoreet sed nibh id posuere. Integer fermentum risus risus, nec sagittis turpis venenatis ac. Sed cursus, augue quis vehicula ullamcorper, felis sapien lobortis arcu, in efficitur risus ante quis risus. Vestibulum ac massa molestie, finibus quam porttitor, rutrum ex. Etiam ultrices lacus sit amet orci vestibulum, venenatis vulputate odio luctus. Fusce sagittis dolor nec bibendum tincidunt.

Nunc maximus ipsum dolor, in sodales ligula vehicula et. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Ut semper venenatis lorem, id pretium ex finibus sollicitudin. Aenean dui felis, posuere sed tempor ac, viverra vel felis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam tristique porta consectetur. Sed vel nisl enim.

## References

These references have been formated 'by hand'. Ideally, a plugin should create this list from a 'bib' package and a bibliography style.

[^Gin20]: Giner-Bosch&nbsp;V&nbsp;(2020). _Efficient evaluation of a continued fraction involved in the calculation of the moments of the sample multivariate coefficient of variation squared_. Tech.&nbsp;report DEIOAC-2020-01. Department of Applied Statistics, Operations Research and Quality, Universitat Politècnica de València. [[http://hdl.handle.net/10251/156814](http://hdl.handle.net/10251/156814)]

[^Kum36]: Kummer&nbsp;EE&nbsp;(1836). Über die hypergeometrische Reihe $1 + (\alpha\beta / (1\gamma))x + (\alpha(\alpha+1)\beta(\beta+1) / (1\cdot 2\gamma(\gamma+1)))x^2 + (\alpha(\alpha+1)(\alpha+2)\beta(\beta+1)(\beta+2) / (1\cdot 2\cdot 3\gamma(\gamma+1)(\gamma+2)))x^3 + \cdots$. _Journal für die reine und angewandte Mathematik_, 15:39&ndash;83. [[DOI:10.1515/crll.1836.15.39](https://doi.org/10.1515/crll.1836.15.39)]

[^NGTHT21]: Nguyen&nbsp;QT, Giner-Bosch&nbsp;V, Tran&nbsp;KD, Heuchenne&nbsp;C, Tran&nbsp;KP&nbsp;(2021). One-sided Variable Sampling Interval EWMA Control Charts for Monitoring the Multivariate Coefficient of Variation in the Presence of Measurement Errors. _International Journal of Advanced Manufacturing Technology_, online first. [[DOI:10.1007/s00170-021-07138-8](https://doi.org/10.1007/s00170-021-07138-8)]

This is a link to the shared note: https://community.inkdrop.app/note/945fdd961639dffd77c853a6bbfe07aa/note:393rDPmKy

Some thoughts:

  • The solution is not perfect (since I don’t like using super-indexes to refer to bibliography items) but it somehow works.

  • The links work in the HTML version of the note (‘Export as HTML…’ option). However, the footnotes plugin doesn’t seem to work in the shared version of the page.

So, I am still looking for a valid way to share a document that includes citations, and I would like to give the user/reader the possibility of jumping to the reference list by clicking on a cited work.