Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new features to the Typst template #9970

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add linestretch (aka leading) in par
  • Loading branch information
christopherkenny committed Jul 9, 2024
commit c5011d8fce26d64f120e9ef6b72600ffa2dabbaa
3 changes: 3 additions & 0 deletions data/templates/default.typst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ $endif$
$if(fontsize)$
fontsize: $fontsize$,
$endif$
$if(linestretch)$
linestretch: $linestretch$,
$endif$
$if(section-numbering)$
sectionnumbering: "$section-numbering$",
$endif$
Expand Down
6 changes: 5 additions & 1 deletion data/templates/template.typst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
region: "US",
font: (),
fontsize: 11pt,
linestretch: 1,
sectionnumbering: none,
doc,
) = {
Expand All @@ -37,7 +38,10 @@
margin: margin,
numbering: "1",
)
set par(justify: true)
set par(
justify: true,
leading: linestretch * 0.65em
)
Comment on lines +48 to +49
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the leading do here, and why is it needed with linestretch? Is the result the same as Typst's defaults when the default linestretch is used?

set text(lang: lang,
region: region,
font: font,
Expand Down
5 changes: 4 additions & 1 deletion test/writer.typst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@
margin: margin,
numbering: "1",
)
set par(justify: true)
set par(
justify: true,
leading: linestretch * 0.65em
)
set text(lang: lang,
region: region,
font: font,
Expand Down