emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Re: [PATCH] ob-latex: Added support for including files with a relative path
@ 2022-07-06  6:53 Pedro Andres Aranda Gutierrez
       [not found] ` <CAO48Bk-dtE-8gP9MP0Am-vnw=6GiJx8DJekXFu6PPF+8izxGZg@mail.gmail.com-N6HJruU----2>
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-07-06  6:53 UTC (permalink / raw)
  To: Org Mode List; +Cc: emacs, yantar92

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

>Message-ID: <87fsjfn7jw.fsf@localhost>
>emacs--- via "General discussions about Org-mode."
><emacs-orgmode@gnu.org> writes:
>
>>> Hi, adding an "input" type of header is one option. What about adding a
>>> call to resolve relative file names instead, thus solving maybe other
>>> needs in addition?
>>>
>> That was my second approach. I was concerned that forcing all imports
with
>> an absolute path could break existing exports? Correct me if I'm wrong.
>> Using the :header syntax external files can be loaded in via the old way,
>> whereas using :inputs all relative paths are resolved.
>> The downside of course is that we clutter the export settings with a new
>> parameter.
>
>Rather than changing paths to absolute, we can simply play with the
>working directly for latex process and set it to the directory of the
>.org file (unless :dir argument is passed to the latex source block).
>This is probably the most expected behavior.
>
>Best,
>Ihor

Just my .01 cents...

For Latex stuff I'm using just
#+HEADER: \input{preamble}
and have my preamble.tex in the working directory. (For Beamer stuff it
goes in a LATEX_HEADER).

Changing that to
#+HEADER :inputs '("preamble")
well, would be a matter of taste.

However, adding the :dir option to the equation could be a game-changer for
me (at least)

Best, /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

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

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

* Re: Re: [PATCH] ob-latex: Added support for including files with a relative path
       [not found] ` <CAO48Bk-dtE-8gP9MP0Am-vnw=6GiJx8DJekXFu6PPF+8izxGZg@mail.gmail.com-N6HJruU----2>
@ 2022-07-06  7:49   ` emacs--- via General discussions about Org-mode.
  2022-07-06 10:18     ` Pedro Andres Aranda Gutierrez
  2022-07-07 10:52     ` Ihor Radchenko
  0 siblings, 2 replies; 4+ messages in thread
From: emacs--- via General discussions about Org-mode. @ 2022-07-06  7:49 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List, yantar92

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



> >>> Hi, adding an "input" type of header is one option. What about adding a
> >>> call to resolve relative file names instead, thus solving maybe other
> >>> needs in addition?
> >>>
> >> That was my second approach. I was concerned that forcing all imports with
> >> an absolute path could break existing exports? Correct me if I'm wrong. 
> >> Using the :header syntax external files can be loaded in via the old way,
> >> whereas using :inputs all relative paths are resolved. 
> >> The downside of course is that we clutter the export settings with a new 
> >> parameter. 
> >
> >Rather than changing paths to absolute, we can simply play with the
> >working directly for latex process and set it to the directory of the
> >.org file (unless :dir argument is passed to the latex source block).
> >This is probably the most expected behavior.
> >
> >Best,
> >Ihor
>
> Just my .01 cents...
>
> For Latex stuff I'm using just
>
> #+HEADER: \input{preamble} 
>
> and have my preamble.tex in the working directory. (For Beamer stuff it goes in a LATEX_HEADER).
>
> Changing that to
>
> #+HEADER :inputs '("preamble")
>
> well, would be a matter of taste. 
>
Ox-beamer (ox-latex) executes all latex commands at the current directory of 
your org file, whereas ob-latex uses a temporary file to do its thing. 
(with-temp-file FILE &rest BODY)
I think this is mostly done to prent metafiles from cluttering your current 
directory. 

Different export types, or different user included packages, generate different
 metafiles. This makes an automated cleanup process afterwards a bit more
complicated I think, if not impossible. 

The temporary file makes it hard to add files to the working directory. 








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

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

* Re: [PATCH] ob-latex: Added support for including files with a relative path
  2022-07-06  7:49   ` emacs--- via General discussions about Org-mode.
