Re: file path problems with pdf output

Ralf Angeli <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* Björn Pedersen (2005-01-22) writes:

> Following scenario:
>
> testdir_top:
>  dirtest.tex
[...]
> testdir_top/subdir:
>  subdirtest.tex:
[...]
> In pdf-mode, when trying to view from the subdirtest.tex buffer,
> it prompts for xpdf ../dirtest.pdf, but executes xpdf in testdir_top,
> so xpdf cannot find the pdf file. Manually removing ../ in the minibuffer 
> works. Specifing an absoulte  path for TeX-master works correctly, too. 
[...]
> It thems, the the %o expansion should not use the path part, or expand
> to the absolute path of the master file.

The %o expander calls `TeX-view-output-file' which subsequently calls
`TeX-active-master'.  Your former suggestion can be achieved by
wrapping the call to `TeX-active-master' in `expand-file-name'.  The
latter suggestion by extending the definition of `TeX-active-master'
by a parameter for specifying if the output should include the
directory or not.  That parameter will get passed to `TeX-region-file'
or `TeX-master-file' respectively.

Currently I tend to the latter solution because the shorter file
specifier doesn't clutter the minibuffer as much as a full path.  In
addition it would be in line with what the user gets in the DVI case
(%d expander).  The drawback is that it might look strange to get the
bare file name when the command is invoked in a subdirectory not
containing the output file.

A general problem might be that I haven't really had the time to look
under the hood and understand how the viewer process actually gets
called.  So I don't know if there might be other hidden bugs with
handling of files in subdirectories which are not covered by the
patch.  That means there is a possibility that a change on a deeper
level would be more appropriate and fix the bug with the viewer and
other potential bugs.

-- 
Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.