From eea74c2845d4486a23877047f0736ff457bb645c Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Mon, 21 Oct 2024 14:08:35 +0200 Subject: [PATCH 1/2] Fix Latex rendering --- src/latexify_recipes.jl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/latexify_recipes.jl b/src/latexify_recipes.jl index 0e895e0be..a36fd43d3 100644 --- a/src/latexify_recipes.jl +++ b/src/latexify_recipes.jl @@ -195,12 +195,9 @@ function _toexpr(O) sym = string(nameof(O)) sym = replace(sym, NAMESPACE_SEPARATOR => ".") if length(sym) > 1 - sym = Latexify.unicode2latex(sym) - sym = replace(sym, "_"=>"\\_") - return LaTeXString(string("\\texttt", "{", sym, "}")) - else - return Symbol(sym) + sym = string("\\mathtt{", sym, "}") end + return Symbol(sym) end !iscall(O) && return O From 422f60dad23381e5186faed184ce683562d68d49 Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Mon, 21 Oct 2024 14:33:51 +0200 Subject: [PATCH 2/2] Update tests --- test/latexify_refs/integral1.txt | 2 +- test/latexify_refs/integral2.txt | 2 +- test/latexify_refs/integral3.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/latexify_refs/integral1.txt b/test/latexify_refs/integral1.txt index d03e515c2..1c25cc18e 100644 --- a/test/latexify_refs/integral1.txt +++ b/test/latexify_refs/integral1.txt @@ -1,3 +1,3 @@ \begin{equation} -\int_{0}^{1)} \texttt{dx} x +\int_{0}^{1)} \mathtt{dx} x \end{equation} diff --git a/test/latexify_refs/integral2.txt b/test/latexify_refs/integral2.txt index 3e8ba3144..aab3f1da5 100644 --- a/test/latexify_refs/integral2.txt +++ b/test/latexify_refs/integral2.txt @@ -1,3 +1,3 @@ \begin{equation} -\int_{-\infty}^{\infty)} \texttt{dx} \left( u\left( x \right) \right)^{2} +\int_{-\infty}^{\infty)} \mathtt{dx} \left( u\left( x \right) \right)^{2} \end{equation} diff --git a/test/latexify_refs/integral3.txt b/test/latexify_refs/integral3.txt index 2857cd437..e4c62994b 100644 --- a/test/latexify_refs/integral3.txt +++ b/test/latexify_refs/integral3.txt @@ -1,3 +1,3 @@ \begin{equation} -\int_{ - z}^{u\left( x \right))} \texttt{dx} x^{2} +\int_{ - z}^{u\left( x \right))} \mathtt{dx} x^{2} \end{equation}