emacs/var/elfeed/db/data/fa/fa7f00b5e38a3c35655f89a08702f118377d3731
2022-01-03 12:49:32 -06:00

4 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>This is a followup to yesterdays <a href="https://irreal.org/blog/?p=10199">post on Nicolas P. Rougiers notebook-mode</a>. When I was going through the code trying to understand how everything worked I noticed that the Org source code had a <code>#+begin_sidefig</code> / <code>#+end_sidefig</code> environment that mapped to a <code>&lt;div class="sidefig" id="org08c8fb0"&gt;</code> element in the HTML. The definition of that division was provided by the CSS of course, but I wondered where the mapping came from. My first thought was that it must have been implemented in a package that the code required but I couldnt figure out what package it was or how it was being included.</p>
<p>It turns out that you can use <code>begin_xxx</code> / <code>end_xxx</code> for any value of <code>xxx</code> and Org will do the right thing. If you export the Org file to HTML it will be mapped into a <code>&lt;div&gt;</code> that you can define in a CSS file (or in the Org file, for that matter). If you export it to PDF (via LaTeX) it will be mapped into a <code>\begin{xxx}</code> / <code>\end{xxx}</code> environment that, once again, you can define however you like.</p>
<p>Many of you are probably already aware of this but its a revelation to me. It means that you can produce arbitrarily beautiful output directly from Org-mode. Doubtless something similar happens if you export to <code>docx</code> but Irreal has no interest such matters.</p>
<p>If youre exporting to HTML, you can provide environment definitions in a CSS file. If youre exporting to to PDF, you can define the definitions in a LaTeX package definition or directly in the Org file. Its another example of how Org-mode allows you to generate arbitrarily complex output.</p>