Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions dot2tex/dot2tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,26 @@ def do_nodes(self):
sn = ""
sn += self.output_node_comment(node)
sn += self.start_node(node)

# Quick and dirty introduction of handling for xlabel
# xlabel = self.get_label(node, label_attribute="xlabel")
xlabel = None
if 'xlabel' in node.attr:
#node.attr['texlbl'] = node.attr['xlabel']
node.attr['texlbl'] = None
xlabel = self.get_label(node,label_attribute="xlabel")
#xlabel = node.attr['xlabel'] if 'xlabel' in node.attr else None
if xlabel is not None:
#xlpos = "%sbp,%sbp" % (smart_float(str(float(x)+len(xlabel)*5)), smart_float(y))
xlp = getattr(node, 'xlp', None)
if not xlp:
continue
xlpx, xlpy = xlp.split(',')
xlpx = str(abs(float(x)-float(xlpx))+float(x))
xlpy = y
xlpos = "%sbp,%sbp" % (smart_float(xlpx), smart_float(xlpy))
sn += " \\node (%s) at (%s) [%s] {%s};\n" % \
(tikzify(node.name+"xl"), xlpos, "", xlabel)
if shape == "coordinate":
sn += " \\coordinate (%s) at (%s);\n" % (tikzify(node.name), pos)
elif self.options.get('styleonly'):
Expand Down