emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* multiple EXPORT_LATEX_HEADER lines
@ 2020-06-12  8:08 Alan Schmitt
  2020-06-12  8:31 ` Dominik Schrempf
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Schmitt @ 2020-06-12  8:08 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

I would like to have a multi-line export header when exporting a
subtree. I tried this:

:EXPORT_LATEX_HEADER: \makeatletter
:EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
:EXPORT_LATEX_HEADER+: \makeatother

The problem is that it's exported on a single line, and as such it does
not work. Is there a way to have the multiple properties exported as
multiple lines, or to specify in the property there is a line break?

Thanks,

Alan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12  8:08 multiple EXPORT_LATEX_HEADER lines Alan Schmitt
@ 2020-06-12  8:31 ` Dominik Schrempf
  2020-06-12  8:37   ` Alan Schmitt
  2020-06-16 18:03   ` Nick Dokos
  0 siblings, 2 replies; 13+ messages in thread
From: Dominik Schrempf @ 2020-06-12  8:31 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hello,

are you looking for, e.g.,

#+latex_header: \addbibresource{bibliography.bib}
#+latex_header_extra: do some stuff
#+latex_header_extra: and even more

I don't use the EXPORT keyword at the beginning, I am not sure if it is needed.

Best,
Dominik

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello,
>
> I would like to have a multi-line export header when exporting a
> subtree. I tried this:
>
> :EXPORT_LATEX_HEADER: \makeatletter
> :EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
> :EXPORT_LATEX_HEADER+: \makeatother
>
> The problem is that it's exported on a single line, and as such it does
> not work. Is there a way to have the multiple properties exported as
> multiple lines, or to specify in the property there is a line break?
>
> Thanks,
>
> Alan



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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12  8:31 ` Dominik Schrempf
@ 2020-06-12  8:37   ` Alan Schmitt
  2020-06-12 12:01     ` Jeremie Juste
  2020-06-16 18:03   ` Nick Dokos
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Schmitt @ 2020-06-12  8:37 UTC (permalink / raw)
  To: Dominik Schrempf; +Cc: emacs-orgmode

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

Hello Dominik,

On 2020-06-12 10:31, Dominik Schrempf <dominik.schrempf@gmail.com> writes:

> are you looking for, e.g.,
>
> #+latex_header: \addbibresource{bibliography.bib}
> #+latex_header_extra: do some stuff
> #+latex_header_extra: and even more
>
> I don't use the EXPORT keyword at the beginning, I am not sure if it is needed.

To be more precise, I want to emulate
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
#+LATEX_HEADER+: \makeatother

(as a full file export, which yields 3 separate lines), for a subtree
export, were the property :EXPORT_LATEX_HEADER: is used.

Best,

Alan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12  8:37   ` Alan Schmitt
@ 2020-06-12 12:01     ` Jeremie Juste
  2020-06-12 12:30       ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Jeremie Juste @ 2020-06-12 12:01 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Dominik Schrempf, emacs-orgmode

Hello,

can reproduce the issue with

* hello
  :PROPERTIES:
  :EXPORT_LATEX_HEADER: \makeatletter
  :EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}} 
  :EXPORT_LATEX_HEADER+: \makeatother
  :END:

But I have some more questions. I can see the :EXPORT_LATEX_HEADER in
the properties menu. (C-x p) but how did you even find :EXPORT_LATEX_HEADER+
property name?

I didn't see anything regarding this in the doc. It might well be
because I'm lagging behind - Org mode version 9.2.3.


