Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org-mode wrongly interprets square brackets as footnote

Tags:

emacs

org-mode

I want to insert the following plain text in org-mode:

I'll tell you, a[0] contains the number, ...

But org-mode wrongly interprets [0] as a footnote.

It's not code, so I can't use a SRC block. How can I avoid this behavior?

like image 800
Cheukyin Avatar asked Jul 18 '26 11:07

Cheukyin


2 Answers

Unfortunatly, you cannot customize what is considered a footnote.

But you can override the behaviour. If you never use "plain" footnotes like [1], you can adjust two variables:

(setq org-footnote-re
      (concat "\\[\\(?:"
          ;; Match inline footnotes.
          (org-re "fn:\\([-_[:word:]]+\\)?:\\|")
          ;; Match other footnotes.
          ;; "\\(?:\\([0-9]+\\)\\]\\)\\|"
          (org-re "\\(fn:[-_[:word:]]+\\)")
          "\\)"))

(setq org-footnote-definition-re
      (org-re "^\\[\\(fn:[-_[:word:]]+\\)\\]"))

This should do the trick.

If you want to use footnotes in your org-file, use [fn:1] style or other styles at http://orgmode.org/manual/Footnotes.html instead of just [1].

like image 175
olaf b Avatar answered Jul 21 '26 08:07

olaf b


There are two ways:

  1. use verbatim markup: =a[0]=
  2. use escape character: a\[0\]
like image 43
wilbeibi Avatar answered Jul 21 '26 08:07

wilbeibi