You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Quarto渲染PDF报错:dvipdfmx无法打开输出文件

问题描述

使用Quarto生成PDF时,首次渲染正常,但修改内容二次渲染时报错:

restricted \write18 enabled.
entering extended mode
dvipdfmx:fatal: Unable to open "AWS_Architecture.pdf".
No output PDF file written.
compilation failed- error

重命名.qmd文件(如AWS_Architecture.qmd改为AWS_Architecture2.qmd)可临时解决问题,但删除文件夹内所有文件后用原文件名重新开始,仍会报错,日志附带以下信息:

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
Error 1 (driver return code) generating output; file AWS_Architecture.pdf may not be valid.

使用的.qmd代码示例:

---
title: "AWS Architecture"
format: pdf
---

## AWS Architecture 

![](images/AWSArchitecture.png)
解决思路
  • 释放PDF文件占用:报错核心是无法打开目标PDF,大概率是该文件被其他程序锁定(比如PDF阅读器、系统预览窗口),关闭所有访问该文件的程序后重新渲染。
  • 清理Quarto临时文件:渲染过程中生成的.tex、.aux、.log等中间文件可能残留冲突信息,执行quarto clean命令清理项目目录的临时文件,或手动删除除.qmd和图片资源外的所有文件,再重新渲染。
  • 指定新的输出路径:在YAML配置中修改PDF输出路径,绕开原文件名的锁定问题,示例配置:
    ---
    title: "AWS Architecture"
    format: 
      pdf:
        output-file: outputs/AWS_Architecture.pdf
    ---
    
    需提前创建outputs文件夹。
  • 更新LaTeX环境:如果以上方法无效,可能是dvipdfmx组件异常,更新你的TeX发行版(TeX Live/MikTeX)到最新版本,修复组件问题。

内容的提问来源于stack exchange,提问作者PeterBloomingdale

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 16:54:52