Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-10-02 Thread Max Nikulin
On 27/09/2023 02:12, Juan Manuel Macías wrote: Max Nikulin writes: I just have checked that a dirty hack with a few lines of code for `org-export-filter-final-output-functions' allows to insert arbitrary text to the beginning of export result. Perhaps a more elegant solution exists, but I

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-10-01 Thread Juan Manuel Macías
Max Nikulin writes: > On 28/09/2023 22:36, AW wrote: >> >> The idea to have a LATEX_PRE_HEADER to insert `\DocumentMetadata{}` is >> exactly >> what you need right now, if you export from orgmode to current LaTeX. With >> `\DocumentMetadata{}` you can add most of the necessary xmp data -- and I

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-10-01 Thread Max Nikulin
On 28/09/2023 19:31, Juan Manuel Macías wrote: Starting with \documentclass, the order is important in certain cases and not so important in others. And, anyway, you can always use a hook like \AtBegin... \AtEnd..., etc. I am judging from my past experience. Besides \usepackage{cmap} that was

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-10-01 Thread Max Nikulin
On 28/09/2023 22:36, AW wrote: The idea to have a LATEX_PRE_HEADER to insert `\DocumentMetadata{}` is exactly what you need right now, if you export from orgmode to current LaTeX. With `\DocumentMetadata{}` you can add most of the necessary xmp data -- and I write most, because I'm using it on

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-28 Thread Max Nikulin
On 28/09/2023 19:31, Juan Manuel Macías wrote: I think I should insist on what I said in my previous message, with a copy/paste: The thing is that here it is not a question of whether something can be done in this way or in another better way. This is how a given package recommends doing it. If

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-28 Thread AW
Am Donnerstag, 28. September 2023, 12:07:41 CEST schrieb Max Nikulin: > More I read about .xmpdata, more it looks similar to an ugly kludge from > my point of view. Exporting from orgmode to LaTeX needs a high level approach: don't do complicated things, just use the appropriate LaTeX API.

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-28 Thread Juan Manuel Macías
Max Nikulin writes: > LaTeX code may be inserted > - before \DocumentMetadata > - between \DocumentMetadata and \documentclass > - between \documentclass and preamble added by Org > - between Org preamble and \begin{document} The first two cases can be solved perfectly with LaTeX_pre_header,

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-28 Thread Max Nikulin
On 27/09/2023 02:12, Juan Manuel Macías wrote: Max Nikulin writes: I remember recipes like "put \usepackage{cmap} immediately after \documentclass" (nowadays this particular one should not be necessary). So I would prefer to avoid keywords per each chunk of preamble code. I think that this

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-26 Thread Juan Manuel Macías
Max Nikulin writes: > I just have checked that a dirty hack with a few lines of code for > `org-export-filter-final-output-functions' allows to insert arbitrary > text to the beginning of export result. Perhaps a more elegant solution > exists, but I admit it is not a straightforward way. At

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-26 Thread Max Nikulin
On 26/09/2023 04:57, Thomas S. Dye wrote: Aloha all, Juan Manuel Macías writes: If so, Org should have native support of \DocumentMetadata, not LATEX_PRE_HEADER or something similar. If it were the only case of code before \documentclass, I would agree. But, as I have already said above,

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-25 Thread Thomas S. Dye
Aloha all, Juan Manuel Macías writes: If so, Org should have native support of \DocumentMetadata, not LATEX_PRE_HEADER or something similar. If it were the only case of code before \documentclass, I would agree. But, as I have already said above, the diversity of use cases makes the

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-25 Thread Juan Manuel Macías
Max Nikulin writes: > On 25/09/2023 01:42, Juan Manuel Macías wrote: >> According to the pdfx package documentation >> (https://www.ctan.org/pkg/pdfx), p. 6 (at the bottom of the page)/7: >> --- >> Warning: The \jobname.xmpdata file may be included in the main document >> source, within a

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-25 Thread Max Nikulin
On 25/09/2023 01:42, Juan Manuel Macías wrote: According to the pdfx package documentation (https://www.ctan.org/pkg/pdfx), p. 6 (at the bottom of the page)/7: --- Warning: The \jobname.xmpdata file may be included in the main document source, within a {filecontents*} environment, provided this

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-24 Thread Juan Manuel Macías
Max Nikulin writes: > On 17/09/2023 01:00, Juan Manuel Macías wrote: >> >> [1] A longer example to export to a pdf that has pdf-x compliance, with >> the pdfx package: >> >> \providecommand{\pdfxopts}{x-1a} >> \begin{filecontents*}{\jobname.xmpdata} >>\Title{Some Title} >>

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-22 Thread Max Nikulin
On 17/09/2023 01:00, Juan Manuel Macías wrote: [1] A longer example to export to a pdf that has pdf-x compliance, with the pdfx package: \providecommand{\pdfxopts}{x-1a} \begin{filecontents*}{\jobname.xmpdata} \Title{Some Title} \Author{Author} \Language{es-ES} \Keywords{keywords}

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-18 Thread Ihor Radchenko
Timothy writes: > I’d rather not have this merged at this stage, as I think it may be redundant > once my conditional/generated export work makes its way into Org (next few > months?). Does it mean that conditional export will also support in-file keywords? -- Ihor Radchenko // yantar92, Org

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-17 Thread Timothy
Hi Juan, I’d rather not have this merged at this stage, as I think it may be redundant once my conditional/generated export work makes its way into Org (next few months?). Juan Manuel Macías writes: > Rationale for this patch: in certain cases, in a LaTeX document, it is > necessary to add

Re: [patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-17 Thread Ihor Radchenko
Juan Manuel Macías writes: > Rationale for this patch: in certain cases, in a LaTeX document, it is > necessary to add code before the class declaration (\documentclass...). > For example, commands like \PassOptionsToPackage, \DocumentMetadata{ }, > etc.; or certain packages that should be

[patch] ox-latex.el: Add `LATEX_PRE_HEADER' keyword

2023-09-16 Thread Juan Manuel Macías
Rationale for this patch: in certain cases, in a LaTeX document, it is necessary to add code before the class declaration (\documentclass...). For example, commands like \PassOptionsToPackage, \DocumentMetadata{ }, etc.; or certain packages that should be loaded first using \RequirePackage{}; and