Best regards,
Jeremie



Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello Dominik,
>
> On 2020-06-12 10:31, Dominik Schrempf <dominik.schrempf@gmail.com> writes:
>
>> are you looking for, e.g.,
>>
>> #+latex_header: \addbibresource{bibliography.bib}
>> #+latex_header_extra: do some stuff
>> #+latex_header_extra: and even more
>>
>> I don't use the EXPORT keyword at the beginning, I am not sure if it is needed.
>
> To be more precise, I want to emulate
> #+LATEX_HEADER: \makeatletter
> #+LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
> #+LATEX_HEADER+: \makeatother
>
> (as a full file export, which yields 3 separate lines), for a subtree
> export, were the property :EXPORT_LATEX_HEADER: is used.
>
> Best,
>
> Alan


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12 12:01     ` Jeremie Juste
@ 2020-06-12 12:30       ` Eric S Fraga
  2020-06-12 14:47         ` Jeremie Juste
  0 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2020-06-12 12:30 UTC (permalink / raw)
  To: Jeremie Juste; +Cc: emacs-orgmode

On Friday, 12 Jun 2020 at 14:01, Jeremie Juste wrote:
> But I have some more questions. I can see the :EXPORT_LATEX_HEADER in
> the properties menu. (C-x p) but how did you even find :EXPORT_LATEX_HEADER+
> property name?

This is a standard syntax for adding values to a property.  From the info manual:

If you want to add to the value of an existing property, append a ‘+’ to
the property name.  The following results in the property ‘var’ having
the value ‘foo=1 bar=2’.

     #+PROPERTY: var  foo=1
     #+PROPERTY: var+ bar=2

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-636-gaa32f6


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12 12:30       ` Eric S Fraga
@ 2020-06-12 14:47         ` Jeremie Juste
  2020-06-12 15:01           ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Jeremie Juste @ 2020-06-12 14:47 UTC (permalink / raw)
  To: emacs-orgmode


Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
> This is a standard syntax for adding values to a property.  From the info manual:
>
> If you want to add to the value of an existing property, append a ‘+’ to
> the property name.  The following results in the property ‘var’ having
> the value ‘foo=1 bar=2’.
>
>      #+PROPERTY: var  foo=1
>      #+PROPERTY: var+ bar=2

Many thanks for the info. So, with respect the original post, the behavior of the following
code is to be expected?

* hello
  :PROPERTIES:
  :EXPORT_LATEX_HEADER: \makeatletter
  :EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}} 
  :EXPORT_LATEX_HEADER+: \makeatother
  :END:

Best regards,
Jeremie

PS: The automatic time stamp of the sender when replying is a nice piece
of technology. I guess, I have to read the gnus manual again. :-)
> On Friday, 12 Jun 2020 at 14:01, Jeremie Juste wrote:



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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12 14:47         ` Jeremie Juste
@ 2020-06-12 15:01           ` Eric S Fraga
  2020-06-12 16:24             ` Jeremie Juste
  2020-06-13 15:02             ` Alan Schmitt
  0 siblings, 2 replies; 13+ messages in thread
From: Eric S Fraga @ 2020-06-12 15:01 UTC (permalink / raw)
  To: Jeremie Juste; +Cc: emacs-orgmode

On Friday, 12 Jun 2020 at 16:47, Jeremie Juste wrote:
> Many thanks for the info. So, with respect the original post, the behavior of the following
> code is to be expected?

I am not sure I understand your question.  Sorry.

The snippet from the OP will collate all three LaTeX header lines into a
single line on export, which is expected in terms of org's
behaviour.  This appears to cause problems with LaTeX, which is maybe
expected or not; I don't know what LaTeX expects when working in @
letter mode as I've seldom (if ever?) had to redefine @ variables.

> PS: The automatic time stamp of the sender when replying is a nice
> piece of technology. I guess, I have to read the gnus manual
> again. :-)

I use: 

(setq message-citation-line-format "On %A, %e %b %Y at %R, %N wrote:")

eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-636-gaa32f6


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12 15:01           ` Eric S Fraga
@ 2020-06-12 16:24             ` Jeremie Juste
  2020-06-13 15:02             ` Alan Schmitt
  1 sibling, 0 replies; 13+ messages in thread
From: Jeremie Juste @ 2020-06-12 16:24 UTC (permalink / raw)
  To: emacs-orgmode


> I am not sure I understand your question.  Sorry.
You read my mind.
>
> The snippet from the OP will collate all three LaTeX header lines into a
> single line on export, which is expected in terms of org's
> behaviour.
This is exactly what I was referring to. If the behavior of
:EXPORT_LATEX_HEADER: and :EXPORT_LATEX_HEADER:+ and all the property
keys with a (+) prefix is to collate the line then it is the expected behavior.

Then keys such as :EXPORT_LATEX_HEADER: might be misleading for the
user as he may want to use multiple line header.

One solution might be to add another suffix say :EXPORT_LATEX_HEADER++:
to generate multiple lines during the export. But I'm must quickly add that I
don't have the knowledge to do it neither to  understand the implication
of this change.

Best regards,
Jeremie

PS:
> (setq message-citation-line-format "On %A, %e %b %Y at %R, %N wrote:")
Many thanks for the info. I was also given this precious reference:
(info "(sc) What Supercite Does")


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12 15:01           ` Eric S Fraga
  2020-06-12 16:24             ` Jeremie Juste
@ 2020-06-13 15:02             ` Alan Schmitt
  2020-06-15  9:20               ` Eric S Fraga
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Schmitt @ 2020-06-13 15:02 UTC (permalink / raw)
  To: Eric S Fraga, Jeremie Juste; +Cc: emacs-orgmode

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

Hello,

On 2020-06-12 16:01, Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> The snippet from the OP will collate all three LaTeX header lines into a
> single line on export, which is expected in terms of org's
> behaviour.  This appears to cause problems with LaTeX, which is maybe
> expected or not; I don't know what LaTeX expects when working in @
> letter mode as I've seldom (if ever?) had to redefine @ variables.

This is the crux of the issue: there does not seem to be any way to
generate a multi-line header. And this causes problems with LaTeX.

There are two workarounds for this that I know of: put the latex in some
other file and \input it, or use a dedicated file and use multiple
#+LATEX_HEADER. I ended up doing it that way.

