GNOME Bugzilla – Bug 583526
Using mscgen diagrams causes LaTeX error if the file path includes spaces.
Last modified: 2010-06-15 11:21:48 UTC
My working directory includes spaces - c:/Documents and Settings/grh/workspace/Locking [Eclipse workspace] When I include mscgen diagrams in the documentation, the .tex files generate errors. I have traced this to the location where the generated image in included in the document. A sample fragment of the .tex file as generated is - \begin{center} \begin{ImageNoCaption}\mbox{\includegraphics{C:/Documents and Settings/grh/workspace/Locking/latex/inline_mscgraph_1}} \end{ImageNoCaption} \end{center} The actual PDFLaTeX error message is uninformative as to the cause of the error (as usual) but does indicate the line number. By quoting the path PDFLaTeX is happy to process the document! \begin{center} \begin{ImageNoCaption}\mbox{\includegraphics{"C:/Documents and Settings/grh/workspace/Locking/latex/inline_mscgraph_1"}} \end{ImageNoCaption} \end{center} I also noticed that other images (generated by Dot) are included just using their filename without any path - this works since everythiung is in the latex directory. Thus the generation of the LaTeX source to include mscgen diagrams should either quote the full file path OR just use the filename without any path.
I do also see this problem with 1.6.1.
It would seem the following would be an appropriate fix (compared to startDotFile() in the same file). I haven't configured doxygen to build on my machine so this is somewhat speculative... latexdocvisitor.cpp: void LatexDocVisitor::writeMscFile(const QString &baseName) { QString outDir = Config_getString("LATEX_OUTPUT"); QString shortName = baseName; int i; if ((i = shortName.findRev('/')) != -1) { shortName = shortName.right(shortName.length() - i - 1); } writeMscGraphFromFile(baseName, outDir, shortName, MSC_EPS); m_t << "\n\\begin{DoxyImageNoCaption}" " \\mbox{\\includegraphics"; //if (!width.isEmpty()) //{ // m_t << "[width=" << width << "]"; //} //else if (!height.isEmpty()) //{ // m_t << "[height=" << height << "]"; //} m_t << "{" << shortName << "}"; m_t << "}\n"; // end mbox m_t << "\\end{DoxyImageNoCaption}\n"; }
Thanks, I'll include the patch.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.0. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.