emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Special blocks with options in LaTeX export
@ 2015-06-28 11:23 Suvayu Ali
  2015-06-28 11:30 ` Rasmus
  0 siblings, 1 reply; 5+ messages in thread
From: Suvayu Ali @ 2015-06-28 11:23 UTC (permalink / raw)
  To: Emacs Org mode

Hi,

I am trying to export special blocks with options.  But it seems the
options part is being ignored completely.  I expect the following:

  #+begin_aside :options {Combinatorial background}
  It is all random!
  #+end_aside

to be exported as:

  \begin{aside}{Combinatorial background}
  It is all random!
  \end{aside}

However what I get is without the extra argument to the environment.

Am I missing something, or is this a bug?

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Special blocks with options in LaTeX export
  2015-06-28 11:23 Special blocks with options in LaTeX export Suvayu Ali
@ 2015-06-28 11:30 ` Rasmus
  2015-06-28 11:41   ` Suvayu Ali
  2015-07-30  8:50   ` Sebastien Vauban
  0 siblings, 2 replies; 5+ messages in thread
From: Rasmus @ 2015-06-28 11:30 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hi,
>
> I am trying to export special blocks with options.  But it seems the
> options part is being ignored completely.  I expect the following:
>
>   #+begin_aside :options {Combinatorial background}
>   It is all random!
>   #+end_aside
>
> to be exported as:
>
>   \begin{aside}{Combinatorial background}
>   It is all random!
>   \end{aside}
>
> However what I get is without the extra argument to the environment.
>
> Am I missing something, or is this a bug?

#+attr_latex: :options test
#+begin_aside 
random 
#+end_aside

Options are read via 

        (org-export-read-attribute :attr_latex special-block :options).

As to whether special blocks should support options via a keyword like in
your example, I do not know.  FWIW ox-html also reads attributes for
special blocks via an ATTR_BACKEND line.

Rasmus


-- 
There are known knowns; there are things we know that we know

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

* Re: Special blocks with options in LaTeX export
  2015-06-28 11:30 ` Rasmus
@ 2015-06-28 11:41   ` Suvayu Ali
  2015-07-30  8:50   ` Sebastien Vauban
  1 sibling, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2015-06-28 11:41 UTC (permalink / raw)
  To: emacs-orgmode

Hi Rasmus,

On Sun, Jun 28, 2015 at 01:30:33PM +0200, Rasmus wrote:
> 
> Options are read via 
> 
>         (org-export-read-attribute :attr_latex special-block :options).
> 
> As to whether special blocks should support options via a keyword like in
> your example, I do not know.  FWIW ox-html also reads attributes for
> special blocks via an ATTR_BACKEND line.

I expected it to work because the manual says so, see "Special blocks in
LaTeX export" in (info "(org) LaTeX specific attributes").

A brief quote:

  In LaTeX back-end, special blocks become environments of the same name.
  Value of ‘:options’ attribute will be appended as-is to that
  environment’s opening string.  For example: [...]

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Special blocks with options in LaTeX export
  2015-06-28 11:30 ` Rasmus
  2015-06-28 11:41   ` Suvayu Ali
@ 2015-07-30  8:50   ` Sebastien Vauban
  2015-07-30 10:09     ` Rasmus
  1 sibling, 1 reply; 5+ messages in thread
From: Sebastien Vauban @ 2015-07-30  8:50 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Rasmus <rasmus-0UDz38MK/Mo@public.gmane.org> writes:
> Suvayu Ali <fatkasuvayu+linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> I am trying to export special blocks with options.  But it seems the
>> options part is being ignored completely.  I expect the following:
>>
>>   #+begin_aside :options {Combinatorial background}
>>   It is all random!
>>   #+end_aside
>>
>> to be exported as:
>>
>>   \begin{aside}{Combinatorial background}
>>   It is all random!
>>   \end{aside}
>>
>> However what I get is without the extra argument to the environment.
>>
>> Am I missing something, or is this a bug?
>
> #+attr_latex: :options test
>
> #+begin_aside 
> random 
> #+end_aside

I think Suvayu uncovers something interesting: how do we give a "title"
to such an admonition (note, warning, tip, sidebar, etc.)?

If we want to export our document to multiple backends, we would be
forced to have:

--8<---------------cut here---------------start------------->8---
  #+attr_html: :options {By the way...}
  #+attr_latex: :options {By the way...}
  #+attr_odt: :options {By the way...}
  #+begin_note
  This is a useful note (with a title).
  #+end_note
--8<---------------cut here---------------end--------------->8---

Wouldn't it make more sense to get the title as part of the admonition,
as Suvayu tried it in his OP?

--8<---------------cut here---------------start------------->8---
  #+begin_note :options {By the way...}
  This is a useful note (with a title).
  #+end_note
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Special blocks with options in LaTeX export
  2015-07-30  8:50   ` Sebastien Vauban
@ 2015-07-30 10:09     ` Rasmus
  0 siblings, 0 replies; 5+ messages in thread
From: Rasmus @ 2015-07-30 10:09 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com>
writes:

> Rasmus <rasmus@gmx.us> writes:
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>>> I am trying to export special blocks with options.  But it seems the
>
>>> options part is being ignored completely.  I expect the following:
>>>
>>>   #+begin_aside :options {Combinatorial background}
>>>   It is all random!
>>>   #+end_aside
>>>
>>> to be exported as:
>>>
>>>   \begin{aside}{Combinatorial background}
>>>   It is all random!
>>>   \end{aside}
>>>
>>> However what I get is without the extra argument to the environment.
>>>
>>> Am I missing something, or is this a bug?
>>
>> #+attr_latex: :options test
>>
>> #+begin_aside 
>> random 
>> #+end_aside
>
> I think Suvayu uncovers something interesting: how do we give a "title"
> to such an admonition (note, warning, tip, sidebar, etc.)?
>
> If we want to export our document to multiple backends, we would be
> forced to have:
>
>   #+attr_html: :options {By the way...}
>   #+attr_latex: :options {By the way...}
>   #+attr_odt: :options {By the way...}
>   #+begin_note
>   This is a useful note (with a title).
>   #+end_note

Isn't this too stylized?   Wouldn't it rather be

#+attr_html: :options "title='BTW'"
#+attr_latex: :options {BTW}
#+begin_note
This is a useful note (with a title).
#+end_note

ox-html has not restrictions on attr_html BTW.

> Wouldn't it make more sense to get the title as part of the admonition,
> as Suvayu tried it in his OP?
>
>   #+begin_note :options {By the way...}
>   This is a useful note (with a title).
>   #+end_note

If you have something that should be shared across identically across
backends.  For a title I guess you'd use a caption, right?  A macro would
be a quick way to allow solutions once you know the right mapping between
the option element and backend transforming.

Rasmus

-- 
Dobbelt-A

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

end of thread, other threads:[~2015-07-30 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-28 11:23 Special blocks with options in LaTeX export Suvayu Ali
2015-06-28 11:30 ` Rasmus
2015-06-28 11:41   ` Suvayu Ali
2015-07-30  8:50   ` Sebastien Vauban
2015-07-30 10:09     ` Rasmus

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