Discussion:
file path problems with pdf output
Björn Pedersen
2005-01-22 16:46:15 UTC
Permalink
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.

If the bug (or problem) is triggered by a specific (La)TeX
file, you should try to produce a minimal sample file showing the
problem and include it in your report.

Your bug report will be posted to the AUCTeX mailing list.

Following scenario:

testdir_top:
dirtest.tex
***
\documentclass{article}

\begin{document}
This is the top document
\input{subdir/subdirtest}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
***
testdir_top/subdir:
subdirtest.tex:
****
Some Text in subdir file....

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../dirtest"
****

works correctly with dvi-mode.

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.

Why do I use relative paths for TeX-master? It is a larger project
which is distributed to different machines in differnt absolute positions.
[INS] [DEL] Extension: ^dvi$
Choice: [Value Menu] Regexp: .
Command: %(o?)xdvi %dS %d
[INS] [DEL] Extension: ^pdf$
Choice: [Value Menu] Regexp: .
Command: xpdf %o

It thems, the the %o expansion should not use the path part, or expand
to the absolute path of the master file.

Any ideas?

Best regards an thanks for your beautiful work!
Björn

Emacs : XEmacs 21.4 (patch 15) "Security Through Obscurity" [Lucid] (i686-pc-linux, Mule) of Sat May 22 2004 on bjoern
Package: AUCTeX CVS-5.478

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/"
"/usr/local/lib/xemacs-21.4.15/xemacs-packages/lisp/auctex/style/" "/usr/local/var/auctex/")
TeX-auto-save t
TeX-parse-self t
TeX-master "../dirtest"
)
Ralf Angeli
2005-01-24 16:38:03 UTC
Permalink
Post by Björn Pedersen
dirtest.tex
[...]
[...]
Post by Björn Pedersen
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.
[...]
Post by Björn Pedersen
It thems, the the %o expansion should not use the path part, or expand
to the absolute path of the master file.
--
Ralf
Ralf Angeli
2005-01-24 16:42:38 UTC
Permalink
* Ralf Angeli (2005-01-24) writes:

[only quoted text]

Please stay tuned ...
--
Ralf
Ralf Angeli
2005-01-24 17:07:32 UTC
Permalink
Post by Björn Pedersen
dirtest.tex
[...]
[...]
Post by Björn Pedersen
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.
[...]
Post by Björn Pedersen
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
David Kastrup
2005-01-24 17:22:03 UTC
Permalink
Post by Ralf Angeli
Post by Björn Pedersen
dirtest.tex
[...]
[...]
Post by Björn Pedersen
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.
[...]
Post by Björn Pedersen
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.
TeX-current-file-name-master-relative seems to be appropriate here.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
David Kastrup
2005-01-24 17:24:05 UTC
Permalink
Post by David Kastrup
TeX-current-file-name-master-relative seems to be appropriate here.
Uh, perhaps not. But the idea might be related.

Anyway, since all viewers etc are called within the master directory
on files situated there, they should be called on file names without
directory.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-01-25 09:00:17 UTC
Permalink
Post by David Kastrup
Anyway, since all viewers etc are called within the master directory
on files situated there, they should be called on file names without
directory.
I checked in the change mentioned earlier which strips the path
information from the file specifier.
--
Ralf
Björn Pedersen
2005-01-29 17:04:54 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
Anyway, since all viewers etc are called within the master directory
on files situated there, they should be called on file names without
directory.
I checked in the change mentioned earlier which strips the path
information from the file specifier.
Thanks! Seems to be working ok under xemacs.

Björn

Loading...