XiangyunHuang / data-analysis-in-action

:book: R 语言数据分析实战(写作中) Data Analysis in Action Using R
https://bookdown.org/xiangyun/data-analysis-in-action/
70 stars 18 forks source link

Quarto 1.4.x 升级 #115

Closed XiangyunHuang closed 1 year ago

XiangyunHuang commented 1 year ago

Quarto 1.4 即将发布了,因此,尝试一下预览版,发现编译出现问题,如下:

Error running filter /opt/quarto/quarto-1.4.369/share/filters/main.lua:
/opt/quarto/quarto-1.4.369/share/filters/main.lua:4305: attempt to index a nil value (field 'content')
stack traceback:
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:226: in function </opt/quarto/quarto-1.4.369/share/filters/main.lua:216>
    (...tail calls...)
    [C]: in ?
    [C]: in method 'walk'
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:148: in function </opt/quarto/quarto-1.4.369/share/filters/main.lua:138>
    (...tail calls...)
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:725: in local 'callback'
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:738: in upvalue 'run_emulated_filter_chain'
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:773: in function </opt/quarto/quarto-1.4.369/share/filters/main.lua:770>
stack traceback:
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:148: in function </opt/quarto/quarto-1.4.369/share/filters/main.lua:138>
    (...tail calls...)
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:725: in local 'callback'
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:738: in upvalue 'run_emulated_filter_chain'
    /opt/quarto/quarto-1.4.369/share/filters/main.lua:773: in function </opt/quarto/quarto-1.4.369/share/filters/main.lua:770>
Error: Process completed with exit code 1.

看来升级不简单。

XiangyunHuang commented 1 year ago

涉及的依赖很多,还是把 Quarto 固定在 1.3.x 为好。比如 ctex 的选项 heading=true 和 Quarto 有冲突 https://github.com/quarto-dev/quarto-cli/issues/6868

XiangyunHuang commented 1 year ago

注意:callout-tip 等 block 内容不能为空,否则就会报上面的错误。

XiangyunHuang commented 1 year ago

涉及的依赖很多,还是把 Quarto 固定在 1.3.x 为好。比如 ctex 的选项 heading=true 和 Quarto 有冲突 quarto-dev/quarto-cli#6868

include-before-body:
  text: |
    \ifdefined\appendixname
      \renewcommand*\appendixname{附录}
    \else
      \newcommand\appendixname{附录}
    \fi

需要定义附录名

XiangyunHuang commented 1 year ago

定位此问题,采用了二分法,先确定 Qmd 文件,然后再将 Qmd 文件内容二分,最后,当输出是 PDF 格式时,callout 内容为空所致。