Note
@JL170 added an option to customize line number formatting (#32).
#algorithm(
line-numbers-format: x => [#x:],
{ ... }
)Note
@avlouis added inline command IfElseInline for ternary if-then-else statements (#31).
#{
Assign($m$, IfElseInline($x < y$, $x$, $y$))
}Note
@wamserma fixed an issue with the width of the column offset not scaling with
the font size (#26).
Now, the column is specified relative to the font size in em.
This is not a breaking change.
Note
@nonl4331 fixed an issue with LineComment not working with certain input types (#27, #28).
LineComment statements similar to the instances below will now render correctly.
#{
LineComment([Initialize hashmap], [Count instances])
LineComment([$c += a-b$], [Sum of differences])
}Note
@TimeTravelPenguin fixed an issue with Assign not working with nested blocks (#23, #24).
Algorithms similar to the one below will now render correctly.
#{
let Solve = Call.with("Solve")
Assign($x$, Solve[$A$, $b$])
}Note
Added an option line-numbers to toggle line numbers on/off (#22).
#algorithm(line-numbers: false, ...)
#algorithm-figure(line-numbers: false, ...)If you would like to remove line numbers globally, you can define
#let algorithm = algorithm.with(line-numbers: false)
#let algorithm-figure = algorithm-figure.with(line-numbers: false)Note
Fix an issue with algorithm-figure float placement (#21).
style-algorithm now has options placement and scope mimicking figure.
By default, options set on figure(kind: "algorithm") supersede those of
style-algorithm.
#show: style-algorithm.with(placement: top, scope: "column")
#show figure.where(kind: "algorithm").with(placement: bottom, scope: "parent")The above example will place algorithm figures at the bottom of the parent scope.
Note
@drecouse fixed an issue with LineComment preventing loops' body from displaying (#20).
Now, you can use LineComment on loops without issues.
LineComment(
While($j <= 10$, {
Assign[$x$][1]
}),
"This is inside a nested block",
)Note
algorithm-figure does not set placement: none anymore (#21).
Warning
algorithmic now use grids instead of tables for accessibility purposes, see layout/grid.
Any table.hlines in style-algorithm will error and grid.hlines must be used instead.
Note
This version fixes an issue with the indentation offset where the last column corresponding to comments goes in the margin.
Note
State is renamed to Line and will now work with other commands such as LineComment. Documentation is added in the README.