dot2tex icon indicating copy to clipboard operation
dot2tex copied to clipboard

URL attribute neglected - active hyperlinks lost

Open bruceleerabbit opened this issue 5 years ago • 1 comments

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}

bruceleerabbit avatar Aug 08 '19 13:08 bruceleerabbit

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

kjellmf avatar Aug 08 '19 16:08 kjellmf