[0612] TikZ 插件移除 Ghostscript 依赖,改用 pdflatex + MuPDF#3434
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 将图片生成流程从 latex -> dvips -> gs -> png 简化为 pdflatex -> pdf - 利用 Mogan 内置 MuPDF 直接渲染 PDF,不要求用户安装 Ghostscript - 添加 pdf-page-empty? 解析 pdflatex 日志检测空图形,保留提示文本 - 更新 init-tikz.scm 和 binary/tikz.scm 引入 pdflatex 支持 - 更新单元测试覆盖新的 image-valid? 和 pdf-page-empty? Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
file_flush 对 PDF 缺少原生尺寸回退,导致 width=0px&height=0px 时 image_flush 默认使用 0.618par,图片被拉伸到页面宽度的 61.8%。 修复:为 PDF 补充 image_size 检测,并将 pt 按 144 DPI 转换为像素 (px = pt * 144 / 72 = pt * 2),与旧 Ghostscript -r144 参数保持一致。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
da-liii
reviewed
May 20, 2026
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
|
||
| (define (dvips-binary-candidates) | ||
| (define (pdflatex-binary-candidates) |
- 新增 pdf-page-size 函数,从 pdflatex log 中解析 papersize= - 当用户未指定宽高时,eval-and-print 自动将 pt 换算为 px(144 DPI) - 移除对 src/Data/Convert/Generic/input.cpp 的修改需求 - 更新 pdf-page-empty? 复用 pdf-page-size - 更新单元测试覆盖 pdf-page-size 和 pdf-page-empty? Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This reverts commit c9cb08a.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TikZ 插件移除 Ghostscript 依赖,改用 pdflatex 直接生成 PDF:
latex -> dvips -> gs -> png简化为pdflatex -> pdfrun-dvips、run-gs、png-size、eps-bbox-empty?等不再需要的工作函数image-valid?检测生成的 PDF 文件有效性init-tikz.scm移除(binary gs)依赖,仅依赖goldfish和pdflatexbinary/tikz.scm中补充find-binary-pdflatex查找逻辑file_flush对 PDF 缺少原生尺寸回退,导致默认插入大小异常(0.618par),改为按 144 DPI 转换 pt 到像素,与旧 gs-r144行为保持一致Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com