auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed to skip from chapter tex file to master pdf file.


From: Hongyi Zhao
Subject: Re: Failed to skip from chapter tex file to master pdf file.
Date: Mon, 12 Jul 2021 08:25:05 +0800

On Mon, Jul 12, 2021 at 8:21 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Mon, Jul 12, 2021 at 3:19 AM Tassilo Horn <tsdh@gnu.org> wrote:
> >
> > Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> >
> > >> > ```
> > >> > epdfinfo: Error opening
> > >> > /home/werner/Public/hpc/tools/thesis/gitlab.kwant-project.org/jbweston/thesis.git/content/conclusion.pdf:No
> > >> > such file or directory
> > >>
> > >> What would be the right filename?  The project looks like thesis.tex is
> > >> the master file so I'd assume the pdf would be thesis.pdf and not
> > >> conclusion.pdf which is just some included chapter in content/.
> > >
> > > Yes. "thesis.tex" is the master file, and "thesis.pdf" is the
> > > generated pdf file name.
> >
> > So this would be the right filename, I guess.
> >
> > /home/werner/Public/hpc/tools/thesis/gitlab.kwant-project.org/jbweston/thesis.git/content/thesis.pdf
>
> According to the file directory hierarchy, it should be the following:
>
> /home/werner/Public/hpc/tools/thesis/gitlab.kwant-project.org/jbweston/thesis.git/thesis.pdf
>
> >
> > >> What are your TeX-master values?  It should be t in thesis.tex and
> > >> "../thesis" in the sub-files in content/.  From the error above, I'd
> > >> guess you've told AUCTeX that conclusion.tex was the master file and
> > >> pdf-tools uses the value of TeX-master and thus assumes
> > >> conclusion.pdf was the generated pdf.
> > >
> > > See below:
> > >
> > > $ tail -5 ./thesis.tex
> > >
> > > %%% TeX-master: t
> > >
> > > $ tail -5 content/publications.tex
> > >
> > > %%% TeX-master: ../thesis
> > >
> > > But still meet the error:
> > >
> > > ```
> > > epdfinfo: Error opening
> > > /home/werner/Public/hpc/tools/thesis/gitlab.kwant-project.org/jbweston/thesis.git/content/publications.pdf:No
> > > such file or directory
> >
> > Phew, this time it is publications.pdf, last time it was conclusion.pdf.
> > Have you also looked at the actual variable values using `C-h v
> > TeX-master'?
>
> I'm just trying with different chapter files to inspect this problem.
>
> > If the TeX-master values look right, I guess you will need to edebug the
> > pdf-tools functions `pdf-sync-forward-search' and
> > `pdf-sync-forward-correlate'.  Especially, the latter calls the AUCTeX
> > function (TeX-master-file "pdf") to determine the name of the pdf.
> >
> > Or as a first step, you could also find the master file and all chapter
> > files and eval the following in *stratch* and post the output:
> >
> > (delq nil (mapcar (lambda (buf)
> >                     (with-current-buffer buf
> >                       (when (eq major-mode 'latex-mode)
> >                         (cons (buffer-file-name buf)
> >                               (TeX-master-file "pdf")))))
> >                   (buffer-list)))
>
> See below:
>
> (delq nil (mapcar (lambda (buf)
>                     (with-current-buffer buf
>                       (when (eq major-mode 'latex-mode)
>                         (cons (buffer-file-name buf)
>                               (TeX-master-file "pdf")))))
>                   (buffer-list)))
> (("/home/werner/Public/hpc/tools/thesis/gitlab.kwant-project.org/jbweston/thesis.git/thesis.tex"
> . "thesis.pdf"))

Why can't `(La)TeX-mode' return the correct result:

(delq nil (mapcar (lambda (buf)
                    (with-current-buffer buf
                      (when (eq major-mode 'TeX-mode)
                        (cons (buffer-file-name buf)
                              (TeX-master-file "pdf")))))
                  (buffer-list)))
nil

(delq nil (mapcar (lambda (buf)
                    (with-current-buffer buf
                      (when (eq major-mode 'LaTeX-mode)
                        (cons (buffer-file-name buf)
                              (TeX-master-file "pdf")))))
                  (buffer-list)))
nil

Regards,
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

[Prev in Thread] Current Thread [Next in Thread]