emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Org list source block


From: Nicolas Goaziou
Subject: Re: [O] Org list source block
Date: Sun, 03 Jan 2016 18:23:10 +0100

Hello,

Jarmo Hurri <address@hidden> writes:

> Once again I fail when I try to do something very _simple_ with Org.

You're building programmatically your document. I don't believe it
belongs to "very simple" tasks.

> I am trying to define a checklist and then use the same list in my
> exported document in multiple locations. I don't think macros would work
> here, since my org code has multiple lines. So I am trying to use
> Babel.
>
> The idea would be the following (please ignore code block header
> arguments):
>
> # -----------------------------------------------------------------
> * Test list
>   #+NAME: my-list
>   #+BEGIN_SRC org :exports code :results value org
>   - [ ] foo - [ ] bar #+END_SRC
>
>   #+BEGIN_SRC org :noweb yes
>   <<my-list>>
>   #+END_SRC
> # -----------------------------------------------------------------
>
> I have tried to do this in many different ways, but in my exported file
> the checklist always appears as an unformatted code block; that is,
> checklist appear as '[ ]', not as nicely formatted LaTeX boxes. I have
> tried to vary ':exports' and ':results' to no avail.
>
> What is the correct solution to this?

I think something along the following lines should work.

  #+NAME: mylist
  #+BEGIN_SRC org :results raw :exports none
  - [ ] foo 
  - [ ] bar 
  #+END_SRC

  #+CALL: mylist() :results raw
  #+RESULTS:

  #+CALL: mylist() :results raw
  #+RESULTS:

> BTW, if there is a solution to this, I think future generations might
> benefit if something about it were mentioned in the manual in section
> 11.6 "Macro replacement".

As you noticed already, you are not using a macro. Why would it be in
macro replacement?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]