Emacs 組織モードで脚注を構成する

Emacs 組織モードで脚注を構成する

投稿をフォローしました。emacs orgモードの脚注:[n]を無効にして[fn:]を維持する方法は?数ヶ月前でも私が言ったように、私はその答えが正解だとは思わなかった。

しかし、数値脚注([n]形式)を無視する方法を知りたいです。

組織モードのドキュメントには、「簡単な数値脚注タグです。footnote.el と互換性がありますが、「[1]」などの項目が簡単にコードの一部になる可能性があるため、お勧めできません」と記載されています。残念ながら、これを変更する方法は説明されていません。

ベストアンサー1

修正してこの問題を解決しました。org/lisp/org-footnote.el

  • 「org-footnote-re」定義の行をコメントアウトします。
(defconst org-footnote-re
;; Only [1]-like footnotes are closed in this regexp, as footnotes
;; from other types might contain square brackets (i.e. links) in
;; their definition.
;;
;; `org-re' is used for regexp compatibility with XEmacs.
(concat "\\[\\(?:"
    ;; Match inline footnotes.
    (org-re "fn:\\([-_[:word:]]+\\)?:\\|")
    ;; Match other footnotes.
    "\\(?:\\([0-9]+\\)\\]\\)\\|"   ; <-------- comment out this line
    (org-re "\\(fn:[-_[:word:]]+\\)")
    "\\)")
  "Regular expression for matching footnotes.")
  • ここで「org-re」関数のパラメータを変更してください。
(defconst org-footnote-definition-re
  (org-re "^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
  "Regular expression matching the definition of a footnote.")

文字列の変更

"^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]" 

到着

"^\\[\\(fn:[-_[:word:]]+\\)\\]"

おすすめ記事