@ 2022-07-06 10:18     ` Pedro Andres Aranda Gutierrez
  2022-07-07 10:52     ` Ihor Radchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-07-06 10:18 UTC (permalink / raw)
  To: emacs; +Cc: Org Mode List, yantar92

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

First time to hear that. 
I wasn’t aware of it 8-0. 
Will need to recheck my projects and settings to see what I was accidentally doing right… in the sense that it was working as intended…

Thx/PA

PS: once again I’ll go to sleep and will have learnt something new (as the Spanish proverb goes)

Enviado desde mi iPhone

> El 6 jul 2022, a las 9:49, emacs@vergauwen.me escribió:
> 
> 
> 
> >>> Hi, adding an "input" type of header is one option. What about adding a
> >>> call to resolve relative file names instead, thus solving maybe other
> >>> needs in addition?
> >>>
> >> That was my second approach. I was concerned that forcing all imports with
> >> an absolute path could break existing exports? Correct me if I'm wrong. 
> >> Using the :header syntax external files can be loaded in via the old way,
> >> whereas using :inputs all relative paths are resolved. 
> >> The downside of course is that we clutter the export settings with a new 
> >> parameter. 
> >
> >Rather than changing paths to absolute, we can simply play with the
> >working directly for latex process and set it to the directory of the
> >.org file (unless :dir argument is passed to the latex source block).
> >This is probably the most expected behavior.
> >
> >Best,
> >Ihor
> 
> Just my .01 cents...
> 
> For Latex stuff I'm using just
> 
> #+HEADER: \input{preamble} 
> 
> and have my preamble.tex in the working directory. (For Beamer stuff it goes in a LATEX_HEADER).
> 
> Changing that to
> 
> #+HEADER :inputs '("preamble")
> 
> well, would be a matter of taste. 
> Ox-beamer (ox-latex) executes all latex commands at the current directory of 
> your org file, whereas ob-latex uses a temporary file to do its thing. 
> (with-temp-file FILE &rest BODY)
> I think this is mostly done to prent metafiles from cluttering your current 
> directory. 
> 
> Different export types, or different user included packages, generate different
> metafiles. This makes an automated cleanup process afterwards a bit more
> complicated I think, if not impossible. 
> 
> The temporary file makes it hard to add files to the working directory. 
> 
> 
> 
> 
> 
> 
> 

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

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

* Re: Re: [PATCH] ob-latex: Added support for including files with a relative path
  2022-07-06  7:49   ` emacs--- via General discussions about Org-mode.
  2022-07-06 10:18     ` Pedro Andres Aranda Gutierrez
@ 2022-07-07 10:52     ` Ihor Radchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2022-07-07 10:52 UTC (permalink / raw)
  To: emacs; +Cc: Pedro Andres Aranda Gutierrez, Org Mode List

emacs@vergauwen.me writes:

> Different export types, or different user included packages, generate different
>  metafiles. This makes an automated cleanup process afterwards a bit more
> complicated I think, if not impossible. 
>
> The temporary file makes it hard to add files to the working directory. 

Not too hard I'd say.
All we need is (1) record the directory files before running LaTeX; (2)
Run LaTeX; (3) Remove all the added files but the generated output file.

Best,
Ihor


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

end of thread, other threads:[~2022-07-07 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-06  6:53 Re: [PATCH] ob-latex: Added support for including files with a relative path Pedro Andres Aranda Gutierrez
     [not found] ` <CAO48Bk-dtE-8gP9MP0Am-vnw=6GiJx8DJekXFu6PPF+8izxGZg@mail.gmail.com-N6HJruU----2>
2022-07-06  7:49   ` emacs--- via General discussions about Org-mode.
2022-07-06 10:18     ` Pedro Andres Aranda Gutierrez
2022-07-07 10:52     ` Ihor Radchenko

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