- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在编译一个简单的 Rmarkdown 文件时遇到问题,我对解决方案一无所知。这是问题所在:
我要编译的文件
这是一个没有 R 代码的简单文档,只有文本。在标题中:标题、作者、日期和 output: pdf_document
。
软件包是如何安装的
我使用 rmarkdown
安装了 tinytex
和 install.packages("tidyverse")
包。 TinyTex(发行版)的安装方式如下: tinytex::install_tinytex()
。
错误
> rmarkdown::render("~/document.Rmd", "pdf_document")
processing file: document.Rmd
|........................................................................| 100%
ordinary text without R code
output file: document.knit.md
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS document.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output document.tex --lua-filter /home/rik/R/x86_64-pc-linux-gnu-library/4.0/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/rik/R/x86_64-pc-linux-gnu-library/4.0/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in'
tlmgr: package repository https://ctan.dcc.uchile.cl/systems/texlive/tlnet (verified)
tlmgr install: package already present: latex
tlmgr install: package already present: latex-base-dev
! LaTeX Error: File `article.cls' not found.
! Emergency stop.
<read *>
Erro: LaTeX failed to compile document.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See document.log for more info.
Além disso: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: pdfcrop, ghostcript
-> As a result, figure cropping will be disabled.
文件日志
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2021.3.6) 6 MAR 2021 13:05
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**document.tex
(./document.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
! LaTeX Error: File `article.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
Enter file name:
! Emergency stop.
<read *>
l.7 \usepackage
{lmodern}^^M
Here is how much of TeX's memory you used:
22 strings out of 480971
456 string characters out of 5907552
278620 words of memory out of 5000000
17342 multiletter control sequences out of 15000+600000
403430 words of font info for 27 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
32i,0n,39p,87b,13s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
#1 尝试:重新安装
tinytex
我尝试卸载(
tinytex::uninstall_tinytex()
),再次安装(
tinytex::install_tinytex()
)并重新安装(
tinytex::reinstall_tinytex()
),但错误仍然存在。
lmodern
虽然
tinytex::check_installed("lm") == TRUE
,但我尝试使用
lmoden
安装
tinytex::tlmgr_install("lmodern")
。
> tinytex::tlmgr_install("lmodern")
tlmgr install lmodern
tlmgr: package repository https://ctan.dcc.uchile.cl/systems/texlive/tlnet (verified)
tlmgr install: package lmodern not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr update --self
fmtutil [WARNING]: You seem to have no formats defined in your fmtutil.cnf files!
tlmgr install lmodern
tlmgr: package repository https://ctan.dcc.uchile.cl/systems/texlive/tlnet (verified)
tlmgr install: package lmodern not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: An error has occurred. See above messages. Exiting.
搜索
rik@arch ~ : sudo find / -regex ".*lmodern.sty"
/home/rik/.TinyTex/texmf-dist/tex/latex/lm/lmodern.sty
环境
sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux
Matrix products: default
BLAS: /usr/lib/libblas.so.3.9.0
LAPACK: /usr/lib/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=pt_BR.UTF-8 LC_COLLATE=pt_BR.UTF-8
[5] LC_MONETARY=pt_BR.UTF-8 LC_MESSAGES=pt_BR.UTF-8
[7] LC_PAPER=pt_BR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4
环境变量定义没有
.bash_profile
export PATH=$PATH:$HOME/.local/appimages:$HOME/bin:$HOME/.local/bin
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export TEXMFDIST=/usr/share/texmf-dist
一些观察
rmarkdown
和 tinytex
,即使在 Arch 上也是如此,而且每次都运行良好。 最佳答案
尝试两件事:
texlive-latexextra
会发生什么从拱形 repo ?鉴于您正在使用 tinytex
,我猜您正试图避免这种情况;我问的原因是因为 latex 似乎在系统目录中查找。 TEXMFDIST
您的 .bashrc
中的环境变量. 关于r-markdown - 无法在 Arch Linux 上编译 Rmarkdown 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66509206/
这是我的代码片段:http://www.share-elm.com/sprout/53d242e2e4b07afa6f9834a2灵感来自 elm-lang.org 的 example . main
抱歉,如果这个问题有点基础,但互联网上的研究并没有得出任何合理的答案。我希望能够在我的网站上运行 markdown,类似于 github 所拥有的(编辑/预览设置)或实际上与 stackoverflo
我正在使用 markdown 编写文档,我正在使用 pandoc 将其导出为 PDF。在文档的末尾,我需要在 PDF 的打印副本上留出签名空间。 我试图找到如何绘制一条固定宽度的线,但到目前为止我只需
我已经搜索过谷歌和 SO,不知道 SO 是否是问这个的地方,但我想知道是否有标记可以为 Markdown 做某种类型的注释?我们在 Markdown 中为我们的项目做文档,并希望在不更改内容的情况下在
我想使用简单的文本编辑器和 Markdown 做类笔记。有没有办法标记文本元素以使其机器可读? 例如,我想将某些单词和短语标记为“定义”。然后,我可以运行某种脚本来显示单词及其相应的定义。 最佳答案
我有两个markdown文件:一个parent.md和child.md。 所以parent.md: # Main section ## sub-section 我想引用## sub-section中的
我需要在 Markdown 中创建一个类似嵌套的表,如下所示: 我怎样才能做到这一点? 最佳答案 @Waylan 是对的,您可以将 HTML(例如使用 Markdown 生成的表格)粘贴到 Markd
有没有办法在 Github markdown 的代码片段中链接表单? 例如:`I want THIS to be a link`哪里THIS看起来像 THIS . 最佳答案 我想通过 Markdown
我正在 Github 风格的 Markdown 中整理一些文档,并且我想整理一个有两行的表格。一种是简单的文本,另一种是 json 代码块。这是一个例子。 | Status | Response |
使用 GitHub 上“Markdown Cheatsheet ”中的表示例,您会得到以下结果: | Tables | Are | Cool | | -------
我对 Markdown 中的引号有疑问。当我有这样的事情时: text > quoted text > > deeper layer > > > even deeper
我正在寻找与 Markdown 中的多行代码功能等效的引号。对于代码块我可以方便地编写: ``` this is a code example ``` 有谁知道下面的事情是否可能? >>>
我想在 Markdown 中创建一个列表,但没有项目符号点。这可能吗? 到目前为止,我发现唯一推荐的方法是使用 HTML,我想避免使用 HTML。 最佳答案 这听起来似乎很明显,但是......您可以
我想编写一份编码标准规范文档,其中包含好和坏编码示例。每条规则都应该有一个编号、描述和示例。 例如,这是规则 1: # Rule 1 Description for rule 1. ## Good `
可以关注Marked library documentation并内联渲染一个 Markdown 字符串。这是一个有效的代码片段。 document.getElementById
据我所知,markdown 是 html 的“简化”版本。它易于使用和阅读。但我在创建输入表单时遇到了问题。 有人可以建议是否有任何方法可以在 Markdown 中添加 html 输入表单元素吗?我搜
如何在 Markdown 解析文档中包含小书签?是否有任何 Markdown 的“标签”基本上是说“不要解析这个”?? 例如,您可以有类似的内容: Hello 但是如果我尝试将其中的 JavaScri
可以关注Marked library documentation并内联渲染一个 Markdown 字符串。这是一个有效的代码片段。 document.getElementById
我想编写一个 R Markdown 文档,其中提供了如何编写 R Markdown 文档的代码示例。例如,我想在文档中展示如何将文本呈现为粗体。 `**this is bold**` will ren
我目前正在使用 GitHub 页面构建一个网站,并尝试利用一些 GitHub 风格的 Markdown 功能。特别隔离的代码块和表。 使用 redcarpet,我得到语法突出显示的围栏 block ,
我是一名优秀的程序员,十分优秀!