Search code examples
org-mode

Escaping org-mode footnote like text


I've got "[16]" in an org-mode file that is the text you would see in an ipython shell. How do I escape that text so that it does not generate an org-mode footnote? It's fine inside of an example block, but not in the general text. The first [16] is trouble and everything I've tried so far has not produced just straight normal "[16]" in the html output when I export the file.

#+BEGIN_SRC python
def setfrequency():
    print 'Setting frequency'
    # Write code here to set the frequency

setfrequency()
#+END_SRC

# This next line is the footnote problem
Run it again and you should see this, but the command number [16]
will be different for you:

#+BEGIN_EXAMPLE 
In [16]: run sonar  # This does not export as a footnote.
Setting frequency
#+END_EXAMPLE

Thanks!


Solution

  • You can escape syntax using =[1]= (code) or ~[1]~ (verbatim) blocks. See the Org-Manual section on Emphasis and Monospace.

    * This will export the footnote style brackets verbatim
      [1] by itself will fail
      =[1]= and ~[1]~ will export as is.
    

    The relevant portion of HTML export for this is

    <p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
    </sup> by itself will fail
      <code>[1]</code> and <code>[1]</code> will export as is.
    </p>
    
    <p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
    </sup> DEFINITION NOT FOUND: 1