[GraphViz] Solved!

[email protected] (r.maurizzi) Sat, 28 Mar 2009 07:09:12 -0700
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <20090328070903-0700__35873.6328468241$1238249456$gmane$org@zwiki.org>
So... it appears you have to modify the Latex template used by MathAction to "input" graphviz.tex ( http://web.mit.edu/~drayside/www/graphviz.tex/main.pdf ) and to "usepackage" its dependency graphicx. I modified the default template in latexWrapper.py as follows::

  # This is only used if your wiki does not have a node LatexTemplate.
  defaultLatexTemplate = r"""
  \documentclass[%dpt,notitlepage]{article}
  \usepackage{amsmath}
  \usepackage{amsfonts}
  \usepackage[all]{xy}
+ \usepackage[dvips]{graphicx}
  \newenvironment{latex}{}{}
+ \input{graphviz}
  \begin{document}
  \pagestyle{empty}
  %%s
  \end{document}
  """  % (charsizept)

It should be possibile to have a LatexTemplate Zope document in the wiki from what I read around, but I didn't experiment with this for the moment.

The "trick" was knowing that Latex doesn't have a default path: if you use "input" it expects to find the file in the current directory, in this case the LatexWiki directory in the $INSTANCEHOME/var/LatexWiki (the one you must map with LocalFS).

I'll have to find a better place to put it and having it parsed by Latex, because the that directory gets cleaned of all *.tex file after every page rendered... ^^;

--
forwarded from http://zwiki.org/GraphViz#[email protected]