notZaki / PandocCiter

Visual Studio Code extension for autocompleting citations and cross-references for Pandoc/Markdown documents
https://marketplace.visualstudio.com/items?itemName=notZaki.pandocciter
MIT License
65 stars 9 forks source link

Display of the citations in the markdown doc. #14

Open oolonek opened 4 years ago

oolonek commented 4 years ago

Hi @notZaki !

Thanks for this nice plugin ! Would it be possible to dispaly citation as a footer after the .bib fetching ? Just like with this Sublime plugin https://github.com/renerocksai/sublime_zk#location-of-your-bib-file (also uses Pandoc)

Thanks a lot !

PM

notZaki commented 4 years ago

Thanks for the suggestion.

Since I'm not familiar with multimarkdown, I will list what I think would have to be changed to support mmd, and you can correct me where I'm wrong:

  1. Show suggested citations after # instead of @
  2. Print a formatted bibliography as footnotes at some location (the end?) of the document
  3. There is no third thing
oolonek commented 4 years ago

Hi @notZaki ! Yes actually I guess the point n. 2 is the most important ! I dont think point 1. is really useful.

Hope you can have a look sometime ! This would be an amazing add on.

How do you deal with bibliography display at the moment ? I mean you developed a plugin to cite reference but do you display them at the end by an alternative way I might not have followed or you just don't care ?

notZaki commented 4 years ago

The current method to display bibliographies is through pandoc-citeproc. Some examples are also mentioned in demo 24 here.

The advantages of pandoc-citeproc is that it can format the citations, e.g. displaying it as [1] vs (Author et al. 2019), as well as formatting the bibliography to suit different standards/journals.

If you think point n.2 is still a useful feature, then I can try forking a separate extension for printing the bibliography at the end of the file.

oolonek commented 3 years ago

@notZaki Hi yes still very much interested by feature n.2. :)

SR-- commented 3 years ago

Thank for your efforts...

  1. What about showing all references in a file in a panel? No need to put them at the end of the document.
  2. What about rendering all formatted references in the Preview.
aiva005 commented 3 years ago

I have the same issue, and maybe it's a silly question... @notZaki thank you for the add-on, the "@" citation recognition works well, but I have the same series of questions as above./

How would I use pandoc-citeproc currently to render citations in VSCode? I'm using dendron + pandoc-citer in VSCode and I have the following dummy note "I like this article @bazerman_want_nodate". When I type @ it correctly recognises the citation library, but it still shows "I like this article @bazerman_want_nodate" in the preview. What am I doing wrong?

I think, I would love the n.2 as per the above list—but failing that, what obvious part am I missing to have a functional work-around now?

Thanks! ai

notZaki commented 3 years ago

@aiva005 Citeproc can convert/format the citations, but I don't think dendron currently supports citeproc, although there is an open issue # 547 on dendron's github repo so maybe it'll eventually be supported.

Although I don't use it, I believe markdown preview enhanced has a use pandoc configuration (or something similar). However, this might require a workaround (described here) to work with newer versions of pandoc. There is this helpful video that describes a workflow where citations show up in the preview.

There might be other extensions that also support citeproc in their previews that I just don't know about.

@SR-- Those are both nice options, but I don't think I'd have the skill to implement that, or the time to maintain it, so it would be better if a separate package supported those features.

aiva005 commented 3 years ago

Thanks!

I have followed the threads as far as I could've taken them: this is the latest: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/432#issuecomment-906157058

I only get a partial positive result: at least I don't get any weird warnings anymore, but (!) it does NOT seem to recognise the --- header sign NOR my bibliography.

Interestingly enough, your citation look-up extension recognises the library correctly, but pandoc-citer does NOT, haha!

I'm stumped...

@notZaki question: how do you make it work? Or, do you?

notZaki commented 3 years ago

@aiva005 Not sure why the preview extension doesn't recognize the bibliography. Does running pandoc through the terminal produce a similar error?

I don't use vscode for previews in my workflow. For smaller projects, I just run pandoc directly and review the html/pdf/docx output. Larger projects require better support for equations and cross-references, so I use bookdown for previewing and final output(s). This requires more work to set up since R has to be installed, but it suits me because I usually have to install R anyways for other reasons.

flashlab commented 3 years ago

Hi, @notZaki I also eager for such function to be realized. Just like markdown preview enhanced does. Furthermore, if we can define a setting or a hotkey, like shift. Once shiftKey being pressed while inserting the inline citation, footnote style mark([^1]) will be insert instead, and corresponding formatted bibliography will be attached to the end. I'm not sure if such implementation is very hard.

ME-Msc commented 1 year ago

This video really helps a lot. Here are the steps:

  1. install pandoc
  2. check pandoc in terminal: pandoc -v
  3. install vscode extension: vscode-pandoc
  4. install vscode extension: markdown preview enhanced
  5. change vscode setting of Pandoc Citer: Show Log to true
  6. change vscode setting of Pandoc Citer: Forget Unused Bib to false
  7. look at view-output-PandocCiter in top menu list of vscode, check whether PandocCiter is now activated and Found .bib file are shown after step 8
  8. write a new markdown file with text below, notice there is a blank space between ":" and "[": --- bibliography: [./myRefe.bib] ---
  9. change vscode setting of Markdown-preview-enhanced: Use Pandoc Parser to true
  10. text citation like [@xxxx]

After the steps above, you will get reference list at the bottom of the preview.