diff --git a/DESCRIPTION b/DESCRIPTION index ac56ace4..97546004 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: tinytable Type: Package Title: Simple and Configurable Tables in 'HTML', 'LaTeX', 'Markdown', 'Word', 'PNG', 'PDF', and 'Typst' Formats Description: Create highly customized tables with this simple and dependency-free package. Data frames can be converted to 'HTML', 'LaTeX', 'Markdown', 'Word', 'PNG', 'PDF', or 'Typst' tables. The user interface is minimalist and easy to learn. The syntax is concise. 'HTML' tables can be customized using the flexible 'Bootstrap' framework, and 'LaTeX' code with the 'tabularray' package. -Version: 0.5.0 +Version: 0.5.0.1 Imports: methods Depends: diff --git a/NEWS.md b/NEWS.md index 70c6a9e6..2ecbca45 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # News +## Development + +Bugs: + +* Typst notes returned an error since the last release. Thanks to @DominikVogel for report #357. + ## 0.5.0 New: diff --git a/inst/templates/typst.typ b/inst/templates/typst.typ index 0af62d5f..fc4f9b3e 100644 --- a/inst/templates/typst.typ +++ b/inst/templates/typst.typ @@ -60,8 +60,7 @@ block[ // start block // tinytable cell content after - - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/group_tt-3level.typ b/inst/tinytest/_tinysnapshot/group_tt-3level.typ index 08fa6b69..f49168db 100644 --- a/inst/tinytest/_tinysnapshot/group_tt-3level.typ +++ b/inst/tinytest/_tinysnapshot/group_tt-3level.typ @@ -73,7 +73,7 @@ table.cell(stroke: (bottom: .05em + black), colspan: 2, align: center)[c],table. [21.0], [6], [160], [110], [3.90], [22.8], [4], [108], [ 93], [3.85], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/group_tt-issue258_01_typst.txt b/inst/tinytest/_tinysnapshot/group_tt-issue258_01_typst.txt index 389aae2c..df2fa42b 100644 --- a/inst/tinytest/_tinysnapshot/group_tt-issue258_01_typst.txt +++ b/inst/tinytest/_tinysnapshot/group_tt-issue258_01_typst.txt @@ -73,7 +73,7 @@ table.cell(colspan: 5)[hello], [4.6], [3.1], [1.5], [0.2], [setosa], [5.0], [3.6], [1.4], [0.2], [setosa], [5.4], [3.9], [1.7], [0.4], [setosa], - // tinytable footer before + // tinytable footer after ) // end table ]) // end align diff --git a/inst/tinytest/_tinysnapshot/group_tt-issue258_02_typst.txt b/inst/tinytest/_tinysnapshot/group_tt-issue258_02_typst.txt index e7dd52ec..abb9598e 100644 --- a/inst/tinytest/_tinysnapshot/group_tt-issue258_02_typst.txt +++ b/inst/tinytest/_tinysnapshot/group_tt-issue258_02_typst.txt @@ -74,7 +74,7 @@ table.cell(colspan: 5)[world], [4.6], [3.1], [1.5], [0.2], [setosa], [5.0], [3.6], [1.4], [0.2], [setosa], [5.4], [3.9], [1.7], [0.4], [setosa], - // tinytable footer before + // tinytable footer after ) // end table ]) // end align diff --git a/inst/tinytest/_tinysnapshot/tibble-typst_pillar_num.txt b/inst/tinytest/_tinysnapshot/tibble-typst_pillar_num.txt index 492f9a5f..c6064d87 100644 --- a/inst/tinytest/_tinysnapshot/tibble-typst_pillar_num.txt +++ b/inst/tinytest/_tinysnapshot/tibble-typst_pillar_num.txt @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 3, stroke: 0.1em + black), [1000.], [1000. ], [1000.5], [1100.], [1100. ], [1100.5], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-complicated.txt b/inst/tinytest/_tinysnapshot/typst-complicated.txt index 43012b77..b02ef92a 100644 --- a/inst/tinytest/_tinysnapshot/typst-complicated.txt +++ b/inst/tinytest/_tinysnapshot/typst-complicated.txt @@ -76,7 +76,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black), [22.8], [4], [108], [ 93], [3.85], [21.4], [6], [258], [110], [3.08], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-font_size.txt b/inst/tinytest/_tinysnapshot/typst-font_size.txt index 7d60fbdf..463f0d92 100644 --- a/inst/tinytest/_tinysnapshot/typst-font_size.txt +++ b/inst/tinytest/_tinysnapshot/typst-font_size.txt @@ -71,7 +71,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black), [22.8], [4], [108], [ 93], [3.85], [21.4], [6], [258], [110], [3.08], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-formatting.txt b/inst/tinytest/_tinysnapshot/typst-formatting.txt index 2c1d7f80..dbc4937e 100644 --- a/inst/tinytest/_tinysnapshot/typst-formatting.txt +++ b/inst/tinytest/_tinysnapshot/typst-formatting.txt @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 4, stroke: 0.1em + black), [201399], [201.4 ], [1970-08-21], [True ], [100188], [ 0.13], [1970-07-18], [False], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-grid.txt b/inst/tinytest/_tinysnapshot/typst-grid.txt index b6c93af8..527c94ca 100644 --- a/inst/tinytest/_tinysnapshot/typst-grid.txt +++ b/inst/tinytest/_tinysnapshot/typst-grid.txt @@ -67,7 +67,7 @@ block[ // start block [22.8], [4], [108], [ 93], [3.85], [21.4], [6], [258], [110], [3.08], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-group_rows.txt b/inst/tinytest/_tinysnapshot/typst-group_rows.txt index e77f8ece..b85a9e7d 100644 --- a/inst/tinytest/_tinysnapshot/typst-group_rows.txt +++ b/inst/tinytest/_tinysnapshot/typst-group_rows.txt @@ -78,7 +78,7 @@ table.cell(colspan: 8)[They love tofu], [14.3], [8], [360.0], [245], [3.21], [3.570], [15.84], [0], [24.4], [4], [146.7], [ 62], [3.69], [3.190], [20.00], [1], [22.8], [4], [140.8], [ 95], [3.92], [3.150], [22.90], [1], - // tinytable footer before + // tinytable footer after ) // end table ]) // end align diff --git a/inst/tinytest/_tinysnapshot/typst-issue-139_misaligned_rule_with_group_tt.txt b/inst/tinytest/_tinysnapshot/typst-issue-139_misaligned_rule_with_group_tt.txt index 577acc18..569e6566 100644 --- a/inst/tinytest/_tinysnapshot/typst-issue-139_misaligned_rule_with_group_tt.txt +++ b/inst/tinytest/_tinysnapshot/typst-issue-139_misaligned_rule_with_group_tt.txt @@ -81,7 +81,7 @@ table.cell(colspan: 5)[Brie], [24.4], [4], [146.7], [ 62], [3.69], [22.8], [4], [140.8], [ 95], [3.92], [19.2], [6], [167.6], [123], [3.92], - // tinytable footer before + // tinytable footer after ) // end table ]) // end align diff --git a/inst/tinytest/_tinysnapshot/typst-issue323_group_tt_style_tt.txt b/inst/tinytest/_tinysnapshot/typst-issue323_group_tt_style_tt.txt index 66e0d208..5b4d1889 100644 --- a/inst/tinytest/_tinysnapshot/typst-issue323_group_tt_style_tt.txt +++ b/inst/tinytest/_tinysnapshot/typst-issue323_group_tt_style_tt.txt @@ -81,7 +81,7 @@ table.cell(colspan: 8)[They love tofu], [14.3], [8], [360.0], [245], [3.21], [3.570], [15.84], [0], [24.4], [4], [146.7], [ 62], [3.69], [3.190], [20.00], [1], [22.8], [4], [140.8], [ 95], [3.92], [3.150], [22.90], [1], - // tinytable footer before + // tinytable footer after ) // end table ]) // end align diff --git a/inst/tinytest/_tinysnapshot/typst-italic_markdown.txt b/inst/tinytest/_tinysnapshot/typst-italic_markdown.txt index 2e664def..bb9c8ec9 100644 --- a/inst/tinytest/_tinysnapshot/typst-italic_markdown.txt +++ b/inst/tinytest/_tinysnapshot/typst-italic_markdown.txt @@ -68,7 +68,7 @@ table.hline(y: 0, start: 0, end: 1, stroke: 0.1em + black), // tinytable cell content after [This is _italic_ text.], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-missing_value_replacement.txt b/inst/tinytest/_tinysnapshot/typst-missing_value_replacement.txt index c11cfa3b..03f8f2cc 100644 --- a/inst/tinytest/_tinysnapshot/typst-missing_value_replacement.txt +++ b/inst/tinytest/_tinysnapshot/typst-missing_value_replacement.txt @@ -69,7 +69,7 @@ table.hline(y: 0, start: 0, end: 2, stroke: 0.1em + black), [ 1], [-], [ 2], [ 5], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-more_formatting.txt b/inst/tinytest/_tinysnapshot/typst-more_formatting.txt index d1a7b286..10b1387c 100644 --- a/inst/tinytest/_tinysnapshot/typst-more_formatting.txt +++ b/inst/tinytest/_tinysnapshot/typst-more_formatting.txt @@ -70,7 +70,7 @@ table.hline(y: 0, start: 0, end: 3, stroke: 0.1em + black), [Food: Tofu], [ 0.146], [29M], [Food: Beans], [ 0.003], [94K], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-no_headers.txt b/inst/tinytest/_tinysnapshot/typst-no_headers.txt index 1121c00e..a527a69f 100644 --- a/inst/tinytest/_tinysnapshot/typst-no_headers.txt +++ b/inst/tinytest/_tinysnapshot/typst-no_headers.txt @@ -68,7 +68,7 @@ table.hline(y: 1, start: 0, end: 5, stroke: 0.1em + black), [22.8], [4], [108], [ 93], [3.85], [21.4], [6], [258], [110], [3.08], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-significant_cell.txt b/inst/tinytest/_tinysnapshot/typst-significant_cell.txt index a5286b10..6aceae93 100644 --- a/inst/tinytest/_tinysnapshot/typst-significant_cell.txt +++ b/inst/tinytest/_tinysnapshot/typst-significant_cell.txt @@ -68,7 +68,7 @@ table.hline(y: 0, start: 0, end: 1, stroke: 0.1em + black), [0.00012], [12], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/_tinysnapshot/typst-striped.txt b/inst/tinytest/_tinysnapshot/typst-striped.txt index 8694b2e2..2098cc44 100644 --- a/inst/tinytest/_tinysnapshot/typst-striped.txt +++ b/inst/tinytest/_tinysnapshot/typst-striped.txt @@ -71,7 +71,7 @@ table.hline(y: 0, start: 0, end: 5, stroke: 0.1em + black), [22.8], [4], [108], [ 93], [3.85], [21.4], [6], [258], [110], [3.08], - // tinytable footer before + // tinytable footer after ) // end table diff --git a/inst/tinytest/test-typst.R b/inst/tinytest/test-typst.R index e69e997c..c34a34e8 100644 --- a/inst/tinytest/test-typst.R +++ b/inst/tinytest/test-typst.R @@ -117,6 +117,11 @@ expect_snapshot_print(tab, label = "typst-issue323_group_tt_style_tt") +# Issue #357 +tab <- tt(head(iris), notes = "blah") |> save_tt("typst") +expect_true(grepl('blah', tab)) + + options(tinytable_print_output = NULL) diff --git a/sandbox/typst.qmd b/sandbox/typst.qmd index 8d99d272..8d780f90 100644 --- a/sandbox/typst.qmd +++ b/sandbox/typst.qmd @@ -164,3 +164,10 @@ tt(head(iris)) |> group_tt(i = list("hello" = 1)) # issue #259 02 tt(head(iris)) |> group_tt(i = list("hello" = 2, "world" = 2)) ``` + + +```{r} +# issue #357 +tt(head(iris), notes = "blah") +``` +