Typst: logo from _brand.yml is drawn on every page and logo: false does not remove it
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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分
- マージ済み PR(30日)
- 135
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信