Skip to main content

이 버전의 GitHub Enterprise Server는 2023-09-25. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 성능 향상, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

수학 식 작성

Markdown을 사용하여 GitHub에 수학 식을 표시합니다.

About writing mathematical expressions

To enable clear communication of mathematical expressions, GitHub Enterprise Server supports LaTeX formatted math within Markdown. For more information, see LaTeX/Mathematics in Wikibooks.

GitHub's math rendering capability uses MathJax; an open source, JavaScript-based display engine. MathJax supports a wide range of LaTeX macros, and several useful accessibility extensions. For more information, see the MathJax documentation and the MathJax Accessibility Extensions Documentation.

Mathematical expressions rendering is available in GitHub Issues, GitHub Discussions, pull requests, and Markdown files.

Writing inline expressions

To include a math expression inline within your text, delimit the expression with dollar symbols $.

This sentence uses `$` delimiters to show math inline:  $\sqrt{3x-1}+(1+x)^2$

Screenshot of rendered Markdown showing how a mathematical expression displays on GitHub. The equation is the square root of 3 x minus 1 plus open paren 1 plus x close paren squared.

Writing expressions as blocks

To add a math expression as a block, start a new line and delimit the expression with two dollar symbols $$.

**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 GitHub. 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.

Writing dollar signs in line with and within mathematical expressions

To display a dollar sign as a character in the same line as a mathematical expression, you need to escape the non-delimiter $ to ensure the line renders correctly.

  • Within a math expression, add a \ symbol before the explicit $.

    This expression uses `\$` to display a dollar sign: $\sqrt{\$4}$

    Screenshot of rendered Markdown showing how a backslash before a dollar sign displays the sign as part of a mathematical expression.

  • Outside a math expression, but on the same line, use span tags around the explicit $.

    To split <span>$</span>100 in half, we calculate $100/2$

    Screenshot of rendered Markdown showing how span tags around a dollar sign display the sign as inline text rather than part of a mathematical equation.

Further reading