On Wed, Oct 24, 2007 at 03:20:14PM +0200, Kai Johannes Keller wrote:
> Hi,
> 
> if I cd to the directory the temporary preview files are produced by
> lyx, in my case this is
> 
> /tmp/lyx_tmpdir14405VmKWEL/lyx_tmpbuf2/
> 
> I find all the fontfiles and if I look at the dvi -file from commandline
> via
> 
> "xdvi myfile.dvi"
> 
> everything's fine. So why the lyx-preview does not show the right file?
> 
> How does lyx start the preview of dvi files?

LyX calls the viewers using absolute paths and does not (anymore)
switch to the temporary directory. This is the root of the problem
that you are experiencing. Please, try using the attached script as
your dvi viewer as a workaround. The script simply changes the current
directory to that where the dvi file is located before calling xdvi.

-- 
Enrico
#!/bin/sh

cmd=xdvi
dir=""
while [ $# -gt 0 ] ; do
    if [ -z "$dir" ]; then
        dir=`dirname "$1"`
        if [ -n "$dir" -a -d "$dir" ]; then
            file=`basename "$1"`
            cmd="$cmd '$file'"
        else
            dir=""
            cmd="$cmd '$1'"
        fi
    else
        cmd="$cmd '$1'"
    fi
    shift
done

test -n "$dir" && cd "$dir"

eval "exec $cmd"

Reply via email to