Closed samuel-emrys closed 2 years ago
Hi Samuel,
pandoc-plot
will let all 'unknown' parameter be passed to pandoc. For example:
```{.matplotlib hello="world" foo=10}
fig = plt.figure(figsize=(10, 20)) # figure size in inches
...
would pass the parameters `hello` and `foo` to the underlying format. I can't test right now, but using this you should be able to have more control over the final conversion.
Hi @LaurentRDC, a working example would be appreciated if you have the time. I haven't been able to get anything to work here - because graphviz doesn't allow you to specify a size i don't think I can modify the way the image is generated, and I can't easily see a way to influence the resulting latex with what you've described
Here's a minimal example:
starting with this Markdown input:
# Title
Paragraph
```{.graphviz}
digraph D {
A [shape=diamond]
B [shape=box]
C [shape=circle]
A -> B [style=dashed, color=grey]
A -> C [color="black:invis:black"]
A -> D [penwidth=5, arrowhead=none]
}
Render with `pandoc --filter pandoc-plot -i example.md -o example.tex`, gives the following LaTeX output:
```tex
\hypertarget{title}{%
\section{Title}\label{title}}
Paragraph
\begin{figure}
\centering
\includegraphics{plots/11623886912816197297.png}
\caption{}
\end{figure}
# Title
Paragraph
```{.graphviz width=50mm height=60mm}
digraph D {
A [shape=diamond]
B [shape=box]
C [shape=circle]
A -> B [style=dashed, color=grey]
A -> C [color="black:invis:black"]
A -> D [penwidth=5, arrowhead=none]
}
Output looks like:
```tex
\hypertarget{title}{%
\section{Title}\label{title}}
Paragraph
\begin{figure}
\centering
\includegraphics[width=50mm,height=60mm]{plots/11623886912816197297.png}
\caption{}
\end{figure}
As you can see, the parameters width=50mm
and height=60mm
(which are not understood by pandoc-plot) are passed to pandoc.
Does this help?
Given the solution above, I'll close this for now. Don't hesitate to re-open this issue if you need further help
Would it be possible to add this example to the pandoc-plot documentation? I don't expect everyone using pandoc-plot to be savvy enough to check github issues when they encounter this?
This behavior no longer exists in v 1.7.0. The example above did not pass through options to .tex
I can't currently see a good way to modify the dimensions of the figure. The equivalent latex code would be:
Is it possible to proxy parameters like this to the underlying images? I'm having an issue where the figure is overflowing the boundaries of the slide similar to the following:![Screenshot_20220228_153448](https://user-images.githubusercontent.com/36361864/155927076-c2a27a65-14d1-4579-a42c-a322db4b3df6.png)
This is more than just image overflow though, the caption "Figure 1: XYZ" is also being pushed off the page. Is there currently a way to rectify this?