Skip to content

Commit

Permalink
Fix arrays with :bracket.
Browse files Browse the repository at this point in the history
  • Loading branch information
korsbo committed Mar 31, 2021
1 parent bfbcf44 commit 289099d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/latexbracket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ function _latexbracket(x; kwargs...)
return latexstr
end

_latexbracket(x::Union{AbstractArray, Tuple}; kwargs...) = [latexbracket.(x; kwargs...)...]
_latexbracket(args...; kwargs...) = latexbracket(args; kwargs...)
24 changes: 24 additions & 0 deletions test/latexbracket_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Latexify, Test

# Latexify.@generate_test latexify(:(x = [1, 2]), env=:bracket)
@test latexify(:(x = [1, 2]), env = :bracket) == replace(
raw"\[
x = \left[
\begin{array}{c}
1 \\
2 \\
\end{array}
\right]\]
", "\r\n"=>"\n")


# Latexify.@generate_test latexify([1, 2], env=:bracket)
@test latexify([1, 2], env = :bracket) == replace(
raw"\[
\left[
\begin{array}{c}
1 \\
2 \\
\end{array}
\right]\]
", "\r\n"=>"\n")
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using Test
@testset "latexalign tests" begin include("latexalign_test.jl") end
@testset "latexarray tests" begin include("latexarray_test.jl") end
@testset "latexequation tests" begin include("latexequation_test.jl") end
@testset "latexbracket tests" begin include("latexbracket_test.jl") end
@testset "latexinline tests" begin include("latexinline_test.jl") end
@testset "latextabular tests" begin include("latextabular_test.jl") end
@testset "mdtable tests" begin include("mdtable_test.jl") end
Expand Down

0 comments on commit 289099d

Please sign in to comment.