Skip to content

Commit

Permalink
Merge pull request #1317 from hersle/latex_quick_fix
Browse files Browse the repository at this point in the history
Quick fix Latex rendering
  • Loading branch information
ChrisRackauckas authored Oct 21, 2024
2 parents 9f19dba + 422f60d commit aca9d07
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/latexify_recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/latexify_refs/integral1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\begin{equation}
\int_{0}^{1)} \texttt{dx} x
\int_{0}^{1)} \mathtt{dx} x
\end{equation}
2 changes: 1 addition & 1 deletion test/latexify_refs/integral2.txt
Original file line number Diff line number Diff line change
@@ -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}
2 changes: 1 addition & 1 deletion test/latexify_refs/integral3.txt
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit aca9d07

Please sign in to comment.