Typst: logo from _brand.yml is drawn on every page and logo: false does not remove it
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, yaml
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu tại src/core/brand/brand.ts, ở fillLogoPaths(), rồi theo dõi cách kết quả của nó được truyền đến resolveLogo() từ src/format/typst/format-typst.ts. Kiểm tra cách xử lý hiện có đối với logo: false và nền trang Typst trong src/resources/formats/typst/pandoc/quarto/page.typ. Công việc hoàn tất khi kết quả kết xuất có logo thương hiệu sẽ bỏ logo nếu dùng logo: false, đồng thời giữ nguyên màu sắc và phông chữ thương hiệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 6.1k
- Fork
- 478
- Merge trung bình
- 17 giờ 58 phút
- Pull request đã merge (30 ngày)
- 135
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto-cli
-
accessibility bug embed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
quarto-dev/quarto-cli#15306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bootstrap bug themes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quarto-dev/quarto-cli#15304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility bug code-blocks html themes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto-cli#15303 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility brand bug dark-mode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quarto-dev/quarto-cli#15301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bootstrap bug html tables
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
quarto-dev/quarto-cli#15300 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/quarto-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: ON Football HD feed LogoĐang mởapproved check:passed logos:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG: Unhandled TypeError in updateMedicine and updateDischargeLog when data is null/undefinedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/BabyNest#310 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage potential-regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws/aws-sdk-js-v3#8408 ·
Maintainer thường phản hồi trong vòng 1 ngày