Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandoc-crossref not working #33

Open
TAKeanice opened this issue May 29, 2019 · 4 comments
Open

pandoc-crossref not working #33

TAKeanice opened this issue May 29, 2019 · 4 comments

Comments

@TAKeanice
Copy link

I have an issue using pandoc-crossref (http://lierdakil.github.io/pandoc-crossref/) as a filter. It can be added using "filter": "pandoc-crossref" or "filter": ["pandoc-crossref"] in the pandoc-config.json. However, there seems to be some preprocessing that escapes some of the crossref syntax. A simple example would be using an image in Markdown with crossref-specific options:

![](some_image.png){#fig:image width=10%}

which includes the image but escapes the curly braces, so crossref cannot interpret them any more as parameters. This is visible when doing latex output, where the output is as follows:

\includegraphics{some_image.png}\{\#fig:image width=10\%\}

I suspect something with citations to get in the way, because the documentation warns about the order of applying citeproc and crossref (first crossref, then citeproc). I do not understand the pandown codebase yet, otherwise I would open a pull request.

@TAKeanice
Copy link
Author

By comparison, when using plain pandoc from command line

pandoc -F pandoc-crossref test.md -o test.tex

the latex output is correct

\includegraphics[width=0.1\textwidth,height=\textheight]{some_image.png}

as is the generated pdf when setting -o test.pdf as output argument.

@TAKeanice
Copy link
Author

I got another hint from my experiments: Adding pandoc-citeproc as a filter before pandoc-crossref has the same effect as building with pandown. However, I could not find the place where pandoc-citeproc is applied in the pandown build process.

@phyllisstein
Copy link
Owner

Hey there! Forgive my delay in responding. I've been mercifully, but inconveniently, a little unplugged from GitHub lately.

My gut suspicion is that the root of your issue lies in Pandown's CriticMarkup support, which is a super unsophisticated bundle of regex copypasta I grabbed from their repos and don't fully understand myself. CriticMarkup processing is (or ought to be) disabled by default, though, so I'm going to take a deeper look tonight.

In the meantime, there's a setting called preprocess_critic that'll short-circuit the processor. Try adding the following to Pandown.sublime-settings:

{
	"preprocess_critic": false
}

It should be at the first level of your settings JSON, rather than nested in pandoc_arguments or command_arguments. (Boy this code is a mess!)

It'd also be a big help in reproducing the bug if you could drop any applicable config files in this thread or in a gist. Thanks for being so patient!

@TAKeanice
Copy link
Author

I am really thankful for all your advice (also the direct response via e-mail)! I will give an overview of what I did to solve everything shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants