emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Is it possible to have a code fragment in a bulleted list?
@ 2012-01-09  1:07 Stephen J. Barr
  2012-01-09  7:13 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen J. Barr @ 2012-01-09  1:07 UTC (permalink / raw)
  To: emacs-orgmode

Hello fellow org-mode users,

Quick question. Is it possible to have a code fragment in a bulleted
list? For example, I would like to do

- This is interesting
  - Level 2 for loop
#+begin_src R
for (i in 1:10) {
    ...
}
#+end_src
  - This should also be on level 2

When I render this as HTML, the sentences "Level 2 for loop" and "This
should also be on level 2" to be at the same depth, with the source
code block in the middle. How do I do this?

Thanks and sorry for the relatively simple question.

Stephen;

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

* Re: Is it possible to have a code fragment in a bulleted list?
  2012-01-09  1:07 Is it possible to have a code fragment in a bulleted list? Stephen J. Barr
@ 2012-01-09  7:13 ` Nicolas Goaziou
  2012-01-10  2:53   ` Stephen J. Barr
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2012-01-09  7:13 UTC (permalink / raw)
  To: Stephen J. Barr; +Cc: emacs-orgmode

Hello,

"Stephen J. Barr" <stephenjbarr@gmail.com> writes:

> Quick question. Is it possible to have a code fragment in a bulleted
> list? For example, I would like to do
>
> - This is interesting
>   - Level 2 for loop
>
> #+begin_src R
> for (i in 1:10) {
>     ...
> }
> #+end_src
>
>   - This should also be on level 2
>
> When I render this as HTML, the sentences "Level 2 for loop" and "This
> should also be on level 2" to be at the same depth, with the source
> code block in the middle. How do I do this?

You have to indent your whole code block so that it belongs to the list.
In other words, the "#+begin_src" line has to start at the "L" of "Level
2".

You may want to read the section 2.7 of the manual for more information.


Regards,

-- 
Nicolas Goaziou

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

* Re: Is it possible to have a code fragment in a bulleted list?
  2012-01-09  7:13 ` Nicolas Goaziou
@ 2012-01-10  2:53   ` Stephen J. Barr
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen J. Barr @ 2012-01-10  2:53 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Thank you for the suggestion. I'll take a look at it.

On Mon, Jan 9, 2012 at 2:13 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> "Stephen J. Barr" <stephenjbarr@gmail.com> writes:
>
>> Quick question. Is it possible to have a code fragment in a bulleted
>> list? For example, I would like to do
>>
>> - This is interesting
>>   - Level 2 for loop
>>
>> #+begin_src R
>> for (i in 1:10) {
>>     ...
>> }
>> #+end_src
>>
>>   - This should also be on level 2
>>
>> When I render this as HTML, the sentences "Level 2 for loop" and "This
>> should also be on level 2" to be at the same depth, with the source
>> code block in the middle. How do I do this?
>
> You have to indent your whole code block so that it belongs to the list.
> In other words, the "#+begin_src" line has to start at the "L" of "Level
> 2".
>
> You may want to read the section 2.7 of the manual for more information.
>
>
> Regards,
>
> --
> Nicolas Goaziou

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

end of thread, other threads:[~2012-01-10  2:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09  1:07 Is it possible to have a code fragment in a bulleted list? Stephen J. Barr
2012-01-09  7:13 ` Nicolas Goaziou
2012-01-10  2:53   ` Stephen J. Barr

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