Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline labels in math mode #77

Open
tkralphs opened this issue Feb 7, 2020 · 0 comments
Open

Multiline labels in math mode #77

tkralphs opened this issue Feb 7, 2020 · 0 comments

Comments

@tkralphs
Copy link

tkralphs commented Feb 7, 2020

The function is_multiline_label here is correctly detecting when a label is supposed to be considered multiline according to the graphviz format documented here, but this means that one cannot include any LaTex that begins with \l in a label name. For example, with -t math, the following graph isn't parsed the way I expect.

digraph G {
layout=dot;
d2tgraphstyle="every text node part/.style={align=center}";
0 -> 2  [label="x_{8} \leq 0"];
0 -> 3  [label="x_{8} \geq 1"];
2 -> 4  [label="x_{19} \leq 0"];
2 -> 5  [label="x_{19} \geq 1"];
5 -> 10  [label="x_{7} \leq 0"];
5 -> 11  [label="x_{7} \geq 1"];
3 -> 6  [label="x_{17} \leq 0"];
3 -> 7  [label="x_{17} \geq 1"];
10 -> 12  [label="x_{1} \leq 0"];
10 -> 13  [label="x_{1} \geq 1"];
11 -> 14  [label="x_{13} \leq 0"];
11 -> 15  [label="x_{13} \geq 1"];
7 -> 18  [label="x_{14} \leq 0"];
7 -> 19  [label="x_{14} \geq 1"];
4 -> 8  [label="x_{16} \leq 0"];
4 -> 9  [label="x_{16} \geq 1"];
}

The \leq is interpreted as indicating a multiline label with eq at the beginning of the second line, whereas I'm trying to render a "<=" sign in math mode.

I guess there is no perfect solution to this, since the dot syntax is in direct conflict with LaTex syntax on this. A flag indicating that the multiline detection should be skipped would be one workaround, although I actually do sometimes want multiline labels and to use \leq (just skipping the check for \l would be good enough. @kjellmf I'm happy to try to submit a PR if you would indicate what you think the best solution is. Of course, I can also just make this change in my local copy and be done with it.

I know you were asking for a new maintainer. I find this package very useful, I've unfortunately already adopted a lot of orphaned packages that are closer to my own research and I can't really take on another one.

tkralphs added a commit to tkralphs/dot2tex that referenced this issue Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant