奇怪的错误,带有斜体大写希腊字母。

huangapple go评论59阅读模式
英文:

Strange error with italic capital Greek letters

问题

我正在使用R和Bookdown。在数学表达式中,斜体大写希腊字母会引发一个我不太理解的警告。例如,输入

some text $\varGamma$ some text

会产生以下警告:

[WARNING] Could not convert TeX math '\varGamma', rendering as TeX:
  \varGamma
           ^
  unexpected eof
  expecting "%", "\label", "\nonumber" or whitespace

然而,我在html输出中确实看到了一个斜体大写Gamma。

由于Bookdown还会生成pdf和epub输出,我尝试通过在"_output.yml"文件中添加download: no来禁用它们,正如在这个问题的答案中建议的那样,以防错误是由于编译其中一个输出引起的:

bookdown::gitbook:
[...]
download: no

但警告仍然存在。

有什么想法是什么原因引起这个警告?

英文:

I am using R and Bookdown. In maths expressions, italic capital Greek letters cause a warning which I don't quite understand. For example, the input

some text $\varGamma$ some text

gives

[WARNING] Could not convert TeX math '\varGamma', rendering as TeX:
  \varGamma
           ^
  unexpected eof
  expecting "%", "\\label", "\\nonumber" or whitespace

Yet I do see an italic capital Gamma in the html output.

Since Bookdown also produces pdf and epub outputs, I tried disabling those by putting download: no in the _output.yml file, as suggested in the answer to this question, in case the error comes from compiling one of them:

bookdown::gitbook:
[...]
download: no

but the warning persists.

Any idea what can be causing this?

答案1

得分: 2

I found the culprit, which in my case probably comes from my using the script _build.sh provided by Bookdown to compile the input (I believe Rstudio users don't need it).

Removing the line for compilation of the epub output from _build.sh:

Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"

as well as disabling the epub output by removing , "epub" in _output.yml:

bookdown::gitbook:
  css: style.css
  config:
[...]
    download: ["pdf"]

made the warning disappear.

英文:

I found the culprit, which in my case probably comes from my using the script _build.sh provided by Bookdown to compile the input (I believe Rstudio users don't need it).

Removing the line for compilation of the epub output from _build.sh:

Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"

as well as disabling the epub output by removing , "epub" in _output.yml:

bookdown::gitbook:
  css: style.css
  config:
[...]
    download: ["pdf"]

made the warning disappear.

huangapple
  • 本文由 发表于 2023年5月22日 17:31:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76304777.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定