4 lines
1.7 KiB
Plaintext
4 lines
1.7 KiB
Plaintext
<p>This is a followup to yesterday’s <a href="https://irreal.org/blog/?p=10199">post on Nicolas P. Rougier’s 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><div class="sidefig" id="org08c8fb0"></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 couldn’t 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><div></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 it’s 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 you’re exporting to HTML, you can provide environment definitions in a CSS file. If you’re exporting to to PDF, you can define the definitions in a LaTeX package definition or directly in the Org file. It’s another example of how Org-mode allows you to generate arbitrarily complex output.</p> |