scrivomatic icon indicating copy to clipboard operation
scrivomatic copied to clipboard

use Pandoc citeproc to convert [@citekey] to \cite{citekey} instead of hyperlink

Open bbchen opened this issue 5 years ago • 2 comments

In the workflow, pandoc citations [@citekey] are converted to something like this in LaTeX:

"Sint meis quo et, vis ad fæcete dolorem! Ad quøt moderatius elaboraret
eum(Crivellato \& Ribatti \protect\hyperlink{ref-crivellato2007}{2007}),
pro paulo ridens quaestio ut. 

Is it possible to convert [@citekey] to latex \cite{citekey} instead?

Thank you!

bbchen avatar Dec 14 '20 09:12 bbchen

Hi @bbchen, by default I always use Pandoc's citeproc engine to generate the formatted references, not BibLaTeX. You will see that the reference itself is already formatted. The hyperlink comes from the setting link-citations (see here for documentation). citeproc handles everything I and many other users need, so unless there is a formatting requirement CSL cannot fulfill, it is worth sticking to its use.

If you prefer to use Bib[La]TeX then you have to disable Pandoc's citeproc engine (doc here) in the metadata and enable the BibLaTeX transformation (biblatex or natbib depending on your workflow). To do that:

      citeproc: false
      biblatex: true

You can edit pandocomatic.yaml directly, or add this to your Scrivener front-matter YAML to override the pandocomatic template. In my pandocomatic templates, I use [refs] as generic settings and then add them to my output types like [latex-refs] or [docx-refs]:

https://github.com/iandol/dotpandoc/blob/master/pandocomatic.yaml#L28

Adjust this as required for your preferences...

iandol avatar Dec 27 '20 23:12 iandol

Thank you so much for your very detailed answers. That solved my problem. citeproc works well for me, but sometimes I will need to work with collaborators using overleaf and they prefer bibtex.

Thanks again for the workflow. I have used Scrivener with your Scrivomatic to write a few proposals and manuscripts already.

bbchen avatar Feb 20 '21 08:02 bbchen