From 4b276619254f74ce839029f9d7a93f923cb45b4e Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 5 Feb 2025 08:15:50 +0000 Subject: [PATCH] build based on bb5d44e --- dev/.documenter-siteinfo.json | 2 +- dev/arguments/index.html | 2 +- dev/functions/latexalign/index.html | 2 +- dev/functions/latexarray/index.html | 2 +- dev/functions/latexify/index.html | 2 +- dev/functions/latexoperation/index.html | 2 +- dev/functions/latexraw/index.html | 2 +- dev/index.html | 2 +- dev/objects.inv | Bin 1091 -> 1091 bytes dev/tutorials/Catalyst/index.html | 2 +- dev/tutorials/inner_workings/index.html | 2 +- dev/tutorials/latexalign/index.html | 2 +- dev/tutorials/latexarray/index.html | 2 +- dev/tutorials/latexify/index.html | 2 +- dev/tutorials/latexinline/index.html | 2 +- dev/tutorials/latextabular/index.html | 2 +- dev/tutorials/notebooks/index.html | 2 +- .../parameterizedfunctions/index.html | 2 +- dev/tutorials/recipes/index.html | 2 +- dev/tutorials/rendering_latex/index.html | 2 +- 20 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 8d44808d..3c7adb97 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-04T21:16:21","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-05T08:15:43","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/arguments/index.html b/dev/arguments/index.html index a8c61473..46afa17f 100644 --- a/dev/arguments/index.html +++ b/dev/arguments/index.html @@ -1,2 +1,2 @@ -List of possible arguments · Latexify.jl

List of possible arguments

Align

KeywordValuesDefaultApplicable typesDescription
:bracketBoolfalseParameterizedFunction, ReactionNetworkSurround variables with square brackets.
:cleanBoolfalseReactionNetworkClean out 1* terms. Only useful for Catalyst (then named DiffEqBiological) versions 3.4 or below.
:convert_unicodeBooltrueAnyConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAnyAdd an extra \\ to the end of the line.
:expandBooltrueReactionNetworkExpand functions such as hill(x, v, k, n) to their mathematical expression.
:fmtformat string""AnyFormat number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"AnyThe symbol to use to represent the imaginary unit
:indexSymb:bracketAnyRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"AnySpecify the symbol to use for the multiplication operator ("" for juxtaposition).
:noiseBoolfalseReactionNetworkDisplay the noise function instead of the deterministic one.
:rowsIterable or symol:allAnyWhich rows to include in the output.
:safescriptsBoolfalseAnyPut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "AnySpecify how to separate the left hand side and the right.
:snakecaseBoolfalseAnyTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseAnyStar the environment to prevent equation numbering.
:symbolicBoolfalseReactionNetworkUse symbolic calculations to clean up the expression.

Equation

KeywordValuesDefaultDescription
:starredBoolfalseStar the environment to prevent equation numbering.

Array

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:arraystyleSymbol, String, NTuple{3, String}:squareHow to style (brackets around) arrays. Symbols correspond to predefined styles: :square, :round, :curly, :bmatrix, :pmatrix. A string will be used as an environment, with no further brackets (e.g. "vmatrix"). Tuples should be (<starting bracket>, <ending bracket>, <environment>), for instance :square corresponds to ("\n\\left[", "\\right]\n", "array").
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:transposeBooltrueFlip rows for columns.

Tabular

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:booktabsBoolfalseAdd top, mid and bottom booktabs rule
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:transposeBooltrueFlip rows for columns.

Markdown Table

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:escape_underscoresBoolfalsePrevent underscores from being interpreted as formatting.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:transposeBooltrueFlip rows for columns.

Inline and raw

KeywordValuesDefaultDescription
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).

Chemical arrow notation

Available with ReactionNetworks from Catalyst.

KeywordValuesDefaultDescription
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:mathjaxBooltrueAdd \require{mhchem} to tell MathJax to load the required module.
:starredBoolfalseStar the environment to prevent equation numbering.
+List of possible arguments · Latexify.jl

List of possible arguments

Align

KeywordValuesDefaultApplicable typesDescription
:bracketBoolfalseParameterizedFunction, ReactionNetworkSurround variables with square brackets.
:cleanBoolfalseReactionNetworkClean out 1* terms. Only useful for Catalyst (then named DiffEqBiological) versions 3.4 or below.
:convert_unicodeBooltrueAnyConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAnyAdd an extra \\ to the end of the line.
:expandBooltrueReactionNetworkExpand functions such as hill(x, v, k, n) to their mathematical expression.
:fmtformat string""AnyFormat number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"AnyThe symbol to use to represent the imaginary unit
:indexSymb:bracketAnyRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"AnySpecify the symbol to use for the multiplication operator ("" for juxtaposition).
:noiseBoolfalseReactionNetworkDisplay the noise function instead of the deterministic one.
:rowsIterable or symol:allAnyWhich rows to include in the output.
:safescriptsBoolfalseAnyPut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "AnySpecify how to separate the left hand side and the right.
:snakecaseBoolfalseAnyTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseAnyStar the environment to prevent equation numbering.
:symbolicBoolfalseReactionNetworkUse symbolic calculations to clean up the expression.

Equation

KeywordValuesDefaultDescription
:starredBoolfalseStar the environment to prevent equation numbering.

Array

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:arraystyleSymbol, String, NTuple{3, String}:squareHow to style (brackets around) arrays. Symbols correspond to predefined styles: :square, :round, :curly, :bmatrix, :pmatrix. A string will be used as an environment, with no further brackets (e.g. "vmatrix"). Tuples should be (<starting bracket>, <ending bracket>, <environment>), for instance :square corresponds to ("\n\\left[", "\\right]\n", "array").
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:transposeBooltrueFlip rows for columns.

Tabular

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:booktabsBoolfalseAdd top, mid and bottom booktabs rule
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:transposeBooltrueFlip rows for columns.

Markdown Table

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:escape_underscoresBoolfalsePrevent underscores from being interpreted as formatting.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:transposeBooltrueFlip rows for columns.

Inline and raw

KeywordValuesDefaultDescription
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).

Chemical arrow notation

Available with ReactionNetworks from Catalyst.

KeywordValuesDefaultDescription
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:mathjaxBooltrueAdd \require{mhchem} to tell MathJax to load the required module.
:starredBoolfalseStar the environment to prevent equation numbering.
diff --git a/dev/functions/latexalign/index.html b/dev/functions/latexalign/index.html index 91c24748..904d5bae 100644 --- a/dev/functions/latexalign/index.html +++ b/dev/functions/latexalign/index.html @@ -14,4 +14,4 @@ julia> latexalign(ode)
\begin{align}
 \frac{dm}{dt} &= r_{m} \cdot \left( i - m \right) \\\\
 \frac{dy}{dt} &= r_{y} \cdot \left( \frac{p_{y} \cdot i}{m} - y \right) \\\\
-\end{align}
source +\end{align}source diff --git a/dev/functions/latexarray/index.html b/dev/functions/latexarray/index.html index 5c4239d7..41bb0184 100644 --- a/dev/functions/latexarray/index.html +++ b/dev/functions/latexarray/index.html @@ -8,4 +8,4 @@ \end{array} \right] \end{equation} -"\]

source +"\]

source diff --git a/dev/functions/latexify/index.html b/dev/functions/latexify/index.html index 5e4a9283..9c8aa717 100644 --- a/dev/functions/latexify/index.html +++ b/dev/functions/latexify/index.html @@ -14,4 +14,4 @@ \end{array} \right] \end{equation} -"source +"source diff --git a/dev/functions/latexoperation/index.html b/dev/functions/latexoperation/index.html index f7606cad..92920347 100644 --- a/dev/functions/latexoperation/index.html +++ b/dev/functions/latexoperation/index.html @@ -1,2 +1,2 @@ -latexoperation · Latexify.jl

latexoperation

This function is not exported.

Latexify.latexoperationFunction
latexoperation(ex::Expr, prevOp::AbstractArray)

Translate a simple operation given by ex to LaTeX maths syntax. This uses the information about the previous operations to decide if a parenthesis is needed.

source
+latexoperation · Latexify.jl

latexoperation

This function is not exported.

Latexify.latexoperationFunction
latexoperation(ex::Expr, prevOp::AbstractArray)

Translate a simple operation given by ex to LaTeX maths syntax. This uses the information about the previous operations to decide if a parenthesis is needed.

