emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: gvoysey <gvoysey@bu.edu>
To: emacs-orgmode@gnu.org
Subject: Bug: relative paths for links not preserved with #+INCLUDE [9.1.6 (release_9.1.6-419-g4b2006 @ /Users/gvoysey/.emacs.d/straight/build/org/)]
Date: Mon, 25 Jun 2018 23:17:23 -0400	[thread overview]
Message-ID: <CAC3+WKZN78u+gw-zjzt8TanQ5bfn7pC5M1YaswV3W1_ZpynN1g@mail.gmail.com> (raw)

I use org as my lab notebook.  Fairly often, I include figures and
plots.  I have the following style of file structure:

Project
├── project.org
└── subproject
    ├── figures
    │   └── foo.png
    └── subproject.org

I have been using #+INCLUDE to "lift" subproject.org up into project.org as
a subheading, so I can export the whole thing at once.

so project.org looks like:
#+begin_src org
* project
here are my notes
#+INCLUDE: "./subproject/subproject.org"
#+end_src

and subproject:

#+begin_src org
* notes
see this plot:
[[./figures/foo.png]]
#+CAPTION: a cool figure.
#+end_src

When I export =project.org= as HTML or LaTeX, the figures are not
included.  When I instead export =subproject.org= directly, they are.

Is there a way to insert file links to specify "relative to exactly this
file no matter where you've found yourself", or is  #+INCLUDE mangling
filepaths kind of unavoidable?  If the latter, what's the recommended
course of action here?

Emacs  : GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS
appkit-1348.17 Version 10.10.5 (Build 14F2511))
 of 2018-05-28
Package: Org mode version 9.1.6 (release_9.1.6-419-g4b2006 @
/Users/gvoysey/.emacs.d/straight/build/org/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-fontify-whole-heading-line t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-listings 'minted
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-latex-pdf-process '("%latex -shell-escape -interaction
nonstopmode -output-directory %o %f"
                         "%latex -shell-escape -interaction
nonstopmode -output-directory %o %f")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-mode-hook '(toc-org-enable org-tempo-setup
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-show-all
append local] 5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes
                 (lambda nil
                  (add-hook (quote before-save-hook) (quote
org-mode--ensure-one-blank-line) nil
                   (quote make-it-local))
                  )
                 turn-on-auto-fill org-bullets-mode org-indent-mode)
 org-export-with-smart-quotes t
 org-odt-format-drawer-function '(closure
                                  (hfy-user-sheet-assoc
hfy-html-quote-regex hfy-html-quote-map
                                   hfy-face-to-css
hfy-begin-span-handler hfy-end-span-handler
                                   archive-zip-extract
nxml-auto-insert-xml-declaration-flag t)
                                  (_name contents) contents)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function nil
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-latex-format-drawer-function '(closure (t) (_ contents) contents)
 org-babel-pre-tangle-hook '(save-buffer)
 org-latex-compiler "xelatex"
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-babel-load-languages '((shell . t) (emacs-lisp . t))
 org-hide-emphasis-markers t
 org-ascii-format-drawer-function '(closure (t) (_name contents
_width) contents)
 org-ellipsis " ▿"
 org-occur-hook '(org-first-headline-recenter)
 org-agenda-mode-hook '((lambda nil (setq org-agenda-tags-column (-
(window-width)))))
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-tags-column -101
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-confirm-shell-link-function nil
 org-link-parameters '(("id" :follow org-id-open)
                       ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store
org-irc-store-link :export org-irc-export)
                       ("info" :follow org-info-open :export
org-info-export :store
                        org-info-store-link)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export
org-docview-export :store
                        org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export
org-bbdb-export :complete
                        org-bbdb-complete-link :store org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link) ("file+sys")
("file+emacs")
                       ("doi" :follow org--open-doi-link) ("elisp"
:follow org--open-elisp-link)
                       ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url
(concat "ftp:" path))))
                       ("help" :follow org--open-help-link)
                       ("http" :follow (lambda (path) (browse-url
(concat "http:" path))))
                       ("https" :follow (lambda (path) (browse-url
(concat "https:" path))))
                       ("mailto" :follow (lambda (path) (browse-url
(concat "mailto:" path))))
                       ("news" :follow (lambda (path) (browse-url
(concat "news:" path))))
                       ("shell" :follow org--open-shell-link))
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-agenda-block-separator ""
 org-link-translation-function 'toc-org-unhrefify
 org-capture-after-finalize-hook '(org-capture-goto-last-stored)
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-tab-before-tab-emulation-hook '(tempo-complete-tag)
 org-html-format-drawer-function '(closure (htmlize-buffer-places
org-html-format-table-no-css t)
                                   (_name contents) contents)
 org-latex-packages-alist '(("" "minted"))
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-confirm-babel-evaluate nil
 org-default-notes-file "/Users/gvoysey/org/notes.org"
 org-latex-minted-options '(("breaklines" "true") ("breakanywhere"
"true") ("fontsize" "\\small"))
 )

             reply	other threads:[~2018-06-26  3:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26  3:17 gvoysey [this message]
2018-06-26 10:07 ` Bug: relative paths for links not preserved with #+INCLUDE [9.1.6 (release_9.1.6-419-g4b2006 @ /Users/gvoysey/.emacs.d/straight/build/org/)] Nicolas Goaziou
2018-06-26 16:23   ` gvoysey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC3+WKZN78u+gw-zjzt8TanQ5bfn7pC5M1YaswV3W1_ZpynN1g@mail.gmail.com \
    --to=gvoysey@bu.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).