emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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/)]
@ 2018-06-26  3:17 gvoysey
  2018-06-26 10:07 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: gvoysey @ 2018-06-26  3:17 UTC (permalink / raw)
  To: emacs-orgmode

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"))
 )

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 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/)]
  2018-06-26  3:17 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/)] gvoysey
@ 2018-06-26 10:07 ` Nicolas Goaziou
  2018-06-26 16:23   ` gvoysey
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2018-06-26 10:07 UTC (permalink / raw)
  To: gvoysey; +Cc: emacs-orgmode

Hello,

gvoysey <gvoysey@bu.edu> writes:

> 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?

Could you upgrade Org? IIRC, it was fixed some time ago?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 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/)]
  2018-06-26 10:07 ` Nicolas Goaziou
@ 2018-06-26 16:23   ` gvoysey
  0 siblings, 0 replies; 3+ messages in thread
From: gvoysey @ 2018-06-26 16:23 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

Hi,

Confirmed, this works on 9.1.13 and is not a bug, just user error.  Cheers!

On Tue, Jun 26, 2018 at 6:07 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> gvoysey <gvoysey@bu.edu> writes:
>
> > 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?
>
> Could you upgrade Org? IIRC, it was fixed some time ago?
>
> Regards,
>
> --
> Nicolas Goaziou
>



-- 
Graham Voysey
Boston University College of Engineering
HRC Research Engineer
Auditory Biophysics and Simulation Laboratory
ERB 413

[-- Attachment #2: Type: text/html, Size: 3048 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-26 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-26  3:17 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/)] gvoysey
2018-06-26 10:07 ` Nicolas Goaziou
2018-06-26 16:23   ` gvoysey

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).