nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
917 stars 44 forks source link

line numbering in code block exports #167

Closed kpe closed 1 year ago

kpe commented 1 year ago

Not sure, if that's the right place to ask this, but:

I cannot figure out, how to enable line numbering (#+begin_src: lang -n) when exporting a transclusion (to PDF). Line numbering without #+trasclude: works for me if I append -n after the #+begin_src:, i.e.

An example:

#+begin_src: python -n
println("hello")
#+end_src:

However, if I try something like:

An example:

#+transclude: [[file:hello.py]] src: python -n

the -n will not be preserved in the #+begin_src: header.

Is there are way to enforce the line numbering, when a transclusion is exported, or to specify additional arguments (i.e. -n) for the #+begin_src: line.

nobiot commented 1 year ago

I suggest you try adding :rest "-n" like this:

#+transclude: [[file:hello.py]] src: python :rest "-n"
nobiot commented 1 year ago

I was hoping that this section of the user manual was clear enough. Please let me know if you have some suggestion for improvement.

Use ‘:rest’ property to define additional properties you would like to add for the src-block. The double quotation marks are mandatory for the ‘:rest’ property.

#+transclude: [[file:../../test/python-3.py]]  :src python :rest ":session :results value"
kpe commented 1 year ago

ohh... sorry, my fault. And thanks! I must have missed that, while reading the docu. It is clearly explained, I just haven't found it.

nobiot commented 1 year ago

Please do not worry. I'm genuinely interested in improving discoverability of manual and features available.