2

My problem is almost a repost from reddit (original post). Recently, I opened a issue trying to explain what is going on (issue), but the reddit post was clearer than my explanation and very similar to my problem.

Say I have the files main.org and other.org, which are in different directories. In main.org I include other.org, and other.org has a hyperlink to an image [[file:image.png]].

image.png is in the same directory as other.org so when I export other.org to pdf, the image is found and included in the output.

However, when exporting main.org, in the generated main.tex file it'll try to find ./image.png even though that's in a different directory, so when exporting main.org none of the images with relative links are included in the output

Anyone have advice on how I should fix this, without specifying the full path each time I link to an image?

The problem that I am facing is quite similar. The only difference is that I have a slightly different file structure, such as:

├── thesis.org
├── research_paper
│   └── other.org
|─────  figs
│       └── image.png

As from the original reddit post, the figure/file paths are not updated when exporting to PDF, causing a file with missing figures.

Update: An important difference between mine problem and that from reddit is that my other.org also have #+INCLUDEs insed and I guess that could be the source of the problem. Is it possible to org updates the file paths in a recursive use of #+INCLUDEs?

Expected behaviour: Org-mode updates relative paths when using #+include command, and successfully generates a PDF file.

Actual behaviour: Org-mode use paths as it is when exporting to .tex.

Emacs configuration: Doom emacs based

Org-mode version: 9.6

1
  • I cannot reproduce it (Org mode version 9.6 (release_9.6-126-gf731d4)) with either the structure described in the reddit quote or with your structure. In both cases, I get a PDF displaying the images. In the second case, other.org uses [[file:../figs/image.png]] for the link and thesis.org #+INCLUDEs ./research_paper/other.org. I also added a link to a second image in thesis.org like this: [[file:./figs/fig2.png]] and both images are shown in the exported PDF.
    – NickD
    Jan 17, 2023 at 6:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.