cagix / pandoc-thesis

Pandoc Thesis Template: A Template for Thesis Documents written in Markdown
MIT License
84 stars 22 forks source link

Citations inside Listings Captions do not work #4

Open cagix opened 4 years ago

cagix commented 4 years ago

something like

```{.python caption="The preprocessing step, cf. [@Nystrom2018]" #lst:huh}
def foo():
""" Wuppie! """
pass
```

will be translated using pandoc --filter=pandoc-citeproc --listings xxx.txt -o xxx.pdf into something like

Listing 1: ]The preprocessing step, cf. [@Nystrom2018]

However, I'd expect something like

Listing 1: The preprocessing step, cf. (Nystrom 2018)

upstream issue: https://github.com/jgm/pandoc/issues/6068

cagix commented 4 years ago

from a pandoc point of view (cf. https://github.com/jgm/pandoc/issues/6068#issuecomment-574704697) this is not a caption but merely an attribut to a fenced div. pandoc won't handle citations inside attributes.

a filter like pandoc-crossref could be helpful, but would need also some haskell tools installed.

as there are plans to include pandoc-crossref into pandoc/dockerfiles (cf. https://github.com/pandoc/dockerfiles/issues/30), we could base our docker file onto pandoc/dockerfiles and take advantage of the (then included) pandoc-crossref to resolve this issue.

this would also allow markdownish cross-references inside the document, which work currently only by using latex mechanisms (\label{} and \ref{}) ...