source
diff --git a/dev/functions/latexraw/index.html b/dev/functions/latexraw/index.html index 56ac2554..6a2e3187 100644 --- a/dev/functions/latexraw/index.html +++ b/dev/functions/latexraw/index.html @@ -27,4 +27,4 @@ # output -"2 \\cdot x + x \\cdot y^{2}"source +"2 \\cdot x + x \\cdot y^{2}"source diff --git a/dev/index.html b/dev/index.html index f1230301..cd5a3626 100644 --- a/dev/index.html +++ b/dev/index.html @@ -58,4 +58,4 @@

External rendering

While LaTeXStrings already render nicely in many IDEs or in Jupyter, they do not render in the REPL. Therefore, we provide a function render(str) which generates a standalone PDF using LuaLaTeX and opens that file in your default PDF viewer.

I have found the following syntax pretty useful:

latexify(:(x/y)) |> render

Alternatively, render(str, mime) can also be used to generate and display DVI, PNG and SVG files, which might be useful for other purposes:

latexify(:(x/y)) |> s -> render(s, MIME("image/png"))

PNG output relies on ghostscript or alternatively on dvipng: if render is called with the keyword convert = :gs, ghostcript will be used to convert the pdf output to png format.

SVG output relies on dvisvgm or alternatively on pdf2svg.

If your code requires specific packages or document classes to render correctly, you can supply those as keyword arguments:

L"\qty{1.25}{nm}" |> render(s, MIME("image/png"); documentclass="article", packages=("microtype", ("siunitx", exponent-product="\cdot")))

The arguments to these are either strings, or tuples of strings where the first one is the name of the package or class, and any further are optional arguments.

One can use Latexify together with ImageInTerminal to render equations in a sixel compatible terminal, where the size of the sixel encoded image can be controlled using dpi:

using ImageInTerminal, Latexify
 
-latexify(:(iħ * (∂Ψ(𝐫, t) / ∂t) = -ħ^2 / 2m * ΔΨ(𝐫, t) + V * Ψ(𝐫, t))) |> s -> render(s, dpi=200)

Legacy support

Latexify.jl has stopped supporting Julia versions older than 0.7. This does not mean that you cannot use Latexify with earlier versions, just that these will not get new features. Latexify.jl's release v0.4.1 was the last which supported Julia 0.6. Choose that release in the dropdown menu if you want to see that documentation.

+latexify(:(iħ * (∂Ψ(𝐫, t) / ∂t) = -ħ^2 / 2m * ΔΨ(𝐫, t) + V * Ψ(𝐫, t))) |> s -> render(s, dpi=200)

Legacy support

Latexify.jl has stopped supporting Julia versions older than 0.7. This does not mean that you cannot use Latexify with earlier versions, just that these will not get new features. Latexify.jl's release v0.4.1 was the last which supported Julia 0.6. Choose that release in the dropdown menu if you want to see that documentation.

diff --git a/dev/objects.inv b/dev/objects.inv index acb5a09ed87faf7330ff653fbd2e82a13f14e2c1..cf368248056fef78ebc96fc5e660304072cfa784 100644 GIT binary patch delta 12 TcmX@iahPL*3!~Xa*MH0a9&iMi delta 12 TcmX@iahPL*3!~{q*MH0a9%}@c diff --git a/dev/tutorials/Catalyst/index.html b/dev/tutorials/Catalyst/index.html index 8d2b83d7..f7dd3a58 100644 --- a/dev/tutorials/Catalyst/index.html +++ b/dev/tutorials/Catalyst/index.html @@ -29,4 +29,4 @@ \ce{ x &->[d_{x}] \varnothing}\\ \ce{ y &->[d_{y}] \varnothing}\\ \ce{ x &<=>[{r_{b}}][{r_{u}}] y}\\ -\end{align*}\]

Available options

Align

KeywordValuesDefaultDescription
:bracketBoolfalseSurround variables with square brackets.
:cleanBoolfalseClean out 1* terms. Only useful for Catalyst (then named DiffEqBiological) versions 3.4 or below.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:noiseBoolfalseDisplay the noise function instead of the deterministic one.
:rowsIterable or symol:allWhich rows to include in the output.
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "Specify how to separate the left hand side and the right.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:symbolicBoolfalseUse symbolic calculations to clean up the expression.

Arrow notation

