Browse Source

Use $$...$$ instead of equation environment (#72)

pull/76/head
David Widmann 6 years ago committed by Fredrik Ekre
parent
commit
84c11dd041
  1. 4
      docs/src/documenter.md
  2. 2
      src/Literate.jl
  3. 4
      test/runtests.jl

4
docs/src/documenter.md

@ -41,9 +41,9 @@ if we set `documenter = true`:
```` ````
is replaced with notebook compatible is replaced with notebook compatible
``` ```
\begin{equation} $$
\int f dx \int f dx
\end{equation} $$
``` ```
### [`Literate.script`](@ref): ### [`Literate.script`](@ref):

2
src/Literate.jl

@ -157,7 +157,7 @@ function replace_default(content, sym;
push!(repls, r"^#!nb.*\n?"m => "") # remove #!nb lines push!(repls, r"^#!nb.*\n?"m => "") # remove #!nb lines
push!(repls, r"^#jl.*\n?"m => "") # remove leading #jl lines push!(repls, r"^#jl.*\n?"m => "") # remove leading #jl lines
push!(repls, r"^#!jl "m => "") # remove leading #!jl push!(repls, r"^#!jl "m => "") # remove leading #!jl
push!(repls, r"```math(.*?)```"s => s"\\begin{equation}\1\\end{equation}") push!(repls, r"```math(.*?)```"s => s"$$\1$$")
else # sym === :jl else # sym === :jl
push!(repls, r"^#md.*\n?"m => "") # remove #md lines push!(repls, r"^#md.*\n?"m => "") # remove #md lines
push!(repls, r"^#!md "m => "") # remove leading #!md push!(repls, r"^#!md "m => "") # remove leading #!md

4
test/runtests.jl

@ -611,9 +611,9 @@ end
""" """
"source": [ "source": [
"Some math:\\n", "Some math:\\n",
"\\\\begin{equation}\\n", "\$\$\\n",
"\\\\int f(x) dx\\n", "\\\\int f(x) dx\\n",
"\\\\end{equation}" "\$\$"
] ]
""", """,

Loading…
Cancel
Save