How do I avoid weird arbitrary column layouts for Typst PDF tables generated by R (Kable)? #11805
Replies: 2 comments 1 reply
-
The default is to use equal widths for columns. Or eventually produce an HTML table with the columns width set. Could you properly format your post using code blocks for code and terminal outputs? Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
Thank you! And noted. I also managed to solve it using a different set of Kable parameters. This code below produces correct automated table behaviour in Typst for reasons I don't understand.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm currently using quarto (in R studio) to render tables into Typst using the default template. If I produce a multi-column table with the code below (for example) the Typst output contains hard-set column widths that result in a lot of overflow issues with the text (see attached example). When I examine the raw Typst output (below), I see it is setting hard column percentages. Is there any way I can avoid this behaviour with some clever header includes or similar? I really don't want to have to set each table individually, or edit the raw Typst manually.
Using the latest version of R studio, quarto, etc etc on Mac OS.
::: small
:::
:
#block[
#table(
columns: (2.49%, 18.15%, 16.37%, 17.79%, 27.76%, 17.44%),
align: (left,left,left,left,left,left,),
table.header([Region], [Standard], [Scope], [Coverage], [Purpose], [Uptake],),
table.hline(),
[Global], [Taskforce on Climate-related Financial Disclosures], [Climate-related financial disclosures], [Climate risk and opportunities], [Provide recommendations for diclosing climate-related risks and opportunities], [Wide adopted espectially in finance],
[Global], [Carbon Disclosure Project], [Climate and environmental reporting], [Climate change, water, security, deforestation], [Enable compnaies to measure and manage their environmental impacts], [Widely used globally],
[Global], [Integrated Reporting], [Financial, social and environmental reporting], [Financial performance, ecological, social metrics], [Promote transparency and holistic reporting], [Increasingly adopted by companies],
[Global], [Science-based Targets Initiative], [Set science-based climate targets], [Corporate GHG emissions], [Help companies set GHG reduction targets in line with climate science], [Widely recognised especially in corporate sector],
[USA], [Sustainability Accounting Standards Board], [Industry-specific standards], [Environmental, social, governance], [Provide industry-specific standards], [Growing adoption particularly in the US],
[Global], [Climate Disclosure Standards Board], [Climate-related financial disclosures], [Environmental information], [Integrate climate-related information into mainstream financial reporting], [Increasingly recognised globally],
[Global], [Global Reporting Initiative], [Sustainability reporting standards], [environmental, social, governance], [Provide comprehensive sustainability reporting guidelines], [Widely used globally],
)
]
#block
Beta Was this translation helpful? Give feedback.
All reactions