Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show underscores symbol in markdown?

in markdown, my_stock_index is mystockindex. But I want it to show my_stock_index. How can do that?

like image 968
GoingMyWay Avatar asked Mar 06 '16 14:03

GoingMyWay


3 Answers

You just escape it with a backslash: my\_stock\_ticker is what you type to get my_stock_ticker

The syntax seems to work for all markdown parsers. However, php markdown parsers use the numeric character reference _ instead of the actual character in it's output.

like image 141
Steve Clanton Avatar answered Nov 13 '22 02:11

Steve Clanton


The single backslash escape works fine in Jupyter unless you are in an italicized block, in which case, you want to close the italicized block, write the escaped underscore, then start the italicized block again.

_the cookie_\__cutter in italics_
like image 44
Robert Casey Avatar answered Nov 13 '22 02:11

Robert Casey


There is also the option to use backticks. This is actually used to refer to mark the text as inline code, but where else would you use underscores right? Besides it is much easier than managing the backslash stuff :)

`my_stock_index`
like image 26
tacan Avatar answered Nov 13 '22 03:11

tacan