all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Friendly exchange of thoughts: citations and LaTeX
@ 2023-03-20  6:52 Pedro Andres Aranda Gutierrez
  2023-03-23 10:09 ` Fraga, Eric
  2023-03-29 14:14 ` Ihor Radchenko
  0 siblings, 2 replies; 9+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2023-03-20  6:52 UTC (permalink / raw)
  To: Org Mode List

HI

I just wanted to start a _friendly_ exchange of thought which may end
up in some code related with citations and LaTeX. (sort of my SoC :-)
)

It all starts with the support for the LaTeX '\jobname' macro. It is
quite convenient and I have been using it for a long time now. In the
'old dog don't learn new tricks' mode, I started using it for
citations and it looks like it works in the generated LaTeX code, but
not in the integration with org-cite. I'm thinking about the
possibility of making org-mode accept and treat \jobname correctly.

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?

 Thoughts?
/PA

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet


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

* Re: Friendly exchange of thoughts: citations and LaTeX
  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-29 14:14 ` Ihor Radchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2023-03-23 10:09 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List

Pedro,

maybe start by showing an example of where \jobname does not work with
org while working with LaTeX directly?  I have never used this LaTeX
command and know nothing about it.

Secondly, what is the problem with bibliography file names being
expanded?

eric
-- 
: Eric S Fraga, with org release_9.6.1-224-g8ae8a8 in Emacs 30.0.50

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

* Re: Friendly exchange of thoughts: citations and LaTeX
  2023-03-23 10:09 ` Fraga, Eric
@ 2023-03-27  9:02   ` Pedro Andres Aranda Gutierrez
  2023-03-27  9:34     ` Fraga, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2023-03-27  9:02 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Org Mode List

Hi Eric,

\jobname is the shorthand for ‘the file that you are compiling with the latex command’. I use it in my templates for LaTEX presentations and documents I conjunction with \addbibresource{} 
I always have a main.Tex + main.bib file pair.

Recognizing this in org-cite would be nice.

Re the use of absolute vs relative path when exporting to LaTeX, I might want to export to LaTeX and transfer to overleaf.com and relative paths would make more sense there, wouldn’t they?

Thanks for the exchange/PA

Enviado desde mi iPhone

> El 23 mar 2023, a las 11:09, Fraga, Eric <e.fraga@ucl.ac.uk> escribió:
> 
> Pedro,
> 
> maybe start by showing an example of where \jobname does not work with
> org while working with LaTeX directly?  I have never used this LaTeX
> command and know nothing about it.
> 
> Secondly, what is the problem with bibliography file names being
> expanded?
> 
> eric
> -- 
> : Eric S Fraga, with org release_9.6.1-224-g8ae8a8 in Emacs 30.0.50


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

* Re: Friendly exchange of thoughts: citations and LaTeX
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Fraga, Eric @ 2023-03-27  9:34 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List

Hi Pedro,

On Monday, 27 Mar 2023 at 11:02, Pedro Andres Aranda Gutierrez wrote:
> \jobname is the shorthand for ‘the file that you are compiling with

Ah, okay; thank you.  

> Re the use of absolute vs relative path when exporting to LaTeX, I
> might want to export to LaTeX and transfer to overleaf.com and
> relative paths would make more sense there, wouldn’t they?

Yes, this is a very valid point.  And often a source of real issues (I
have this problem sharing with my group where most use Windows... issues
with paths and upper/lower case names).

-- 
: Eric S Fraga, with org release_9.6.1-307-gcd2355 in Emacs 30.0.50

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

* Re: Friendly exchange of thoughts: citations and LaTeX
  2023-03-27  9:34     ` Fraga, Eric
@ 2023-03-27 14:37       ` Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2023-03-27 14:37 UTC (permalink / raw)
  To: Org Mode List

> And often a source of real issues (I
> have this problem sharing with my group where most use Windows... issues
> with paths and upper/lower case names).

I don't know why, but it sounds familiar ;-)

Best, /PA

On Mon, 27 Mar 2023 at 11:34, Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
>
> Hi Pedro,
>
> On Monday, 27 Mar 2023 at 11:02, Pedro Andres Aranda Gutierrez wrote:
> > \jobname is the shorthand for ‘the file that you are compiling with
>
> Ah, okay; thank you.
>
> > Re the use of absolute vs relative path when exporting to LaTeX, I
> > might want to export to LaTeX and transfer to overleaf.com and
> > relative paths would make more sense there, wouldn’t they?
>
> Yes, this is a very valid point.  And often a source of real issues (I
> have this problem sharing with my group where most use Windows... issues
> with paths and upper/lower case names).
>
> --
> : Eric S Fraga, with org release_9.6.1-307-gcd2355 in Emacs 30.0.50



-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet


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

* Re: Friendly exchange of thoughts: citations and LaTeX
  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-29 14:14 ` Ihor Radchenko
  2023-03-29 16:50   ` Pedro Andres Aranda Gutierrez
  2023-05-02 12:51   ` Ihor Radchenko
  1 sibling, 2 replies; 9+ messages in thread
From: Ihor Radchenko @ 2023-03-29 14:14 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List

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

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

* Re: Friendly exchange of thoughts: citations and LaTeX
  2023-03-29 14:14 ` Ihor Radchenko
@ 2023-03-29 16:50   ` Pedro Andres Aranda Gutierrez
  2023-05-02 12:51   ` Ihor Radchenko
  1 sibling, 0 replies; 9+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2023-03-29 16:50 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org Mode List

Looks reasonable... we put the .org and .bib file(s) in the same
directory and we can use relative paths... That's what I would do in a
pure LaTeX environment (and in overleaf.com)

Could be expanded to same directory or its leaves... like when I have
the .org file and a bibliography directory in the same directory...
(Just thinking aloud)

Will check tomorrow before starting with /real life/ ;-)

Thx, /PA

On Wed, 29 Mar 2023 at 16:12, Ihor Radchenko <yantar92@posteo.net> wrote:
>
> 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.
>
>
>
> --
> 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>



-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should
run a leader-deposed hook here, but we can't yet


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

* Re: Friendly exchange of thoughts: citations and LaTeX
  2023-03-29 14:14 ` Ihor Radchenko
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Ihor Radchenko @ 2023-05-02 12:51 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List

Ihor Radchenko <yantar92@posteo.net> writes:

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

I applied an alternative patch that uses the approach from
`org-export--update-included-link' - relative paths are resolved against
top-level file dir and absolute paths are kept absolute.

Handled.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5ec364a1a

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


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

* Re: Friendly exchange of thoughts: citations and LaTeX
  2023-05-02 12:51   ` Ihor Radchenko
@ 2023-05-03  5:00     ` Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2023-05-03  5:00 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org Mode List

Hi Ihor,

sorry for being so silent, but I'm currently at 300% occupation. And statistical mux doesn't work well on human beings...

Marking this as TODO...

thx,/pa

Enviado desde mi iPad

> El 2 may 2023, a las 14:51, Ihor Radchenko <yantar92@posteo.net> escribió:
> 
> Ihor Radchenko <yantar92@posteo.net> writes:
> 
>> 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.
> 
> I applied an alternative patch that uses the approach from
> `org-export--update-included-link' - relative paths are resolved against
> top-level file dir and absolute paths are kept absolute.
> 
> Handled.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5ec364a1a
> 
> -- 
> 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>


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

end of thread, other threads:[~2023-05-03  5:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.