xyz2tex / dot2tex

Convert graphs generated by Graphviz to LaTeX friendly formats
Other
151 stars 44 forks source link

URL attribute neglected - active hyperlinks lost #69

Open bruceleerabbit opened 5 years ago

bruceleerabbit commented 5 years ago

When dot code contains the URL attribute such as this:

  digraph G {
    node [shape="circle"];
    x -> y [label="hotlink", URL=<https://github.com/kjellmf/dot2tex/issues/69>];
  }

the attribute is being ignored and the resulting LaTeX code does not have the link. The output is something like this:

\begin{tikzpicture}[>=latex,line join=bevel,]
[...]
  \draw (74.932bp,42.257bp) node {$hotlink$};
[...]
\end{tikzpicture}

That's just a label named "hotlink" with no effect when clicked. This is what it should be:

\usepackage{hyperref}
[...]
\begin{tikzpicture}[>=latex,line join=bevel,]
[...]
  \draw (74.932bp,42.257bp) node {\href{https://github.com/kjellmf/dot2tex/issues/69}{hotlink}};
[...]
\end{tikzpicture}
kjellmf commented 5 years ago

This should be pretty straightforward to implement. I'll add it to my todo list, but dot2tex is unfortunately low on my priority list at the moment.

Ref: https://www.graphviz.org/doc/info/attrs.html#d:URL https://www.graphviz.org/doc/info/attrs.html#k:escString