Typst: logo from _brand.yml is drawn on every page and logo: false does not remove it
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript, yaml
- Domaine
- backend
Piste de recherche
Commencez dans src/core/brand/brand.ts, au niveau de fillLogoPaths(), et suivez le cheminement de son résultat jusqu’à resolveLogo() depuis src/format/typst/format-typst.ts. Vérifiez le traitement existant de logo: false et l’arrière-plan de page Typst dans src/resources/formats/typst/pandoc/quarto/page.typ. Le travail est terminé lorsque le rendu avec un logo de marque omet le logo avec logo: false tout en préservant les couleurs et les polices de la marque.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Bug description
When _brand.yml defines a logo, Typst output puts it in the page background of every page, and logo: false does not remove it, neither as a typst format option nor at the top level of the front matter.
revealjs honors logo: false with the same _brand.yml, and websites and books document it for navbar and sidebar (https://prerelease.quarto.org/docs/authoring/brand.html#disabling-the-logo).
For Typst, the only document-level switch I found is brand: false, which also drops the brand colors and fonts.
Steps to reproduce
_brand.yml
logo:
images:
mark:
path: logo.svg
alt: Logo
small: mark
logo.svg
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#d33"/></svg>
doc.qmd
---
title: Logo test
format:
typst:
logo: false
---
First page paragraph.
{{< pagebreak >}}
Second page paragraph.
quarto render doc.qmd -M keep-typ:true
grep "set page(background" doc.typ
Same result with logo: false at the top level instead of under typst, and without logo at all.
Actual behavior
doc.typ always contains
#set page(background: align(left+top, box(inset: 0.75in, image("/logo.svg", width: 1.5in, alt: "Logo"))))
and the red square is drawn on both pages of the PDF.
Expected behavior
logo: false removes the logo in Typst output, while the rest of _brand.yml still applies.
Cause
The Typst format passes the document logo through fillLogoPaths() before resolveLogo():
resolveLogo() handles false since #13922 (for navbar and sidebar):
but fillLogoPaths() turns any falsy value into undefined first:
So resolveLogo() receives undefined and falls back to the first brand logo of small, medium, large, which the page.typ partial then sets as page background:
We could let false pass through fillLogoPaths() unchanged so the existing check in resolveLogo() applies.
Workaround
A Typst file in include-in-header that wraps article() and resets the background before any content:
#let quarto-article = article
#let article(..args) = {
set page(background: none)
quarto-article(..args)
}
format:
typst:
include-in-header: no-logo.typ
It resets any other page background too. A plain #set page(background: none) in include-before-body comes after the title block and adds an extra page.
Your environment
- Quarto 1.12.0 (prerelease), also 1.11.9
- Windows 11
- Langage dominant
- JavaScript
- Étoiles
- 6.1k
- Forks
- 478
- Merge moyen
- 17 h 58 min
- PR mergées (30 j)
- 135
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de quarto-dev/quarto-cli
-
accessibility bug embed
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
quarto-dev/quarto-cli#15306 ·
Les mainteneurs répondent en général sous 1 jour
-
bootstrap bug themes
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
quarto-dev/quarto-cli#15304 ·
Les mainteneurs répondent en général sous 1 jour
-
accessibility bug code-blocks html themes
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
quarto-dev/quarto-cli#15303 ·
Les mainteneurs répondent en général sous 1 jour
-
accessibility brand bug dark-mode
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
quarto-dev/quarto-cli#15301 ·
Les mainteneurs répondent en général sous 1 jour
-
bootstrap bug html tables
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
quarto-dev/quarto-cli#15300 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de quarto-dev/quarto-cli
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Add: ON Football HD feed LogoOuverteapproved check:passed logos:add
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 2 jours
-
binding:python bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
BUG: Unhandled TypeError in updateMedicine and updateDischargeLog when data is null/undefinedOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
AOSSIE-Org/BabyNest#310 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug needs-triage potential-regression
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
aws/aws-sdk-js-v3#8408 ·
Les mainteneurs répondent en général sous 1 jour