Open ouboub opened 6 days ago
The command executed with \ShellEscape
is run in the current directory, not in the output dir. So you need to add the path to the output dir, like:
\def\BuildDir{build/}
% #1 name of the graph (default \jobname-graph) -- it needs to be different than name of any existing file!
% #2 RDF property to be printed
% #3 list of allowed rdf:type for objects
% #4 list of allowed rdf:type for subjects
% don't forget to call latex with --shell-escape
\NewDocumentCommand\RdfDrawGraph{O{\jobname-graph} O{rdfs:label} m m}{%
\immediate\openout\graphwrite=#1.dot\relax%
\graphout{digraph hello\@charlb} % save graph header
\RdfLoopReferences{#3}{#4}{%
\StrSubstitute{\currentobject}{:}{_}[\objectlabel]
\StrSubstitute{\currentsubject}{:}{_}[\subjectlabel]
\graphout{\objectlabel [shape="rectangle",texlbl="\GetProperty{\currentobject}{#2}"]}
\graphout{\subjectlabel [shape="rectangle",texlbl="\GetProperty{\currentsubject}{#2}"]}
\graphout{\objectlabel-> \subjectlabel} %
}
\graphout{\@charrb}% save footer
\immediate\closeout\graphwrite%
\ShellEscape{dot2tex --figonly --autosize -t raw -o \BuildDir#1.tmp \BuildDir#1.dot }%
\InputIfFileExists{#1.tmp}{}%
}
Unfortunately, it doesn't work, dot2tex
printed this error:
ERROR Failed to process input
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 3075, in main
s = conv.convert(dotdata)
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 800, in convert
return self.do_preview_preproc()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 1053, in do_preview_preproc
ok = pp.process()
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 2645, in process
self.parse_log_file()
~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 2681, in parse_log_file
with open(logfilename, 'r') as f:
~~~~^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] Adresář nebo soubor neexistuje: '/tmp/dot2texi6ka89so/dot2tex.log'
But if I run it manually, like:
$ dot2tex --figonly --autosize -t raw -o build/complex-graph.tmp build/complex-graph.dot
then it works. I don't understand what is the problem here.
Hi,
First of all thanks. I just realised that dot2tex is developped also it github, therefore I will report this issue there and report back as soon as I receive some information.
File "/usr/lib/python3.13/site-packages/dot2tex/dot2tex.py", line 3075,
I don't see this error, but it does not work neither in my case. I opened an issue in dot2tex, github's repository
Does it output some other error message? Can you run this command from the command line?
$ dot2tex --figonly --autosize -t raw -o build/complex-graph.tmp build/complex-graph.dot
Because it works for me if I run it manually.
build/complex-graph.dot ``` Because it works for me if I run it manually.
That works for me as well!
What I meant was: if I use the modified file and run twice
the command
lualatex --shell-escape working-example-equation-out.tex
a pdf file generated in the build directory, without errors, but without graph as well
Hi
The following example
does not work with the command:
lualatex --shell-escape --output-dir="build/" complex.tex
But only with
lualatex --shell-escape complex.tex
What is the reason for this behaviour?