John Pye wrote:

Well, it would not be hard for someone to provide a patch file that
one could apply to the preferences file.  The user would have to know
how to merge in a patch file (or else LyX would have to provide a
patch merge utility).  Unfortunately, these things are not entirely
one-size-fits-all, even within operating systems.  For instance, my
converter above works because I have the dot executable on my system
command path.  Otherwise I need to provide the path to it someplace --
which means your plug-in installer needs to detect the location of dot
on my system, or else open up a dialog and ask me to locate it.

I think that that is the wrong approach. It is the job of the person
writing the plugin to specify the correct location for 'dot' or whatever
else. LyX should not take on the job of going out and finding all the
necessary tools.=

[...]
A similar system could be used for configuration of LyX. The advantage
here is that platform specific stuff can be done by the packagers. For
example, on Ubuntu, you know that if you install the package 'graphviz'
then the program 'dot' will be installed in a standard location on PATH.
So it's just a question of creating a package that contains a file in
/etc/lyx/conf.d/graphviz.dot with dependencies on the Ubuntu 'graphviz'
package (so that installing the lyx-plugin-graphviz' package forces the
system to first install graphviz).

This approach allows Linux (Ubuntu, Fedora, SUSE, etc) release engineers
to do all the platform-specific stuff in a safe way, while still
permitting user customisation as well. Note that there might also need
to be some kind of 'lyx-reconfigure' program provided, as well. All of
this would also work fine with Fink on Mac, if desired. This only leaves
Windows as a bit of a special case, with its lack of a proper package
manager.

I agree that Windows is, as usual, a special case. I'm not sure we can assume that Graphviz was installed using, say, a deb package on Ubuntu. I haven't used Graphviz on Ubuntu myself, but isn't it possible that the user builds it rather than getting a package? If yes, can we be sure where the user parked it?

For that matter, I have a commercial optimization suite I installed under Ubuntu. The suite came (precompiled, of course) from the vendor as a generic Linux distribution, not as an Ubuntu or Debian package, with no particular guidance as to where to put it. So I unpacked and installed it in a whimsically chosen location.

Perhaps the developers could follow your idea and come up with something that works for Linux and Mac users who used their respective package managers to install Graphviz, leaving Windows users and Linux/Mac users who didn't use the package manager to configure the converter manually. That's mercifully beyond my pay grade, as we say hereabouts.


It is not the problem that LyX can't access the dot executable, because
when I create a converter for DOT->PNG everything works perfectly.
Problems arise when I set DOT to be a vector format and create only the
DOT->PDF (pdflatex) converter. In this case, I get a blank two-page
document, instead of the one-page document containing a Graphviz diagram
that I get with DOT->PNG.


I read previously (and forgot) that you had success with DOT -> PNG. Probably a dopey question, but does DOT -> PDF work for you if done from a terminal? The Dot user guide is silent on producing PDF output directly (only mentions going via PS). The more up-to-date online documentation does include -Tpdf as an option, with a note that this works only if Graphviz was built with the Cairo renderer. I think you can tell from the Graphviz config file whether it has a plugin for pdf:cairo. Otherwise, you might try 'dot -v -Tpdf whatever.dot -o whatever.pdf' and see what renderer is being used. (Of course, if this produces a valid PDF file, the question is moot.)

/Paul

Reply via email to