How can I emphasize or verbatim quote a comma in org mode?

前端 未结 2 1395
不知归路
不知归路 2021-01-03 07:40

I tried to make the comma *,* bold, but no success. I tried with verbatim =,=, but no success as well.

2条回答
  •  感情败类
    2021-01-03 08:29

    You can achieve what you want by adding the following to your .emacs:

    (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\r\n\"'")
    (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)
    

    Explanation

    The manual says that org-emphasis-regexp-components can be used to

    fine tune what characters are allowed before and after the markup characters [...].

    It is a list containing five entries. The third entry lists characters that are not allowed to immediately follow or precede markup characters. By default, , is one of them so in order to successfully apply formatting to this character we have to remove it from the list of characters disallowed before or after the markup characters. This is what the call to setcar does. The purpose of the second line is to rebuild the regular expression for emphasis based on the modified version of org-emphasis-regexp-components.


    Sources

    • This answer to a related question
    • ~"~ doesn't register as verbatim on the org-mode mailing list
    • C-h v org-emphasis-regexp-components RET

提交回复
热议问题