Thanks,

Alan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-13 15:02             ` Alan Schmitt
@ 2020-06-15  9:20               ` Eric S Fraga
  2020-06-16  8:46                 ` Alan Schmitt
  0 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2020-06-15  9:20 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

On Saturday, 13 Jun 2020 at 17:02, Alan Schmitt wrote:
> This is the crux of the issue: there does not seem to be any way to
> generate a multi-line header. And this causes problems with LaTeX.

Is the problem solvable in LaTeX?  Does \makeatletter expect to be on a
single line?  As I said before, I've seldom played with @ variables or
functions in LaTeX.  However, I had the impression that LaTeX was quite
robust with respect to whitespace & newlines.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-636-gaa32f6


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-15  9:20               ` Eric S Fraga
@ 2020-06-16  8:46                 ` Alan Schmitt
  2020-06-16  9:55                   ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Schmitt @ 2020-06-16  8:46 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

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

Hello Eric,

On 2020-06-15 10:20, Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Saturday, 13 Jun 2020 at 17:02, Alan Schmitt wrote:
>> This is the crux of the issue: there does not seem to be any way to
>> generate a multi-line header. And this causes problems with LaTeX.
>
> Is the problem solvable in LaTeX?  Does \makeatletter expect to be on a
> single line?  As I said before, I've seldom played with @ variables or
> functions in LaTeX.  However, I had the impression that LaTeX was quite
> robust with respect to whitespace & newlines.

You're right, it should work in a single line. I don't what I did that
made it fail, and I no longer can reproduce it. Sorry for the noise.

Best,

Alan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-16  8:46                 ` Alan Schmitt
@ 2020-06-16  9:55                   ` Eric S Fraga
  0 siblings, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2020-06-16  9:55 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

On Tuesday, 16 Jun 2020 at 10:46, Alan Schmitt wrote:
> You're right, it should work in a single line. I don't what I did that
> made it fail, and I no longer can reproduce it. Sorry for the noise.

Glad you solved it!   
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-636-gaa32f6


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

* Re: multiple EXPORT_LATEX_HEADER lines
  2020-06-12  8:31 ` Dominik Schrempf
  2020-06-12  8:37   ` Alan Schmitt
@ 2020-06-16 18:03   ` Nick Dokos
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Dokos @ 2020-06-16 18:03 UTC (permalink / raw)
  To: emacs-orgmode

Dominik Schrempf <dominik.schrempf@gmail.com> writes:

> Hello,
>
> are you looking for, e.g.,
>
> #+latex_header: \addbibresource{bibliography.bib}
> #+latex_header_extra: do some stuff
> #+latex_header_extra: and even more
>
> I don't use the EXPORT keyword at the beginning, I am not sure if it is needed.
>
> Best,
> Dominik

Just as a clarification: the "_extra" here does not mean "append to previous value".

The only difference between "#+latex_header: " and #+latex_header_extra: " is
that anything specified in the former is *also* used when constructing the header
for the LaTeX file for previewing LaTeX fragments, whereas anything specified in the
latter is only used when exporting: it is not used when previewing.

See

    (info "(org) LaTeX header and sectioning")

which says:

,----
|    The LaTeX export back-end appends values from ‘LATEX_HEADER’ and
| ‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header.  The docstring for
| ‘org-latex-classes’ explains in more detail.  Also note that LaTeX
| export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when
| previewing LaTeX snippets (see *note Previewing LaTeX fragments::).
`----

and the code in ox-latex.el:org-latex-make-preamble.

>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Hello,
>>
>> I would like to have a multi-line export header when exporting a
>> subtree. I tried this:
>>
>> :EXPORT_LATEX_HEADER: \makeatletter
>> :EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
>> :EXPORT_LATEX_HEADER+: \makeatother
>>
>> The problem is that it's exported on a single line, and as such it does
>> not work. Is there a way to have the multiple properties exported as
>> multiple lines, or to specify in the property there is a line break?
>>
>> Thanks,
>>
>> Alan
>
>
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



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

end of thread, other threads:[~2020-06-16 18:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  8:08 multiple EXPORT_LATEX_HEADER lines Alan Schmitt
2020-06-12  8:31 ` Dominik Schrempf
2020-06-12  8:37   ` Alan Schmitt
2020-06-12 12:01     ` Jeremie Juste
2020-06-12 12:30       ` Eric S Fraga
2020-06-12 14:47         ` Jeremie Juste
2020-06-12 15:01           ` Eric S Fraga
2020-06-12 16:24             ` Jeremie Juste
2020-06-13 15:02             ` Alan Schmitt
2020-06-15  9:20               ` Eric S Fraga
2020-06-16  8:46                 ` Alan Schmitt
2020-06-16  9:55                   ` Eric S Fraga
2020-06-16 18:03   ` Nick Dokos

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