Closed MichaelEwe closed 2 years ago
Works here and gives the attached output (Side remark: It has been a while since I used graphviz; but I think that 1_a
is not being recognized as a variable. you may have to use "1_a"
(with quotes) to get the right variable name.).
Not sure why it is failing at your end. Can you add \traceexternalfilters
before \starttext
and paste the complete terminal output.
I found a hint. It works on my side too, as long as I have "cache=yes" in the definition. Change it to "cache=no" and you get the error. (Remark: looks like I pasted the wrong file in the first place, sorry...)
The input below yields this output
Thank you for your support. I can live with "cache=yes", but there seems to be an issue with caching...
Input with cache=no
\usemodule[filter]
\defineexternalfilter
[graphviz]
[
filter=\externalfilterparameter{layout} -Tpdf -o\externalfilteroutputfile,
layout=dot, % neato or twopi
cache=no,
output=\externalfilterbasefile.pdf,
readcommand=\ReadPDF,
]
\def\ReadPDF#1%
{\externalfigure[#1][frame=on]}
\starttext
\startplacefigure[location=right]
\startgraphviz
digraph G {
Peter -> Paul;
}
\stopgraphviz
\stopplacefigure
\input ward
\startplacefigure[location=left]
\startgraphviz
digraph G {
Paul -> Mary;
}
\stopgraphviz
\stopplacefigure
\input ward
\stoptext
I added some explanation in the README to explain why cache=yes
is necessary.
Splendid. Again thank you for your support!
Versions:
ConTeXt ver: 2022.01.21 20:13 LMTX fmt: 2022.2.16 int: english/english t-filter (ver: 2022.02.17)
Use case
Using the same filter twice with different content.
Expected Result
In the produced output both filters are "replaced" with their corresponding content.
Observed Result
Both filters are indeed "replaced". But the replaced content is coming from the first filter invocation.
How To Reproduce
Use "dot.tex" from the test-cases in this repository as a starting point. Add a second invocation like in the code below. Both figures will appear, but the second one contains the dot-graph from the first filter invocation again.