Re: Friendly exchange of thoughts: citations and LaTeX

2023-05-02 Thread Pedro Andres Aranda Gutierrez
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  escribió:
> 
> Ihor Radchenko  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 .
> Support Org development at ,
> or support my work at 



Re: Friendly exchange of thoughts: citations and LaTeX

2023-05-02 Thread Ihor Radchenko
Ihor Radchenko  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 .
Support Org development at ,
or support my work at 



Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-29 Thread Pedro Andres Aranda Gutierrez
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  wrote:
>
> Pedro Andres Aranda Gutierrez  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 .
> Support Org development at ,
> or support my work at 



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



Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-29 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  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.

>From f068094cc850e7387633bbd57e1c0bfc7e395b21 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
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_m6oxb...@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



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-27 Thread Pedro Andres Aranda Gutierrez
> 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  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



Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-27 Thread Fraga, Eric
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

Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-27 Thread Pedro Andres Aranda Gutierrez
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  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



Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-23 Thread Fraga, Eric
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


Friendly exchange of thoughts: citations and LaTeX

2023-03-20 Thread Pedro Andres Aranda Gutierrez
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