組織モードからマニュアル:
あなたは太字、/ italic /、下線、「= verbatim =
'〜コード〜'、必要ならば '+ストライクスルー+'。コード内のテキスト
逐語的な文字列は、Orgモード固有の構文では処理されません。
そのまま生まれ変わりました。
Indeed ~> (cons 1 nil) \to (1)~
is exported as LaTeX \texttt{> (cons 1 nil) \textbackslash{}to (1)}
.
しかし、これはLaTeXの回避策を示唆しています。取り消すには、エクスポートフィルタを使用してください \
から \ textbackslash {}
に変換します。
(defun my-latex-filter-allow-latex-in-code (text backend info)
"Undo backslash escaping"
(when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string "textbackslash{}" "" text)))
(add-to-list 'org-export-filter-code-functions
#'my-latex-filter-allow-latex-in-code)
エクスポートフィルタはhtmlも扱えるように拡張することができます。 \ to
だけを扱う最初の草稿は次のとおりです。
(defun my-filter-allow-latex-in-code (text backend info)
"Allow LaTeX symbols in code"
(cond
((org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string "textbackslash{}" "" text))
((org-export-derived-backend-p backend 'html)
;; either extend this or find the html export function doing these conversions
(replace-regexp-in-string "\\\\to" "→" text))))
(add-to-list 'org-export-filter-code-functions
#'my-filter-allow-latex-in-code)