xyz2tex / dot2texisty

Include graphs in the DOT graph description language in your LaTeX documents
7 stars 2 forks source link

replace auxiliary tex filename indices with names #3

Open johnyf opened 10 years ago

johnyf commented 10 years ago

Attempting to compile subsets of a document (e.g., a single beamer slide) can result in a different value for the fignum counter. As a result, the ordering of figures is corrupted and they appear shifted inside the document. So one needs to repeatedly compile the whole document to maintain them at the correct positions.

If external dot files are used, then the input file name can be substituted as part of the output file name. This will ensure a consistent mapping between included graphs and the included tex files containing the corresponding tikz code. The difference is analogous to that between a list and a dict.

For inline dot code within dot2tex environments, file indexing could still be used, but an optional environment parameter can be added, to provide a name for each graph, to be used as the distinguishing substring in the auxiliary file's name.

kjellmf commented 10 years ago

Good idea. I will add support for this in the next version of dot2tex and dot2texi.sty

johnyf commented 10 years ago

2588e9d4318adab459941b9c2bcb885bebc021a2 introduces a \includedottex command (a previous version of which was mentioned in #2), with auxiliary tex file names that are derived from the dot file paths, by replacing / by _ and ./ by _ using package xstring. The reason for maintaining the complete path in the file name is to avoid name conflicts of identically named files that reside in different paths.

It introduces also a new option force, to tell dot2tex to convert the dot file irrespective of the freshness of the corresponding output file.

I can send a pull request if it seems appropriate (though I am not a tex expert, so some additional work may be needed to make this cross-platform).