Emphasis in bold and italics in emacs org mode

In emacs org-mode, we can use markup to set emphasis and monospacing .
eg.

* bold *

/italic/

How can we make a word bold or italic?
Neither * / ... / * nor /*...*/ seems to work.

+5
source share
2 answers

In fact, both of them work.

/*test*/ 

exports to HTML as

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

*/test/* works in a similar way. LaTeX / PDF export also works as you expect.

Org itself does not highlight either bold or italics, but the semantics are fine.

+7
source

Expanding to @Chris to respond to the semantics located there if you are interested in the visible effect of the font inside your notes, you have three approaches:

Select parts of the text.

enter image description here

Nesting works well if you do not need to start / end two tags at once.

Use multiple tags with escape characters

Closest you can get

fontification emacs

Code: *\ /\ _\ ~fontification can be nested~\_\/\*

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

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

So, you can have several allowances at once, but you need to choose between viewing the effect in emacs or its beautiful design when exporting.

Change the layout of emacs

Alternatively, you can change how markup looks in emacs without changing the export format, i.e. in order to make bold red you will need the following:

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

as described in this wonderful question and answer .

0
source

All Articles