From dc98b5c4d83bef9c0df371d6a52e5e2d03cd9aff Mon Sep 17 00:00:00 2001 From: Matt Lui <92664603+superyuuki@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:01:56 -0400 Subject: [PATCH] Update latexoperation.jl --- src/latexoperation.jl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/latexoperation.jl b/src/latexoperation.jl index 0f50f01c..8630c4e7 100644 --- a/src/latexoperation.jl +++ b/src/latexoperation.jl @@ -48,7 +48,15 @@ function latexoperation(ex::Expr, prevOp::AbstractArray; kwargs...)::String i == length(args) || (str *= cdot ? " \\cdot " : " ") end return str - + elseif op in [:⋅] + str="" + for i ∈ eachindex(args)[2:end] + arg = args[i] + (precedence(prevOp[i]) < precedence(op) || (ex.args[i] isa Complex && !iszero(ex.args[i].re))) && (arg = "\\left( $arg \\right)") + str = string(str, arg) + i == length(args) || (" \\cdot ") + end + return str elseif op in [:+] str = "" for i ∈ eachindex(args)[2:end]