Typst: logo from _brand.yml is drawn on every page and logo: false does not remove it
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript, yaml
- 領域
- backend
研究方向
從 src/core/brand/brand.ts 中的 fillLogoPaths() 開始,追蹤其結果如何傳遞到 src/format/typst/format-typst.ts 中的 resolveLogo()。檢查現有的 logo: false 處理方式,以及 src/resources/formats/typst/pandoc/quarto/page.typ 中的 Typst 頁面背景。完成的標準是:使用品牌標誌進行轉譯時,logo: false 會省略標誌,同時保留品牌色彩和字型。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- JavaScript
- 星號
- 6.1k
- 分支
- 478
- 平均合併
- 17 小時 58 分鐘
- 30 天內合併 PR
- 135
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
quarto-dev/quarto-cli 的其他 Issue
-
accessibility bug embed
難度 2/5 1-3 小時 新手友好度 85/100
quarto-dev/quarto-cli#15306 ·
維護者通常 1 天內回覆
-
bootstrap bug themes
難度 2/5 1-3 小時 新手友好度 82/100
quarto-dev/quarto-cli#15304 ·
維護者通常 1 天內回覆
-
accessibility bug code-blocks html themes
難度 2/5 1-3 小時 新手友好度 78/100
quarto-dev/quarto-cli#15303 ·
維護者通常 1 天內回覆
-
accessibility brand bug dark-mode
難度 2/5 1-3 小時 新手友好度 82/100
quarto-dev/quarto-cli#15301 ·
維護者通常 1 天內回覆
-
bootstrap bug html tables
難度 2/5 1-3 小時 新手友好度 75/100
quarto-dev/quarto-cli#15300 · 1 則留言 ·
維護者通常 1 天內回覆
查看 quarto-dev/quarto-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
approved check:passed logos:add
難度 1/5 1 小時以內 新手友好度 74/100
維護者通常 2 天內回覆
-
binding:python bug
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
AOSSIE-Org/BabyNest#310 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug needs-triage potential-regression
難度 2/5 1-3 小時 新手友好度 78/100
aws/aws-sdk-js-v3#8408 ·
維護者通常 1 天內回覆