|
| 1 | +# Algorithmic NEWS |
| 2 | + |
| 3 | +## v1.0.7 |
| 4 | + |
| 5 | +> [!NOTE] |
| 6 | +> @JL170 added an option to customize line number formatting (#32). |
| 7 | +> ```typ |
| 8 | +> #algorithm( |
| 9 | +> line-numbers-format: x => [#x:], |
| 10 | +> { ... } |
| 11 | +> ) |
| 12 | +> ``` |
| 13 | +
|
| 14 | +> [!NOTE] |
| 15 | +> @avlouis added inline command `IfElseInline` for ternary if-then-else statements (#31). |
| 16 | +> ```typ |
| 17 | +> #{ |
| 18 | +> Assign($m$, IfElseInline($x < y$, $x$, $y$)) |
| 19 | +> } |
| 20 | +> ``` |
| 21 | +
|
| 22 | +> [!NOTE] |
| 23 | +> @wamserma fixed an issue with the width of the column offset not scaling with |
| 24 | +> the font size (#26). |
| 25 | +> Now, the column is specified relative to the font size in [`em`](https://typst.app/docs/reference/layout/length/). |
| 26 | +> This is not a breaking change. |
| 27 | +
|
| 28 | +> [!NOTE] |
| 29 | +> @nonl4331 fixed an issue with `LineComment` not working with certain input types (#27, #28). |
| 30 | +> |
| 31 | +> LineComment statements similar to the instances below will now render correctly. |
| 32 | +> ```typ |
| 33 | +> #{ |
| 34 | +> LineComment([Initialize hashmap], [Count instances]) |
| 35 | +> LineComment([$c += a-b$], [Sum of differences]) |
| 36 | +> } |
| 37 | +> ``` |
| 38 | +
|
| 39 | +## v1.0.6 |
| 40 | +
|
| 41 | +> [!NOTE] |
| 42 | +> @TimeTravelPenguin fixed an issue with `Assign` not working with nested blocks (#23, #24). |
| 43 | +> |
| 44 | +> Algorithms similar to the one below will now render correctly. |
| 45 | +> ```typ |
| 46 | +> #{ |
| 47 | +> let Solve = Call.with("Solve") |
| 48 | +> Assign($x$, Solve[$A$, $b$]) |
| 49 | +> } |
| 50 | +> ``` |
| 51 | +
|
| 52 | +## v1.0.5 |
| 53 | +
|
| 54 | +> [!NOTE] |
| 55 | +> Added an option `line-numbers` to toggle line numbers on/off (#22). |
| 56 | +> ```typ |
| 57 | +> #algorithm(line-numbers: false, ...) |
| 58 | +> #algorithm-figure(line-numbers: false, ...) |
| 59 | +> ``` |
| 60 | +> If you would like to remove line numbers globally, you can define |
| 61 | +> ```typ |
| 62 | +> #let algorithm = algorithm.with(line-numbers: false) |
| 63 | +> #let algorithm-figure = algorithm-figure.with(line-numbers: false) |
| 64 | +> ``` |
| 65 | +
|
| 66 | +> [!NOTE] |
| 67 | +> Fix an issue with `algorithm-figure` float placement (#21). |
| 68 | +> `style-algorithm` now has options `placement` and `scope` mimicking `figure`. |
| 69 | +> By default, options set on `figure(kind: "algorithm")` supersede those of |
| 70 | +> `style-algorithm`. |
| 71 | +> ```typ |
| 72 | +> #show: style-algorithm.with(placement: top, scope: "column") |
| 73 | +> #show figure.where(kind: "algorithm").with(placement: bottom, scope: "parent") |
| 74 | +> ``` |
| 75 | +> The above example will place algorithm figures at the bottom of the parent scope. |
| 76 | +
|
| 77 | +## v1.0.4 |
| 78 | +
|
| 79 | +> [!NOTE] |
| 80 | +> @drecouse fixed an issue with `LineComment` preventing loops' body from displaying (#20). |
| 81 | +> Now, you can use `LineComment` on loops without issues. |
| 82 | +> ```typ |
| 83 | +> LineComment( |
| 84 | +> While($j <= 10$, { |
| 85 | +> Assign[$x$][1] |
| 86 | +> }), |
| 87 | +> "This is inside a nested block", |
| 88 | +> ) |
| 89 | +> ``` |
| 90 | +> [!Screenshot of an algorithm showing a for-loop from i = 1 to 10, with each iteration containing a line calculation (1+1) and a nested while-loop from j = 1 to 10 assigning x = 1, with line comments describing "This is inside a nested block" and "This is a line comment after a block".](https://raw.githubusercontent.com/typst-community/typst-algorithmic/refs/tags/v1.0.4/tests/linecommentfor/ref/1.png) |
| 91 | +
|
| 92 | +> [!NOTE] |
| 93 | +> `algorithm-figure` does not set `placement: none` anymore (#21). |
| 94 | +
|
| 95 | +
|
| 96 | +## v1.0.3 |
| 97 | +
|
| 98 | +> [!WARNING] |
| 99 | +> algorithmic now use grids instead of tables for accessibility purposes, see [layout/grid](https://typst.app/docs/reference/layout/grid/#:~:text=Typst%20will%20annotate%20its%20output%20such%20that%20screenreaders%20will%20announce%20content%20in%20table%20as%20tabular). |
| 100 | +> Any `table.hlines` in `style-algorithm` will error and `grid.hlines` must be used instead. |
| 101 | +
|
| 102 | +> [!NOTE] |
| 103 | +> This version fixes an issue with the indentation offset where the last column corresponding to comments goes in the margin. |
| 104 | +
|
| 105 | +> [!NOTE] |
| 106 | +> `State` is renamed to `Line` and will now work with other commands such as `LineComment`. Documentation is added in the [README](README.md). |
0 commit comments