emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Jarmo Hurri <jarmo.hurri@iki.fi>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org list source block
Date: Sun, 3 Jan 2016 09:08:47 -0800	[thread overview]
Message-ID: <alpine.OSX.2.20.1601030903510.608@charles-berrys-macbook.local> (raw)
In-Reply-To: <87d1tiygzh.fsf@iki.fi>

On Sun, 3 Jan 2016, Jarmo Hurri wrote:

>
> Greetings.
>
> Once again I fail when I try to do something very _simple_ with Org.
>
> 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?
>

Is this what you want?

--8<---------------cut here---------------start------------->8---
\section{Test list}
\label{sec:orgheadline1}
\begin{org}
\begin{itemize}
\item $\square$ foo
\item $\square$ bar
\end{itemize}
\end{org}
--8<---------------cut here---------------end--------------->8---

If so, you can get it with

--8<---------------cut here---------------start------------->8---
* Test list
#+NAME: my-list
#+BEGIN_SRC org :exports none :results value org
     - [ ] foo
     - [ ] bar
#+END_SRC

#+BEGIN_SRC org :noweb yes :results replace :wrap org :exports results
   <<my-list>>
#+END_SRC
--8<---------------cut here---------------end--------------->8---


Assuming that (require 'ob-org) has been taken care of!

HTH,

Chuck

  parent reply	other threads:[~2016-01-03 17:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 12:39 Org list source block Jarmo Hurri
2016-01-03 14:10 ` Richard Lawrence
2016-01-03 14:47   ` Jarmo Hurri
2016-01-03 17:08 ` Charles C. Berry [this message]
2016-01-04 15:33   ` Jarmo Hurri
2016-01-03 17:23 ` Nicolas Goaziou
2016-01-04 15:26   ` Jarmo Hurri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.1601030903510.608@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=jarmo.hurri@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).