4 ms·
Anyone know if it's possible to tag a paragraph, or non-heading element, in org?
by nanna 6y ago
Anyone know if it's possible to tag a paragraph, or non-heading element, in org?
- olivierestsage 6y agoI do this in a sort of roundabout way, by actually using a new heading for each paragraph (helps with outlining). You can make this work by adding the :ignore: tag to the headings, which means that the heading titles won't be exported when you export the document, but the text under them will. Basically, you get an invisible outline of your document that you can tag however you like. It requires some light setup to get working, since it's not part of the base functionality of Org. First, add these lines to your config (more details on StackExchange[1]): (require 'ox-extra) (ox-extras-activate '(ignore-headlines)) Now you can add the :ignore: tag, and any other tags you want, to the heading for any paragraph. When you export, you'll just get the paragraphs, not the headings or tags. [1] https://emacs.stackexchange.com/questions/38184/org-mode-ignore-heading-when-exporting-to-latex https://emacs.stackexchange.com/questions/38184/org-mode-ign...
- nanna 6y agoThat's pretty neat, thank you! I'll give that a go. I suppose radio target links function a bit like inline tags, in a way, in that wrapping a string in <<<angle brackets>>> and C-c'ing it turns every use of that string in the file into a C-o'able link to the original radio target. Definitely not as featureful as proper :tags: but also has it's uses...
- dangom 6y agoAs a sibling parent mentioned, you can tag an element by inserting it into it's own heading and adding the :ignore: tag. I feel this functionality is overlooked, and it is in my opinion one of the most powerful features implemented in org, as it allows you to add "meta" groupings to your org document without any effect on the content. Without the :ignore: tag, there is a strict semantic relation between org-mode document headings, as physically indicated by the * at the beginning of a line, and the corresponding hierarchical level of the heading's content. With the :ignore: tag, however, you separate content from form. Headings with :ignore: work just as headings for your file.org document: you can search for headings, link to them, add IDs and properties and whatever else you can do with headings. But when you export your document, the heading no longer exists and thus has no impact on the hierarchical level of its content. Why is this interesting? Well, because if content is separated from form, we can build things where the same content assume multiple forms depending on whatever context we define. I used this in combination with other org-mode tags, "#+exclude_tags" and "#+include" directives to build my Ph.D. thesis with org mode and have my thesis chapters be exportable both as thesis chapters as well as standalone publications. Shameless plug: https://github.com/dangom/org-thesis https://github.com/dangom/org-thesis It should be straightforward to extend the idea to presentations and other formats as well.
- nanna 6y agoVery inspiring! Thank you.