Skip to content

Commit

Permalink
Add support for env=:equation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Korsbo committed Jun 26, 2019
1 parent 956e167 commit cb3ca42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Latexify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include("latexify_function.jl")
include("latexarray.jl")
include("latexalign.jl")
include("latexinline.jl")
include("latexequation.jl")
include("latextabular.jl")

include("md.jl")
Expand Down
15 changes: 15 additions & 0 deletions src/latexequation.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

function latexequation end

function latexequation(eq; starred=false, kwargs...)
latexstr = latexraw(eq; kwargs...)

str = "\\begin{equation$(starred ? "*" : "")}\n"
str *= latexstr
str *= "\n"
str *= "\\end{equation$(starred ? "*" : "")}\n"
latexstr = LaTeXString(str)
COPY_TO_CLIPBOARD && clipboard(latexstr)
return latexstr
end

1 change: 1 addition & 0 deletions src/latexify_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function infer_output(env, args...)
env == :raw && return latexraw
env == :array && return latexarray
env == :align && return latexalign
env in [:eq, :equation] && return latexequation
env == :mdtable && return mdtable
env == :mdtext && return mdtext
env in [:arrows, :chem, :chemical, :arrow] && return chemical_arrows
Expand Down

0 comments on commit cb3ca42

Please sign in to comment.