[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] line numbers in org src blocks?
From: |
Nick Dokos |
Subject: |
Re: [O] line numbers in org src blocks? |
Date: |
Tue, 13 Oct 2015 10:23:15 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
John Kitchin <jkitchin <at> andrew.cmu.edu> writes:
>
> Does anyone know if it is possible to get line numbering only in code
> blocks in an org-file?
>
When exporting? Or in the buffer? If the latter, I don't know. If the
former, -n does that but it is position-sensitive I think:
--8<---------------cut here---------------start------------->8---
* A code block for exporting with line number
#+BEGIN_SRC python -n :exports code
import sys
sys.exit(0)
#+END_SRC
#+BEGIN_EXAMPLE -n
import sys
sys.exit(0)
#+END_EXAMPLE
--8<---------------cut here---------------end--------------->8---
works, but putting it at the end of the BEGIN_SRC line does not.
See
(info "(org) Literal examples")
for more.
--
Nick