KeywordValuesDefaultDescription
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:mathjaxBooltrueAdd \require{mhchem} to tell MathJax to load the required module.
:starredBoolfalseStar the environment to prevent equation numbering.
+\end{align*}\]

Available options

Align

KeywordValuesDefaultDescription
:bracketBoolfalseSurround variables with square brackets.
:cleanBoolfalseClean out 1* terms. Only useful for Catalyst (then named DiffEqBiological) versions 3.4 or below.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:noiseBoolfalseDisplay the noise function instead of the deterministic one.
:rowsIterable or symol:allWhich rows to include in the output.
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "Specify how to separate the left hand side and the right.
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:symbolicBoolfalseUse symbolic calculations to clean up the expression.

Arrow notation

KeywordValuesDefaultDescription
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:expandBooltrueExpand functions such as hill(x, v, k, n) to their mathematical expression.
:mathjaxBooltrueAdd \require{mhchem} to tell MathJax to load the required module.
:starredBoolfalseStar the environment to prevent equation numbering.
diff --git a/dev/tutorials/inner_workings/index.html b/dev/tutorials/inner_workings/index.html index 10016146..2e6a0335 100644 --- a/dev/tutorials/inner_workings/index.html +++ b/dev/tutorials/inner_workings/index.html @@ -32,4 +32,4 @@ julia> println.(latexraw(arr)) x - \frac{y}{k_{10} + z} -\frac{x \cdot y \cdot z}{3} +\frac{x \cdot y \cdot z}{3} diff --git a/dev/tutorials/latexalign/index.html b/dev/tutorials/latexalign/index.html index 7baf3fd2..1b8a2807 100644 --- a/dev/tutorials/latexalign/index.html +++ b/dev/tutorials/latexalign/index.html @@ -15,4 +15,4 @@ latexalign(ode)

\begin{align} \frac{dx}{dt} &= \frac{y}{k{y} + y} - x \\ \frac{dy}{dt} &= \frac{x^{n{x}}}{k{x}^{n{x}} + x^{n_{x}}} - y \\ -\end{align}

+\end{align}

diff --git a/dev/tutorials/latexarray/index.html b/dev/tutorials/latexarray/index.html index 07f4048e..6ff07088 100644 --- a/dev/tutorials/latexarray/index.html +++ b/dev/tutorials/latexarray/index.html @@ -19,4 +19,4 @@ \frac{3}{4}\\ \frac{x}{k{1} + x}\\ e^{- k{b} \cdot t}\\ -\end{array} \right] \end{equation}

+\end{array} \right] \end{equation}

diff --git a/dev/tutorials/latexify/index.html b/dev/tutorials/latexify/index.html index e0044a07..0d74c00a 100644 --- a/dev/tutorials/latexify/index.html +++ b/dev/tutorials/latexify/index.html @@ -14,4 +14,4 @@ 0.7 & 0.17 & 0.7 & 0.82\\ \end{array} \right] \end{equation}

You can transpose the output using the keyword argument transpose=true.

If you give two vectors as an argument, they will be displayed as the left-hand-side and right-hand-side of an align environment:

