joplin / plugin-bibtex

Use locally stored BibTeX files to integrate citation into Joplin
29 stars 7 forks source link

Exporting or Printing Note Excludes Reference List #28

Open chk86 opened 3 years ago

chk86 commented 3 years ago

I just started using this plugin and it works wonderfully. I did notice that in the side-by-side editor layout, the viewer screen shows a References list containing the citation for all the references in the note. However, when I either print the note or export the note, that References list is not included. I included a screenshot of the References List in the viewer mode. I did try exporting it as a PDF, html, and markdown, and none of them included the list.

Screen Shot 2021-08-31 at 1 53 40 PM

extall commented 3 years ago

+1. Pity I did not pay attention to this issue until I rediscovered it with my students during a live demonstration. I guess for now the solution is to copy rich text from the preview into a context that supports rich text (e.g., ms word). But then, if you're using a dark theme like we apparently do, you have to also change the style or paste as plain text and then fix the style.

laurent22 commented 3 years ago

Yes that was discussed here and the reason why I was trying to encourage the use of a [citation] tag that would then be rendered. Right now the plugin is doing some magic to display the references, and that magic doesn't happen when printing.

extall commented 3 years ago

Yes that was discussed here and the reason why I was trying to encourage the use of a [citation] tag that would then be rendered. Right now the plugin is doing some magic to display the references, and that magic doesn't happen when printing.

I've studied the code, the Joplin plugin API, the linked discussion, and the way MarkdownIt works. I wonder how else you would pass the data about the cited references loaded from the file from the plugin to the contentScript for rendering purposes if not through the webviewApi.postMessage() by executing the script that upon fetching the data from the plugin adds the references into the desired placeholder in the generated HTML?

Looking at the HTML export, the script does not get executed prior to export and so what we see in the exported file is a call to webviewApi which is no longer valid...