Skip to content

Commit 53d09f4

Browse files
committed
feat:Handling of numeric elements in lists in &to-latex.
1 parent 7f65d80 commit 53d09f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/CortexJS.rakumod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ sub to-latex($expr,
9696
if $sep.isa(Whatever) { $sep = ', \: ' }
9797
die 'The argument $sep is expected to be a string or Whatever' unless $sep ~~ Str:D;
9898

99-
my $res = do if $expr ~~ (Array:D | List:D | Seq:D) && $expr.all ~~ (Array:D | List:D | Seq:D) {
100-
$expr.map({ $ce.to-latex($_) }).join($sep)
99+
my $res = do if $expr ~~ (Array:D | List:D | Seq:D) && $expr.all ~~ (Array:D | List:D | Seq:D | Numeric:D) {
100+
$expr.map({ $_ ~~ Numeric:D ?? $ce.to-latex(['Number', $_]) !! $ce.to-latex($_) }).join($sep)
101101
} else {
102102
$ce.to-latex($expr)
103103
}

0 commit comments

Comments
 (0)