From d8df7dff84773c4fc9c03a00ec5a9dea36ebd7c3 Mon Sep 17 00:00:00 2001 From: machakann Date: Wed, 7 Nov 2018 18:54:41 +0800 Subject: [PATCH] Add missing backslashes in LaTeX syntax in the document of binomial function (#29933) --- base/intfuncs.jl | 6 +++--- doc/src/manual/documentation.md | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 615abf7c38e7c..f77f9a7d39f23 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -828,18 +828,18 @@ end """ binomial(n::Integer, k::Integer) -The _binomial coefficient_ ``\binom{n}{k}``, being the coefficient of the ``k``th term in +The _binomial coefficient_ ``\\binom{n}{k}``, being the coefficient of the ``k``th term in the polynomial expansion of ``(1+x)^n``. If ``n`` is non-negative, then it is the number of ways to choose `k` out of `n` items: ```math -\binom{n}{k} = \frac{n!}{k! (n-k)!} +\\binom{n}{k} = \\frac{n!}{k! (n-k)!} ``` where ``n!`` is the [`factorial`](@ref) function. If ``n`` is negative, then it is defined in terms of the identity ```math -\binom{n}{k} = (-1)^k \binom{k-n-1}{k} +\\binom{n}{k} = (-1)^k \\binom{k-n-1}{k} ``` # Examples diff --git a/doc/src/manual/documentation.md b/doc/src/manual/documentation.md index 41ac5e44f4951..1bb2641ea2854 100644 --- a/doc/src/manual/documentation.md +++ b/doc/src/manual/documentation.md @@ -606,6 +606,11 @@ A paragraph containing some ``\LaTeX`` markup. backticks use an even number greater than two. Note that if a single literal backtick needs to be included within ``\LaTeX`` markup then two enclosing backticks is sufficient. +!!! note + The `\` character should be escaped appropriately if the text is embedded in a Julia source code, + for example, ``` "``\\LaTeX`` syntax in a docstring." ```, since it is interpreted as a string + literal. + #### Links Links to either external or internal addresses can be written using the following syntax, where