jalvesaq / zotcite

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

Create Command For Running Pandoc From Markdown to PDF #71

Closed aerithnetzer closed 2 months ago

aerithnetzer commented 6 months ago

I added a function zotcite#MarkdownToPDF that takes one argument filename and then creates an output pdf in the same directory.

Tested functionality in my package manager (lazyvim) and works as expected.

raffaem commented 6 months ago

I would be against merging this.

This basically calls pandoc.

But different people may want different ways to call pandoc.

For example, I use some lua filters, xelatex, and numbered section, and this is how I call pandoc:

pandoc \
  --lua-filter="$LUAFILTERS/scholarly-metadata/scholarly-metadata.lua" \
  --lua-filter="$LUAFILTERS/author-info-blocks/author-info-blocks.lua" \
  --lua-filter="$THISFOLDER/abstract-section/_extensions/abstract-section/abstract-section.lua" \
  --lua-filter="$THISFOLDER/fonts-and-alignment/fonts-and-alignment.lua" \
  --csl="$THISFOLDER/elsevier-harvard.csl" \
  -F "$ZOTREF" --citeproc \
  --pdf-engine=xelatex \
  --number-sections \
  --output="${1%%.*}.pdf" \
  "$1"

Different people may have different filters, different latex compilation engine, and ddifferent ways to call pandoc.

Moreover this goes against the UNIX philosophy of doing one thing and doing it well.

Calling the compiler is a general problem not specific to markdown files, but to any programming language, and is already solved by plugins like overseer.

jalvesaq commented 6 months ago

I agree with @raffaem. I use zotcite in Quarto documents. If I merged this feature, many people would open issues requesting support for their specific ways of using pandoc. The function zotcite#MarkdownToPDF() would have to receive additional arguments to deal with different users' preferences and I would have to maintain a feature that I will never use.

jalvesaq commented 6 months ago

Perhaps I should remove the option zotcite_quarto_render since I no longer use it...

jalvesaq commented 2 months ago

I'm converting VimScript to Lua and in the new branch (which will be the master branch soon) the option zotcite_quarto_render no longer exists. This resolves the inconsistency of supporting a specific way of rendering quarto documents and not supporting other ways of running Pandoc.

The VimScript code will stay in a vim branch but will not receive new features unless someone wants to maintain it. So, I'm closing this issue.