latexify(["x/y", :z], Any[2.3, 1//2])

\begin{align} \frac{x}{y} &= 2.3 \\ z &= \frac{1}{2} \\ -\end{align}

If you input a ParameterizedFunction or a ReactionNetwork from DifferentialEquations.jl you will also get an align environment. For more on this, have a look on their respective sections.

+\end{align}

If you input a ParameterizedFunction or a ReactionNetwork from DifferentialEquations.jl you will also get an align environment. For more on this, have a look on their respective sections.

diff --git a/dev/tutorials/latexinline/index.html b/dev/tutorials/latexinline/index.html index 26affca0..42ebc3b8 100644 --- a/dev/tutorials/latexinline/index.html +++ b/dev/tutorials/latexinline/index.html @@ -1,4 +1,4 @@ latexinline · Latexify.jl

latexinline

takes a Julia object x and returns a $\LaTeX$ formatted string. It also surrounds the output in a simple $$ environment. This works for x of many types, including expressions, which returns $\LaTeX$ code for an equation.

julia> ex = :(x-y/z)
 julia> latexinline(ex)
-L"$x - \frac{y}{z}$"

In Jupyter or Hydrogen this automatically renders as:

\[x - \frac{y}{z}\]

Among the supported types are:

  • Expressions,
  • Strings,
  • Numbers (including rational and complex),
  • Symbols,
  • Symbolic expressions from SymEngine.jl.
  • ParameterizedFunctions.

It can also take arrays, which it recurses and latexifies the elements, returning an array of latex strings.

+L"$x - \frac{y}{z}$"

In Jupyter or Hydrogen this automatically renders as:

\[x - \frac{y}{z}\]

Among the supported types are:

It can also take arrays, which it recurses and latexifies the elements, returning an array of latex strings.

diff --git a/dev/tutorials/latextabular/index.html b/dev/tutorials/latextabular/index.html index 068713cd..73f4e13b 100644 --- a/dev/tutorials/latextabular/index.html +++ b/dev/tutorials/latextabular/index.html @@ -8,4 +8,4 @@ \end{tabular}

Unfortunately, this does not render nicely in Markdown. But you get the point.

latextabular takes two keywords, one for changing the adjustment of the columns (centered by default), and one for transposing the whole thing.

latextabular(arr; adjustment=:l, transpose=true) |> println
\begin{tabular}{ll}
 $\frac{x}{y}$ & $1.0$\\
 $y^{n}$ & $\alpha\left( x \right)$\\
-\end{tabular}
+\end{tabular} diff --git a/dev/tutorials/notebooks/index.html b/dev/tutorials/notebooks/index.html index c4fdb397..f0462cb4 100644 --- a/dev/tutorials/notebooks/index.html +++ b/dev/tutorials/notebooks/index.html @@ -16,4 +16,4 @@ combine manual dollar signs with `env=:raw`: \$ \hat{v} = $(latexify(v, env=:raw))\;\mathrm{m}/\mathrm{s} \$ -""")

Results

With the previously calculated $x = 125$, we can use $x = v \cdot t$ to calculate $v = \frac{x}{10}$, giving a final velocity of $12.5$.

If we want more manual control, we can combine manual dollar signs with env=:raw: $ \hat{v} = 12.5\;\mathrm{m}/\mathrm{s} $

+""")

Results

With the previously calculated $x = 125$, we can use $x = v \cdot t$ to calculate $v = \frac{x}{10}$, giving a final velocity of $12.5$.

If we want more manual control, we can combine manual dollar signs with env=:raw: $ \hat{v} = 12.5\;\mathrm{m}/\mathrm{s} $

diff --git a/dev/tutorials/parameterizedfunctions/index.html b/dev/tutorials/parameterizedfunctions/index.html index 60c3eb7c..bc8357c4 100644 --- a/dev/tutorials/parameterizedfunctions/index.html +++ b/dev/tutorials/parameterizedfunctions/index.html @@ -42,4 +42,4 @@ \frac{x^{-1 + n_{x}} \cdot n_{x}}{k_{x}^{n_{x}} + x^{n_{x}}} - \frac{x^{-1 + 2 \cdot n_{x}} \cdot n_{x}}{\left( k_{x}^{n_{x}} + x^{n_{x}} \right)^{2}} & -1 \\ \end{array} \right] -\end{equation}\]

Available options

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:arraystyleSymbol, String, NTuple{3, String}:squareHow to style (brackets around) arrays. Symbols correspond to predefined styles: :square, :round, :curly, :bmatrix, :pmatrix. A string will be used as an environment, with no further brackets (e.g. "vmatrix"). Tuples should be (<starting bracket>, <ending bracket>, <environment>), for instance :square corresponds to ("\n\\left[", "\\right]\n", "array").
:booktabsBoolfalseAdd top, mid and bottom booktabs rule
:bracketBoolfalseSurround variables with square brackets.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:escape_underscoresBoolfalsePrevent underscores from being interpreted as formatting.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:rowsIterable or symol:allWhich rows to include in the output.
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "Specify how to separate the left hand side and the right.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:transposeBooltrueFlip rows for columns.
+\end{equation}\]

Available options

