[Typst] How to configure the font-size for tables (ideally inherit the global fontsize setting) #12759
-
DescriptionHello, For Typst PDF output, I would like to use the same font size in the tables (produced by great-tables package) as in the rest of the document. In the example below, the font size for the contents of the table is 12pt. How to change it to 10pt as specified in the preamble? pyproject.toml: [project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"great-tables>=0.17.0",
"jupyter>=1.1.1",
"polars>=1.29.0",
] ---
title: "[Typst] How to set the font-size in the PDF table?"
format:
typst:
keep-typ: true
papersize: a4
mainfont: Roboto
fontsize: 10pt
engine: jupyter
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt
```{python}
import polars as pl
data = [
{
"c1": "Lorem ipsum dolor sit amet",
"c2": "consectetur adipiscing elit",
"c3": "sed do eiusmod tempor incididunt"
},
{
"c1": "Lorem ipsum dolor sit amet",
"c2": "consectetur adipiscing elit",
"c3": "sed do eiusmod tempor incididunt"
}
]
df = pl.from_dicts(data)
df.style.tab_header(title="Title", subtitle="Subtitle")
```
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt In the produced Typst file, this is the part I would like to override:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't currently have any way (that I know) to pass down fonts and font sizes from Quarto to table packages running in Quarto. This could be addressed by implementing brand.yml for Great Tables. For now, you'll have to set the corresponding options for GT:
![]() |
Beta Was this translation helpful? Give feedback.
We don't currently have any way (that I know) to pass down fonts and font sizes from Quarto to table packages running in Quarto. This could be addressed by implementing brand.yml for Great Tables.
For now, you'll have to set the corresponding options for GT: