John,

John Pye wrote:
Works fine for me here.  Keep in mind that there are at least three
PDF file formats defined within LyX, because different compilation
methods (ps2pdf, pdflatex, dvipdfm) have different requirements.  On
my box those are designated pdf, pdf2 and pdf3 respectively, and I'm
pretty sure that's standard across installations.  If you create a
converter from DOT to pdf3, say, and then use View -> PDF (pdflatex)
to see the output (which is creating pdf2 output), presumably
something will break.

I tried this many times but no success. I am aware of the pdflatex (etc)
issue. It is not called 'pdf3' on my system, it is called 'PDF
(pdflatex)'.

Should be both: in Tools -> Preferences -> File formats, if I highlight 'PDF (pdflatex)', that's the entry in the 'GUI name', while the entry in 'Format' is pdf2. FWIW, if you want to do a file export from the command line, you use pdf2 as the argument to the export flag. Shouldn't have anything to do with the converter working or not, though, so long as the converter entry points to the right output GUI name.

That is the standard on Fedora and Ubuntu systems, if not
elsewhere, so I don't think you're right about 'pdf3' etc.

This converter system is way too delicate IMHO: if you get it wrong, you
get minimal and rather cryptic error messages.

I tend to agree here, to the extent that if LyX gets an error message from an external command, it should forward it to the user. I don't think that's always the case, though. I suspect that sometimes LyX runs an external process and the child process exits with a nonzero error code but not much else. LyX can't tell you what it doesn't know (i.e., LyX is not an academic).

It's also impossible for
someone to help to diagnose a problem, because you can't just "sent me
your config file" (AFAIK) and you can't tell what stuff is different on
my system compared to your system.

Actually, you can send a piece of an appropriate config file. In your LyX home directory, there's a file named 'preferences'. It should contain a line defining the DOT file type and additional lines for each related converter you added. Mine read as follows:

\format "dot" "dot" "Dot" "" "auto" "auto" "vector"
\converter "dot" "pdf2" "dot -Tpdf $$i -o $$o" ""

Note that this is exactly what I entered in the "all-powerful GUI".  :-)

FWIW, I think that rather than an all-powerful GUI for editing
converters, file formats, etc, these things should be stored in flat
platform-specific configuration files that can be packaged for
distribution as 'plugins' eg a set of LyX configuration files + linux
package dependences = support for Graphviz in LyX. This would take the
voodoo out of the job of getting LyX working with various different file
formats, and allow end-users to make use of *the tools they know
already* in order to get extra features working with LyX. I say this,
but I'm not going to come and help, so you best ignore me here :-)


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.

If the converter entries above don't work on your system, it's possible that either LyX (more precisely, the child shell it spawns) can't find the dot executable or else lacks permission to run it. Try the following. Open a LyX doc with a dot image embedded and try View -> PDF (pdflatex), which I gather will fail silently. With LyX still running, open a terminal and navigate to the LyX temporary directory. Verify that a copy of the DOT file sits there, probably with the name mangled by LyX. Assuming so, run the converter from the terminal, using exactly the syntax of your converter entry (but substituting the mangled file name for $$i and the same name with a pdf extension for $$o). In my case that means 'dot -Tpdf <mangled name>.dot -o <mangled name>.pdf'. If it fails, maybe you'll get a helpful error message in the terminal window.

/Paul

Reply via email to