KeywordValuesDefaultDescription
:adjustment:c for centered, :l for left, :r for right, or a vector with one such symbol per column.:cSet the adjustment of text within the table cells.
:arraystyleSymbol, String, NTuple{3, String}:squareHow to style (brackets around) arrays. Symbols correspond to predefined styles: :square, :round, :curly, :bmatrix, :pmatrix. A string will be used as an environment, with no further brackets (e.g. "vmatrix"). Tuples should be (<starting bracket>, <ending bracket>, <environment>), for instance :square corresponds to ("\n\\left[", "\\right]\n", "array").
:booktabsBoolfalseAdd top, mid and bottom booktabs rule
:bracketBoolfalseSurround variables with square brackets.
:convert_unicodeBooltrueConvert unicode characters to latex commands, for example α to \alpha
:double_linebreakBoolfalseAdd an extra \\ to the end of the line.
:escape_underscoresBoolfalsePrevent underscores from being interpreted as formatting.
:fmtformat string""Format number output in accordance with Printf. Example: "%.2e"
:headArray[]Add a header to the table. It will error if it is not of the right length (unless empty).
:imaginary_unitString"\\mathit{i}"The symbol to use to represent the imaginary unit
:indexSymb:bracketRepresent index specification with :bracket (u[1]) or :subscript (u_1).
:latexBooltrueToggle latexification of the table elements.
:mult_symbolString"\\cdot"Specify the symbol to use for the multiplication operator ("" for juxtaposition).
:rowsIterable or symol:allWhich rows to include in the output.
:safescriptsBoolfalsePut scripts inside brackets (a{_b}), sometimes making them uglier, but making alternating scripts possible.
:separatorString" &= "Specify how to separate the left hand side and the right.
:sideArray[]Add a leftmost column to the table. It will error if it is not of the right length (unless empty).
:snakecaseBoolfalseTreat underscores as literal underscores (if not, treat first underscore as subscript).
:starredBoolfalseStar the environment to prevent equation numbering.
:transposeBooltrueFlip rows for columns.
diff --git a/dev/tutorials/recipes/index.html b/dev/tutorials/recipes/index.html index 37c43100..0873b9b6 100644 --- a/dev/tutorials/recipes/index.html +++ b/dev/tutorials/recipes/index.html @@ -42,4 +42,4 @@ end

so that the result of latexify(MyDifference(2,3)) is $3 - 2$. But right now, latexify does not know that this represents an operation, so for instance @latexify $(MyDifference(2,3))*4 gives $3 - 2 \cdot 4$, which is incorrect. The way around this is to edit the recipe:

@latexrecipe function f(m::MyDifference)
     operation := :-
     return :($(m.y) - $(m.x))
-end

Now latexify knows that MyDifference represents a subtraction, and parenthesis rules kick in: @latexify $(MyDifference(2,3))*4 gives $\left( 3 - 2 \right) \cdot 4$.

+end

Now latexify knows that MyDifference represents a subtraction, and parenthesis rules kick in: @latexify $(MyDifference(2,3))*4 gives $\left( 3 - 2 \right) \cdot 4$.

diff --git a/dev/tutorials/rendering_latex/index.html b/dev/tutorials/rendering_latex/index.html index 46838bce..7b7bac84 100644 --- a/dev/tutorials/rendering_latex/index.html +++ b/dev/tutorials/rendering_latex/index.html @@ -1,2 +1,2 @@ -A note on rendering LaTeX · Latexify.jl

A note on rendering $\LaTeX$

Using the print function on a latexified object prints text which is suitable for copy-pasting into a $\LaTeX$ document.

However, it is often also useful to be able to render the equation inside the document that one is using to develop code. The Julia REPL does not support this, but IJulia does. So, inside a Jupyter or Pluto notebook (or if you are running Atom with Hydrogen), you can render $\LaTeX$ using

display("text/latex", x)

where x is a latex-formatted string.

This requires x to specify a $\LaTeX$ environment. latexalign and latexequation already does this, but if you want to render the result of latexify you must supply an environment (for example "\$ $x \$").

+A note on rendering LaTeX · Latexify.jl

A note on rendering $\LaTeX$

Using the print function on a latexified object prints text which is suitable for copy-pasting into a $\LaTeX$ document.

However, it is often also useful to be able to render the equation inside the document that one is using to develop code. The Julia REPL does not support this, but IJulia does. So, inside a Jupyter or Pluto notebook (or if you are running Atom with Hydrogen), you can render $\LaTeX$ using

display("text/latex", x)

where x is a latex-formatted string.

This requires x to specify a $\LaTeX$ environment. latexalign and latexequation already does this, but if you want to render the result of latexify you must supply an environment (for example "\$ $x \$").