all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Friendly exchange of thoughts: citations and LaTeX
Date: Wed, 29 Mar 2023 14:14:51 +0000	[thread overview]
Message-ID: <87ilejmyp0.fsf@localhost> (raw)
In-Reply-To: <CAO48Bk_upR4h-xd0YL+FxeKtWvDoqH+Eju6F_Vzds_m6oxBKcg@mail.gmail.com>

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

Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:

> Having said that, I was also (just a bit) bugged by the fact that
> bibliography file names are completely expanded when generating LaTeX.
> Couldn't we avoid that for LaTeX export?

It is in `org-cite-list-bibliography-files'.
AFIAU, full path is forced there to make #+SETUP containing local
bibliography path work:

---- main.org -----
#+SETUP: settings.org
------ end --------

---- ../settings.org -----
#+BIBLIOGRAPHY: local.bib
--------------------------

One reasonable option could be keeping relative paths relative iff the
#+BIBLIOGRAPHY is derived from a file inside the same directory with the
exported file.

Tentative patch attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-cite-list-bibliography-files-Preserve-local-bibl.patch --]
[-- Type: text/x-patch, Size: 1505 bytes --]

From f068094cc850e7387633bbd57e1c0bfc7e395b21 Mon Sep 17 00:00:00 2001
Message-Id: <f068094cc850e7387633bbd57e1c0bfc7e395b21.1680099269.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Wed, 29 Mar 2023 16:13:29 +0200
Subject: [PATCH] org-cite-list-bibliography-files: Preserve local bibliography
 path

* lisp/oc.el (org-cite-list-bibliography-files): When the bibliography
path is relative to the exported file location, keep the path
relative.

Link: https://orgmode.org/list/CAO48Bk_upR4h-xd0YL+FxeKtWvDoqH+Eju6F_Vzds_m6oxBKcg@mail.gmail.com
---
 lisp/oc.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index dde6f3a32..a69165506 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -602,7 +602,12 @@ (defun org-cite-list-bibliography-files ()
    (append (mapcar (lambda (value)
 		     (pcase value
 		       (`(,f . ,d)
-                        (expand-file-name (org-strip-quotes f) d))))
+                        ;; Keep the bibliography path relative in
+                        ;; current directory.
+                        (if (equal d default-directory) f
+                          ;; Expand bibliography path for #+SETUP
+                          ;; files located in other directory.
+                          (expand-file-name (org-strip-quotes f) d)))))
 		   (pcase (org-collect-keywords
                            '("BIBLIOGRAPHY") nil '("BIBLIOGRAPHY"))
 		     (`(("BIBLIOGRAPHY" . ,pairs)) pairs)))
-- 
2.39.1


[-- Attachment #3: Type: text/plain, Size: 225 bytes --]



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

  parent reply	other threads:[~2023-03-29 14:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  6:52 Friendly exchange of thoughts: citations and LaTeX Pedro Andres Aranda Gutierrez
2023-03-23 10:09 ` Fraga, Eric
2023-03-27  9:02   ` Pedro Andres Aranda Gutierrez
2023-03-27  9:34     ` Fraga, Eric
2023-03-27 14:37       ` Pedro Andres Aranda Gutierrez
2023-03-29 14:14 ` Ihor Radchenko [this message]
2023-03-29 16:50   ` Pedro Andres Aranda Gutierrez
2023-05-02 12:51   ` Ihor Radchenko
2023-05-03  5:00     ` Pedro Andres Aranda Gutierrez

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

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

  git send-email \
    --in-reply-to=87ilejmyp0.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=paaguti@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.