knitrpandocsweave

Does pandoc support Synctex?


I've spent a week writing an R vignette using knitr, with input in R Markdown, and output in HTML. Previously all vignettes that I wrote were in Sweave with a PDF target.

One of the things I miss is Synctex, which gives the ability to jump from the PDF preview back to the corresponding line in the file. As far as I can see, knitr supports this when producing LaTeX output (using the same scheme as Sweave, I think), but not when producing HTML output.

I know that the R Markdown to HTML process goes through pandoc, so I checked the pandoc docs, but couldn't find any mention of Synctex there.

So my questions are:

  1. Are there any HTML browsers that support something like Synctex for forward and reverse search from an editor? (Since RStudio has its own built-in browser, it could be doing this...)

  2. Does pandoc support any Sweave-like scheme for relating output locations in the HTML file to input locations in the .md input?


Solution

  • As of October, 2022 Pandoc doesn't support Synctex directly, but there are some underpinnings of support described here: https://github.com/jgm/pandoc/issues/4565#issuecomment-749294039. In summary: