0

Imagine we have the following content of an org-file:

|       | Col 1 | Col 2 |
| row 1 |       |       |
| row 2 |       |       |

#+name: Table1
#+begin_src org
|       | Col 1 | Col 2 |
| row 1 |       |       |
| row 2 |       |       |
#+end_src

With the former table I can do a lot convenient things like swapping rows or columns etc.

When working with a table inside the source block (the latter table) all the useful commands and shortcuts are disabled. It would be extremely convenient to have them enabled, wouldn't it? But how can I achieve that?

7
  • Why are you putting org-tables inside source blocks?
    – crocefisso
    Commented Oct 16, 2023 at 18:23
  • I want to generate several other documents with the same table as a content. My idea is to write the content of those documents also in source blocks with my table included with the use of noweb by <<Table1>>. Then I can easily tangle them. Do you have a simpler approach? Commented Oct 16, 2023 at 20:34
  • Yes, there are various ways to do that. The most common is to name your table, put #+name: Table1 just above the table, then in the file where you want to have it, use #+include: "PATH/FILE_NAME.org::Table1"
    – crocefisso
    Commented Oct 16, 2023 at 20:44
  • Also org-transclusion might be useful.
    – crocefisso
    Commented Oct 16, 2023 at 20:47
  • It guess it may be a dumb question but I cannot find the answer on the net nor figure it out by myself: "How can I use #include approach to include org content within the_same file?" Commented Oct 16, 2023 at 21:13

1 Answer 1

1

Just run org-edit-special when in the src block.

You will then a proper org mode "side-buffer" with all the command

This is bound to C-c ' by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.