xyz2tex / dot2texisty

Include graphs in the DOT graph description language in your LaTeX documents
7 stars 2 forks source link

Strange issues with external dot files (\input) #1

Open kjellmf opened 10 years ago

kjellmf commented 10 years ago

(Original issue report by seanfisk https://github.com/kjellmf/dot2tex/issues/21)

seanfisk commented 2 days ago I think that this is technically a dot2texi issue, but I wasn't sure where to report it, so hopefully this is OK.

I'm having weird behavior with the external files feature. Here is my MWE:

% main.tex
\documentclass{article}
\usepackage[debug]{dot2texi}
\usepackage{tikz} % for dot2texi
\usetikzlibrary{shapes,arrows} % for dot2texi
\begin{document}
\begin{dot2tex}
\input{mygraph.dot}
\end{dot2tex}
\end{document}
// mygraph.dot
digraph mygraph {
    A -> B -> C;
}
pdflatex -shell-escape main.tex

I'm not sure exactly how LaTeX, dot2texi, and dot2tex interact. This works:

\begin{dot2tex}
\\\input{mygraph.dot}
\end{dot2tex}

When you add options, it is even stranger, because now this works:

For consistent behavior, you can always pass empty options like:

\begin{dot2tex}[]
\input{mygraph.dot}
\end{dot2tex}

I can work around it, but something seems not right. I wanted to let you know because the example in the texdoc suggests:

\begin{dot2tex}
\input{externalgraph.dot}
\end{dot2tex}

... which does not work.

kjellmf commented 10 years ago

Low level TeX-programming is outside of my comfort zone. If I don't find a quick solution I will just update the documentation with a warning about the issue and recommend to always pass empty options.