TransWikia.com

Can't get local file link in citation to work

TeX - LaTeX Asked on July 29, 2021

Directory tree

.
├── bibliography.bib
├── Makefile
├── reference
│   └── test_reference.tex
└── test.tex

File Contents

bibliography.bib

@misc{
  reference,
  title={Reference title},
  author={Reference author},
  note={href{run:reference/test_reference.pdf}{local file}}
}

Makefile

all: make_reference make_pdflatex make_bibtex make_pdflatex make_pdflatex
make_pdflatex:
        pdflatex test.tex
make_bibtex:
        bibtex test.aux
make_reference:
        pdflatex -output-directory=reference reference/test_reference.tex

reference/test_reference.tex

documentclass{article}
begin{document}
I am the reference document
end{document}

test.tex

documentclass{article}
usepackage{cite}
usepackage{hyperref}

begin{document}
Blablabla said Nobody ~cite{reference}

clearpage
bibliographystyle{plain}
bibliography{bibliography}

end{document}

Problem

When I run make all, the pdfs successfully compile, however when I open the pdf in Sumatra and try to access the local link it shows an error:

File wsl$Ubuntuhomeusernamecodeusernamelatex_se_questionfile:referencetest_reference.pdf not found

I can tell the path is wrong, which is why it fails to locate the file. However I don’t understand why this occurs since I am providing an existing path in my .bib file.

What am I doing wrong here?

One Answer

As indicated by @Ulrike Fischer in the comments, I am doing everything correctly. The local file linking problem is a known issue in version 3.2 of SumatraPDF due to recent MuPDF changes. Currently it looks like the only solution is to revert back to 3.1.2 until the developer fixes the bud.

For what it's worth, I've tried it on 3.1.2 and the hyperlink works as expected.

Correct answer by user32882 on July 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP