jalvesaq / zotcite

Neovim plugin for integration with Zotero
GNU General Public License v3.0
177 stars 15 forks source link

Compatibility with ctir #31

Closed JVAQUEROM closed 2 years ago

JVAQUEROM commented 3 years ago

Not sure if this should be here or in the Nvim-R github repo. But anyway, I am moving from RStudio to vim. In Rstudio is very typical to use citr package for citations. Turns out zotcite and citr do not assign the same labels to the citations, and also zotcite do not seem to add to the bib file any entry. So it is difficult to move from one to another or edit an already started in Rstudio Rmd file.

I just wanted to warn about this, see if something can be done, or any tips for "newbies" coming to vim from Rstudio.

Thank you!

jalvesaq commented 3 years ago

I'm sorry, but I think the two systems are not compatible. The zotref filter inserts the citations in the Yaml header of the (R)Markdown file before passing it to pandoc-citeproc. Zotcite gets the references directly from Zotero's database, so Zotero doesn't need to be open and no plugin has to be installed in Zotero. In the Markdown document being edited, these keys have two parts: the first one is Zotero's default internal key; the other is Author_Year. The zotref filter deletes the Author_Year part of the key before passing the document to pandoc-citeproc. No bib file is created in the process.

If you want to use Zotcite, I guess you have two options:

  1. Use zotcite only for new projects.
  2. Delete the bib file from the directory, delete the 'bibliography' field from the Markdown document header, then, manually replace existing keys using Zotcites omnicompletion.
JVAQUEROM commented 3 years ago

Ok, thank you for the information. However, I still have one doubt.

When using Nvim-R and zotcite for academic writing, one typically have to upload "latex sources" (meaning, bib file included) to the journal. How do you accomplish that?

Thank you.

jalvesaq commented 3 years ago

I switched from LaTeX to Markdown because I have the opposite problem. The journals in the social sciences usually don't accept LaTeX, and I have to convert the paper into Word format (they don't accept LibreOffice documents either). I don't write formulas in my papers, so I really don't need LaTeX for academic writing, and it's easy to convert from Markdown into Word than from LaTeX into Word.

JVAQUEROM commented 3 years ago

Ok, thank you, I guess this is a no-go then...If there is any recommendation to other VIM plugins for dealing with markdown citations I would be appreciate it. In any case, I guess the issue can be closed.

Thank you for your time and effort!! I think your plugins are really great!

jalvesaq commented 3 years ago

I've found this discussion on the topic: https://www.reddit.com/r/neovim/comments/l7s7yi/setting_up_vim_for_academic_writing_in_latex_and/gl8l2ky/

Please, report here the best solution that you find to help other LaTeX users.

JVAQUEROM commented 3 years ago

For the moment I am still using Rstudio while I look for an alternative that satisfies me. I will report when I get to it, thank you.

LibrEars commented 2 years ago

When using Quarto with zotcite a temporary example_zotcite.bib file is created during quarto preview. You could just copy this file and save it with a new name.

From :help zotcite: For Quarto documents, the "bibliography" field must be defined in its YAML header. You have to add the following fields to the YAML header of your Quarto documents to make both quarto preview and quarto render commands work (replace example_zotcite.bib with whatever name you want and adjust the zotref.py path):

 bibliography: example_zotcite.bib
 filters:
   - /path/to/zotcite/python3/zotref.py

To get the latex source also write the following into the YAML:

format:
  pdf:
    documentclass: scrartcl # Koma script document class
    keep-tex: true # latex source

The Koma script document class can be exchanged with a csl file to match a custom layout (see pdf-basics for drop in classes)

JVAQUEROM commented 2 years ago

Thank you for the tip! I never write back because in the end what I am doing is just exporting my tables and figures and then using LaTeX myself to write my documents. I use zotero automatic export to get a bib file to use with my LaTeX. For the moment it is the best workflow for me, but I should definitively check quarto sometime.

Regards!

jalvesaq commented 2 years ago

Thanks for the feedback! Your workflow might match the needs of other people. RStudio can complete references directly from Zotero when editing Quarto documents.