简体   繁体   中英

Mark-up for bold and italic in emacs org-mode

In emacs org-mode, we can use mark-ups to set Emphasis and monospace .
eg

* bold*

/ italic /

How can we make a word both bold and italic?
It seems neither */.../* nor /*...*/ works.

In fact, both of these do work.

/*test*/

exports to HTML as

<i><b>test</b></i>

*/test/* works similarly. LaTeX / PDF export also works as you expect.

Org itself doesn't fontify both the bold and italic, but the semantics are fine.

Expanding on @Chris answer covering semantics being there, if you're interested in visible fontification effect inside your org notes , you have three approaches:

Highlight parts of your text

在此输入图像描述

Nesting works nicely as long as you don't need to start / end two tags at once.

Use multiple tags with escape symbols

The closest you can get is

fontification emacs

The code is: *\\ /\\ _\\ ~fontification can be nested~\\_\\/\\*

So you need \\​​ ​ (backslash and space) to escape following opening tags and \\ (backslash) to escape following closing tags.

The need for space is annoying, and in it looks like this when exported to html: fontification html

So yes, you can have multiple mark-ups at once, but you have to choose between seeing the effect in emacs or having it nicely formated on export.

Modify how markup looks in emacs

Alternatively you could change how mark-up looks in emacs without modyfing exporting format, ie to make bold look red you'd need this:

(add-to-list 'org-emphasis-alist
         '("*" (:foreground "red")
           ))

as covered in this great question and answer .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM