def code_table(lines): filename = 'img_graph_%s.png' % lines[0].split()[-1] dot2png(txt2dot(lines[1:]), filename) return r'\includegraphics[width=0.8\textwidth]{%s}' % filename
def code_dot(lines): filename = 'img_graph_%s.png' % lines[0].split()[-1] dot2png('\n'.join(lines[1:]), filename) #return r'\includegraphics[width=0.8\textwidth]{%s}' % filename return '{%s}' % filename