raghur / mermaid-filter

Pandoc filter for creating diagrams in mermaid syntax blocks in markdown docs
412 stars 74 forks source link

Option to use includepdf instead of includegraphics? #31

Open gijswijs opened 5 years ago

gijswijs commented 5 years ago

I love this filter, but I have a feature request. I'm using it to create a gantt chart as an appendix to my document. The output filetype of the document is always PDF. I use pdf as output type for the gantt chart as well, because it has superior quality compared to the png output. But when including the pdf using includegraphics (which is what this filter does by returning pandoc.image) you get Latex complaints about the graphic being too large for the textbody, resulting in weird page breaks (it tries to fit the image on the following page)

Is there a possibility to force this filter to use includepdf (assuming the pdfpages package is installed)?

gijswijs commented 5 years ago

I already seemed to have found a workaround:

Add a .mermaid.css file with the following content

@page {
    size: Landscape;
}
bebuch commented 5 years ago

I have the same issue.

The workaround only works if the plot happens to have the appropriate size.

I think this is the actual bug: