how to show underscores symbol in markdown?

MarkdownR Markdown

Markdown Problem Overview


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

Markdown Solutions


Solution 1 - Markdown

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][1]. However, php markdown parsers use the numeric character reference _ instead of the actual character in it's output.

[1]: http://johnmacfarlane.net/babelmark2/?text=my%5C_name%5C_%0A%0Amy_name_ "Babelmark 2"

Solution 2 - Markdown

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_

Solution 3 - Markdown

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`

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGoingMyWayView Question on Stackoverflow
Solution 1 - MarkdownSteve ClantonView Answer on Stackoverflow
Solution 2 - MarkdownRobert CaseyView Answer on Stackoverflow
Solution 3 - MarkdowntacanView Answer on Stackoverflow