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

Move header-includes earlier in Typst template? #9996

Closed
gordonwoodhull opened this issue Jul 17, 2024 · 1 comment
Closed

Move header-includes earlier in Typst template? #9996

gordonwoodhull opened this issue Jul 17, 2024 · 1 comment

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Jul 17, 2024

Currently header-includes in default.typst are included after

#show: doc => conf(
 // ...
)

They are also directly before include-before:

$for(header-includes)$
$header-includes$
$endfor$
$for(include-before)$
$include-before$
$endfor$

causing these two kinds of include to have the same effect.

Typst doesn't really have "headers", but I argue it would be more more consistent with the HTML behavior to move header-includes before the show rule.

Currently, attempting to set the page color or background in header-includes will cause the title and abstract to be rendered on a default black-on-white page, followed by a page break, before the rest of the content is rendered with the desired page settings.

Here is an example:

---
title: header-includes is too late in Typst template
abstract: |
  The title and abstract will be printed in black on a white page,
  and the rest of the content will be printed in white on a navy page.
header-includes: |
  ```{=typst}
  #set page(fill: navy)
  #set text(fill: white)
  ```
---

# Text on a new page

Because we did

```typst
#set page(fill: navy)
```

after

```typst
#show: doc => conf(
 // ...
)
```

we started a new page with the new background color.

Happy to open a pull request with this change, but I figured I'd open a issue to discuss first.

cc @cscheid

gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue Jul 24, 2024
includes template fix for
jgm/pandoc#9996

title-font needs to be removed
gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue Jul 31, 2024
includes template fix for
jgm/pandoc#9996

title-font needs to be removed

overlays format-specific brand.defaults on format.render

includes intentionally broken logo default

brand.yaml logo is (for now) still just a string path
open question whether width and padding should be CSS
or perhaps typst would additionally support
e.g. typst-width and inset for direct typst input
@jgm
Copy link
Owner

jgm commented Aug 8, 2024

sounds reasonable to me!

@jgm jgm closed this as completed in 2575490 Aug 8, 2024
gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue Aug 15, 2024
to allow changes to page / title / abstract

fixes jgm/pandoc#9996
pandoc merged change in jgm/pandoc#10070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants