Skip to content

Why newline \\ for latex in markdown needs \\\\ when using $$ in Github? #121416

Closed Answered by IvanGael
sci-42ver asked this question in General
Discussion options

You must be logged in to vote

In LaTeX, the double backslash "" is used to create a newline within a document. However, when writing LaTeX within Markdown, such as in GitHub Markdown, you often need to escape the backslash character because Markdown uses it for its own formatting purposes.

So, when you want to create a newline in LaTeX within Markdown on GitHub, you need to use four backslashes "\". This is because Markdown requires you to escape the backslash with another backslash, and then LaTeX requires its own double backslash for a newline. Hence, the total becomes four backslashes: two for Markdown and two for LaTeX.

For example, in GitHub Markdown, you would write:

This would render in LaTeX as:

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sci-42ver
Comment options

Answer selected by sci-42ver
Comment options

You must be logged in to vote
2 replies
@MrMadaraUchiha
Comment options

@sci-42ver
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants