insightsengineering / formatters

A framework for creating listings of raw data that include specialized formatting, headers, footers, referential footnotes, and pagination.
https://insightsengineering.github.io/formatters/
Other
15 stars 6 forks source link

duplicated page number #286

Closed BFalquet closed 2 months ago

BFalquet commented 2 months ago

pages number are duplicated when object takes more than one page.

library(chevron)
library(rtables)
res <- run(lbt01, chevron::syn_data)
withr::with_options(
  list(formatter_default_page_number = "{i}/{n}"),
  cat(export_as_txt(res))
)
image

In addition, the page_num argument duplicates again the page numbers.

withr::with_options(
  list(formatter_default_page_number = "{i}/{n}"),
  cat(export_as_txt(res), page_num = "- page {i} of {n} -")
)
image
Melkiades commented 2 months ago

@BFalquet add priority if you think we need a fast fix for this, it should not be too complex

BFalquet commented 2 months ago

@Melkiades , can't add the tag somehow, but yes, the leadership considers it a priority. It seem to be formatters related but if you think the issue is better addressed in chevron, please let us know.

BFalquet commented 2 months ago

Issue seem to be related to: https://github.com/insightsengineering/formatters/blob/89e16c95b16df6fe9074a0dfbadb46744224f2b4/R/pagination.R#L1095C1-L1098C4

Not sure this bit of code is still relevant