Skip to content

Commit 4015450

Browse files
committed
fix latexify of the empty tree
1 parent f7511c2 commit 4015450

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RootedTrees"
22
uuid = "47965b36-3f3e-11e9-0dcf-4570dfd42a8c"
33
authors = ["Hendrik Ranocha <mail@ranocha.de> and contributors"]
4-
version = "2.6.2-pre"
4+
version = "2.6.2"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/RootedTrees.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,9 @@ julia> rootedtree([1, 2, 3, 3, 2]) |> RootedTrees.latexify |> println
14481448
```
14491449
"""
14501450
function latexify(t::RootedTree)
1451+
if isempty(t)
1452+
return "\\varnothing"
1453+
end
14511454
list_representation = butcher_representation(t, false)
14521455
"\\rootedtree" * replace(list_representation, "τ" => "[]")
14531456
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ end
9999
@test RootedTrees.latexify(t1) == latex_string
100100
@test latexify(t1) == "\$" * latex_string * "\$"
101101
@test isempty(RootedTrees.subtrees(t1))
102+
@test RootedTrees.latexify(empty(t1)) == "\\varnothing"
102103

103104
@inferred order(t1)
104105
@inferred σ(t1)

0 commit comments

Comments
 (0)