英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论