diff --git a/assets/images/help/writing/math-expression-as-a-block-rendering.png b/assets/images/help/writing/math-expression-as-a-block-rendering.png index e799c192c45f..e9cb076812a1 100644 Binary files a/assets/images/help/writing/math-expression-as-a-block-rendering.png and b/assets/images/help/writing/math-expression-as-a-block-rendering.png differ diff --git a/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md b/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md index ecb2ed638655..ab9e23aa22e7 100644 --- a/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md +++ b/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md @@ -199,6 +199,44 @@ Some text I want to provide a direct link to, but which doesn't have its own hea > [!TIP] > Custom anchors are not considered by the automatic naming and numbering behavior of automatic heading links. +## Line breaks + +If you're writing in issues, pull requests, or discussions in a repository, {% data variables.product.github %} will render a line break automatically: + +```markdown +This example +Will span two lines +``` + +However, if you are writing in an .md file, the example above would render on one line without a line break. To create a line break in an .md file, you will need to include one of the following: + +* Include two spaces at the end of the first line. +
+  This example  
+  Will span two lines
+  
+* Include a backslash at the end of the first line. + + ```markdown + This example\ + Will span two lines + ``` + +* Include an HTML single line break tag at the end of the first line. + + ```markdown + This example
+ Will span two lines + ``` + +If you leave a blank line between two lines, both .md files and Markdown in issues, pull requests, and discussions will render the two lines separated by the blank line: + +```markdown +This example + +Will have a blank line separating both lines +``` + ## Images You can display an image by adding ! and wrapping the alt text in `[ ]`. Alt text is a short text equivalent of the information in the image. Then, wrap the link for the image in parentheses `()`. diff --git a/content/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions.md b/content/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions.md index b7115431f9f8..4e6e2251f3b6 100644 --- a/content/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions.md +++ b/content/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions.md @@ -42,12 +42,14 @@ This sentence uses $\` and \`$ delimiters to show math inline: $`\sqrt{3x-1}+(1+ To add a math expression as a block, start a new line and delimit the expression with two dollar symbols `$$`. +>[!TIP] If you're writing in an .md file, you will need to use specific formatting to create a line break, such as ending the line with a backslash as shown in the example below. For more information on line breaks in Markdown, see "[AUTOTITLE](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#line-breaks)." + ```text -**The Cauchy-Schwarz Inequality** +**The Cauchy-Schwarz Inequality**\ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$ ``` -![Screenshot of rendered Markdown showing how a complex equation displays on {% data variables.product.prodname_dotcom %}. The bolded text reads "The Cauchy-Schwarz Inequality". Below the text, there is an equation showing open paren the sum from k equals 1 to n of a sub k b sub k close paren squared is less than or equal to open paren the sum from k equals 1 to n of a sub k squared close paren times open paren the sum from k equals 1 to n of b sub k squared close paren.](/assets/images/help/writing/math-expression-as-a-block-rendering.png) +![Screenshot of rendered Markdown showing how a complex equation displays on {% data variables.product.prodname_dotcom %}. The bolded text reads "The Cauchy-Schwarz Inequality". Below the text, there is an equation showing the The Cauchy-Schwarz Inequality formula.](/assets/images/help/writing/math-expression-as-a-block-rendering.png) {% ifversion math-fenced-blocks %}