You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dot2tex fails if called from dot2texi with an input file containing \input{...}% instead of \input{...}. The problem is due to failure to parse the % sign. This issue exists in v2.9.0 and in 254cb27.
The cause I have identified up to now is output \input{0.dot}% to the auxiliary dot file created, then dot2tex fails to parse the line \input{0.dot}% in that file.
The dot2tex.log contents are:
2014-07-17 00:28:31,685 dot2tex INFO ------- Start of run -------
2014-07-17 00:28:31,685 dot2tex INFO Dot2tex version 2.9.0
2014-07-17 00:28:31,697 dot2tex INFO System information:
Python: sys.version_info(major=2, minor=7, micro=8, releaselevel='final', serial=0)
Platform: Darwin-12.5.0-x86_64-i386-64bit
Pyparsing: 2.0.2
2014-07-17 00:28:31,697 dot2tex INFO dot2tex called with: ['/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/dot2tex', '--figonly', '-ftikz', '--debug', '-o', 'my_main-dot2tex-fig1.tex', 'my_main-dot2tex-fig1.dot']
2014-07-17 00:28:31,697 dot2tex INFO Program started in mypath/test
2014-07-17 00:28:31,697 dot2tex DEBUG Attempting to read data from my_main-dot2tex-fig1.dot
2014-07-17 00:28:31,698 dot2tex INFO Data read from my_main-dot2tex-fig1.dot
2014-07-17 00:28:31,698 dot2tex DEBUG Input data:
\input{0.dot}%
2014-07-17 00:28:31,699 dot2tex DEBUG Start conversion
2014-07-17 00:28:31,715 dot2tex ERROR Parse error:
\input{0.dot}%
^
Expected 'graph' (at char 0), (line:1, col:1)
2014-07-17 00:28:31,716 dot2tex ERROR Failed to parse graph
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 3001, in main
s = conv.convert(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 752, in convert
main_graph = parse_dot_data(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 233, in parse_dot_data
graph = parser.parse_dot_data(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dotparsing.py", line 595, in parse_dot_data
tokens = self.dotparser.parseString(ndata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyparsing.py", line 1111, in parseString
raise exc
ParseException: Expected 'graph' (at char 0), (line:1, col:1)
2014-07-17 00:28:31,719 dot2tex ERROR Failed to parse the input data. Is it a valid dot file?
Try to input xdot data directly. Example:
dot -Txdot file.dot | dot2tex > file.tex
If this does not work, check that you have an updated version of PyParsing and
Graphviz. Users have reported problems with old versions. You can also run
dot2tex in debug mode using the --debug option:
dot2tex --debug file.dot
A file dot2tex.log will be written to the current directory with detailed
information useful for debugging.
2014-07-17 00:28:31,719 dot2tex INFO ------- End of run -------
ERROR Failed to parse graph Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 3001, in main s = conv.convert(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 752, in convert main_graph = parse_dot_data(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dot2tex.py", line 233, in parse_dot_data graph = parser.parse_dot_data(dotdata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dot2tex/dotparsing.py", line 595, in parse_dot_data tokens = self.dotparser.parseString(ndata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyparsing.py", line 1111, in parseString raise exc ParseException: Expected 'graph' (at char 0), (line:1, col:1)
ERROR Failed to parse the input data. Is it a valid dot file? Try to input xdot data directly. Example: dot -Txdot file.dot | dot2tex > file.tex If this does not work, check that you have an updated version of PyParsing and Graphviz. Users have reported problems with old versions. You can also run dot2tex in debug mode using the --debug option: dot2tex --debug file.dot A file dot2tex.log will be written to the current directory with detailed information useful for debugging.
I am on Mac OS X v10.8.5 using dot2tex v2.9.0 installed with macports (dot2tex port @2.8.7_2).
dot2texi is v2008/05/07 v3.0p1, however the issue exists also in 83a6ddf9c0e0574f7c76f83a98c7d53a84313b8b.
The text was updated successfully, but these errors were encountered:
This bug is caused by this regexp. Changing it for example to r"^\s*\\input\{(?P<filename>.+?)\}\%\s*$" reverses the bug (now \input{...}% is recognized correctly, whereas \input{...} not).
Considering that including a comment line is typical within packages, it may be desirable to change the regular expression used for this match.
@johnyf I agree that it should be possible to include a comment. I will try to find a more robust regexp. Thanks for taking the time to locate the bug!
Thank you, after more attempts eventually I derived a command from the code of the dot2tex environment to directly call dot2tex and avoid using a fragile slide, details here.
dot2tex
fails if called fromdot2texi
with an input file containing\input{...}%
instead of\input{...}
. The problem is due to failure to parse the%
sign. This issue exists inv2.9.0
and in 254cb27.Details below:
The code:
fails, whereas removing the
%
from after\input
succeeds:The cause I have identified up to now is output
\input{0.dot}%
to the auxiliarydot
file created, thendot2tex
fails to parse the line\input{0.dot}%
in that file.The
dot2tex.log
contents are:The important line above is:
The error trace is:
I am on
Mac OS X v10.8.5
usingdot2tex v2.9.0
installed withmacports
(dot2tex
port@2.8.7_2
).dot2texi
isv2008/05/07 v3.0p1
, however the issue exists also in 83a6ddf9c0e0574f7c76f83a98c7d53a84313b8b.The text was updated successfully, but these errors were encountered: