yihui 移动 TinyTeX 位置,找不到字体了

  • 将 TinyTeX 默认存放位置 %APPDATA%\TinyTeX 移动到D盘,即 D:\TinyTeX,然后执行
    "D:\TinyTeX\bin\win32\tlmgr" path add

  • 安装几个常用字体 tinytex::tlmgr_install(c('sourcesanspro','sourcecodepro','sourceserifpro'))

  • fc-cache -f -v 刷新字体缓存,问题是缓存不到 D:\TinyTeX\texmf-dist\fonts 目录下的字体,以前使用 TeXLive 没这问题,我知道有个笨办法,挨个找到字体文件,手动安装到 C:\Windows\Fonts,有没有好点的办法?

PS: 将目录 D:\TinyTeX\texmf-dist\fonts 添加到当前用户的 Path 路径上也不管用

fc-cache -f -v
Note that it needs some time to create caches,
especially if there are many large font files.
Wait with patience.

C:/Windows/fonts: caching, new cache contents: 850 fonts, 0 dirs
C:/Users/XiangYun/AppData/Local/Temp/RtmpkNFfPn/install-tl-20171205/TinyTeX/texmf-dist/fonts/opentype: skipping, no such directory
C:/Users/XiangYun/AppData/Local/Temp/RtmpkNFfPn/install-tl-20171205/TinyTeX/texmf-dist/fonts/truetype: skipping, no such directory
D:/TinyTeX/texmf-var/fonts/cache: cleaning cache directory
fc-cache: succeeded

    yihui 没有起作用,还是扫的 C:/Users/XiangYun/AppData/Local/ 目录,如上

      yihui 1. 但是 fc-list :lang=en-us | sort > D:/en.txt 保存的 txt 文件里还是找不到我安装的字体,也就没法在文中调用\setmainfont{Source Sans Pro}

      1. 关于参考文献的引用,我发现tinytex::latexmk('manual.tex', engine = 'xelatex', bib_engine = 'bibtex')并未达到下面依次执行的效果
      • xelatex manual.tex
      • bibtex manual 注意不是 bibtex manual.tex
      • xelatex manual.tex
      • xelatex manual.tex

      manual.tex 文件 下载

        yihui 确实很诡异。为了简化问题,我把 tinytex、TinyTeX、CTeX 都卸载了,然后仅重装 CTeX,没装 TinyTeX,仍然没解决。不管是在 bookdown 里,还是用别的编辑器例如 TeXStudio,都不能往 \bibliography{book} 里添加扩展名 .bib。只要一添加,系统就说找不到 book.bib.bib。不知道是谁给多添加了个 .bib。我记得几个月前是没有这个问题的。

        我看到也有别人(路人甲路人乙)遇到了这个问题,看原因也没看出个所以然来,不过解决办法倒都是“去掉扩展名 '.bib'”。另外,有几处(示例1示例2)都强调在声明 \bibliography 时不要加扩展名。

        应该是 BibTeX 的问题。我的 BibTeX, Version 0.99d (MiKTeX 2.9.6500),是在 MiKTeX 的包管理器里最新安装的最新版。

        补充:更为奇怪的是,RStudio - New Files - Rmarkdown - From Template,选个 rticle 模板,里面的 yaml 都是带 .bib 扩展名的,编译出来的 pdf 参考文献却是正常的。所以我彻底糊涂了。

          Cloud2016 1. 这个问题有点复杂,不是三两分钟能搞定的事,我得再花点时间。关键是 texmf-var/fonts/conf/texlive-fontconfig.conf 里面的路径不对。

          1. 除非你安装了 LaTeX 包 latexmk 以及 Perl,否则 tinytex::latexmk() 应该会按你说的顺序执行。

          dapengde 是不是我仍然没说清楚……首先,不能加 .bib 扩展名是 MiKTeX 中的 bibtex 造成的坑(如果你说你的参考文献库是 foo,那么它就会去找 foo.bib;如果你说是 foo.bib,那么它就会……去找 foo.bib.bib;总之它是坚持一定要在你给的文件名后面再多加一个 .bib;蠢成这样,就问你想不想杀了它……可能也是聪明反被聪明误),这个坑本不应该存在;其次,因为这个坑已经存在多年(仅存在于 MiKTeX 中;因为 CTeX 本质是 MiKTeX 加一些杂七杂八的套件,所以 CTeX 也继承了这个坑),我在 tinytex R 包中已经把它填了;关键问题是有且仅有 tinytex R 包的 latexmk() 函数默默填了这个坑。只要你用 MiKTeX 或者 CTeX,就只能依赖 tinytex 去编译带参考文献的文档。如果是 R Markdown 文档,那么所有你需要做的就是安装那个 feature/tinytex 分支(这个分支会合并到下一个 rmarkdown 版本中)。TinyTeX 本质是 TeX Live,这个坑不存在,你装不装它,都不影响参考文献的编译。当然我是推荐你装它,因为它是跨平台的,省得一天到晚操心在不同系统下到底加不加 .bib 扩展名。

          你引的示例1说的并不是说 \bibliography{} 中不能加 .bib 扩展名,而是运行 bibtex 命令行时可以不加 .aux 扩展名。 这是由于 bibtex foobibtex foo.aux 通常是等价的。

          我刚更新了一下 tinytex R 包,如果检测到参考文献编不出来,就会自动打印出详细的错误信息。你可以再试试:

          devtools::install_github(
            c("yihui/tinytex", "rstudio/rmarkdown@feature/tinytex")
          )

          看到底具体的错误信息是什么。

            Cloud2016 字体问题我搞明白了,卸载再重装 xetex 包应该就好了:

            library(tinytex)
            tlmgr_remove('xetex'); tlmgr_install('xetex')

            如果要改变安装路径,最好是一开始就直接把路径传给 install_tinytex() 函数:

            tinytex::install_tinytex(dir = "D:\\TinyTeX")

            当然,既然你已经装好了,就没必要再重新折腾一遍了,按我前面说的重装 xetex 包就够了。

            另外,sourcesanspro 等包的正确使用姿势貌似应该是 \usepackage{} 而不是 \setmainfont{},如:

            \usepackage[default]{sourcesanspro}

            或者相应的 R Markdown:

            output:
              pdf_document:
                latex_engine: xelatex
                extra_dependencies:
                  sourcesanspro: default

            还有,编译 .tex 文件的时候用具体的 tinytex::xelatex() 函数就可以了,不必打冗长的 latexmk(...)

              Cloud2016 太好了,这下只剩下唯一一个疑案了,就是 @dapengde 在 CTeX 下为啥编不出参考文献来。实在不行我就只能用最后一招了,远程桌面现场侦查……

                yihui 发现一个很奇怪的现象:

                我在 Rmd 源文档中写下如下代码块

                '鸢尾花数据的散点图'

                Knitr + XeLaTeX 编译后出来的效果却是
                cjkengspace
                '和 之间冒出来多余的空格,不知道怎么处理?

                  Cloud2016 这是 ctex 包(注意我说的是包,不是 CTeX 套装)的默认行为:英文和中文字符之间默认加空格。显然在代码块中不能自动加空格,但 ctex 没有这么智能。我应该曾经找到过解决办法,但年代太久远,我也不知道放哪儿了。你终于踩到了一个我觉得还有点挑战性的坑,哈哈。

                    yihui 这几天在折腾自己学校的硕士学位论文模板,又发现个问题 <https://github.com/yihui/bookdown-chinese/issues/9>,后来模板走 ctexart类 和 rticles::ctex 路线,绕开了,我发现这个问题同样影响 bookdownplus 但是@dapengde 很聪明地将标题和作者都转为英文,而其他部分是中文,这样警告就没有了,我测试的模板是article_zh

                      Cloud2016 那个 #9 问题可以忽略之,只是一个无碍的警告信息,可能是 RStudio 在 Windows 下的某个缺陷。

                        上周出差了,没来得及最终安装一下,今天安装出问题了,fedora27 的结果如下:

                        tinytex::install_tinytex()
                        
                        #### 省略下载信息,省得看着太累,报错为:
                        
                        2017-12-17 17:42:15 (563 KB/s) - 已保存 “install-tl-unx.tar.gz” [4031343/4031343])
                        
                        Automated TeX Live installation using profile: ../texlive.profile
                        Loading http://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb
                        ../install-tl-20171216/install-tl: checksum error when downloading /tmp/MX4YXw8BH2/RAXktNrP2d from http://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb: digest disagree
                        rm: 无法删除'install-tl.log': No such file or directory
                        sh: 第 25 行:cd: bin/*: No such file or directory
                        sh:行26: ./tlmgr: No such file or directory
                        mv: 无法获取'texlive/*' 的文件状态(stat): No such file or directory
                        install-unx.sh:行24: /home/lovebluesky/.TinyTeX/bin/*/tlmgr: No such file or directory
                        install-unx.sh:行31: /home/lovebluesky/.TinyTeX/bin/*/tlmgr: No such file or directory
                        Warning message:
                        In tinytex::install_tinytex() :
                          TinyTeX was not successfully installed or configured.

                          yihui 在CentOS7 下测试TinyTeX的报告:
                          1. 使用默认方式安装 R

                          yum install epel-release
                          yum install -y R

                          这种方式顺带安装了不少 tex包,

                           texinfo               x86_64 5.1-4.el7                           base    961 k
                           texinfo-tex           x86_64 5.1-4.el7                           base    146 k
                           texlive-ae            noarch 2:svn15878.1.4-38.el7               base     95 k
                           texlive-algorithms    noarch 2:svn15878.0.1-38.el7               base     21 k
                           texlive-amscls        noarch 2:svn29207.0-38.el7                 base     53 k
                           texlive-amsfonts      noarch 2:svn29208.3.04-38.el7              base    3.6 M
                           texlive-amsmath       noarch 2:svn29327.2.14-38.el7              base     49 k
                           texlive-anysize       noarch 2:svn15878.0-38.el7                 base     18 k
                           texlive-attachfile    noarch 2:svn21866.v1.5b-38.el7             base     21 k
                           texlive-avantgar      noarch 2:svn28614.0-38.el7                 base    291 k
                           texlive-babel         noarch 2:svn24756.3.8m-38.el7              base    129 k
                           texlive-babelbib      noarch 2:svn25245.1.31-38.el7              base     49 k
                           texlive-base          noarch 2:2012-38.20130427_r30134.el7       base    325 k
                           texlive-beamer        noarch 2:svn29349.3.26-38.el7              base    242 k
                           texlive-bera          noarch 2:svn20031.0-38.el7                 base    347 k
                           texlive-beton         noarch 2:svn15878.0-38.el7                 base     18 k
                           texlive-bibtex        noarch 2:svn26689.0.99d-38.el7             base     33 k
                           texlive-bibtex-bin    x86_64 2:svn26509.0-38.20130427_r30134.el7 base     65 k
                           texlive-bookman       noarch 2:svn28614.0-38.el7                 base    332 k
                           texlive-booktabs      noarch 2:svn15878.1.61803-38.el7           base     19 k
                           texlive-breakurl      noarch 2:svn15878.1.30-38.el7              base     20 k
                           texlive-caption       noarch 2:svn29026.3.3__2013_02_03_-38.el7  base     51 k
                           texlive-carlisle      noarch 2:svn18258.0-38.el7                 base     29 k
                           texlive-charter       noarch 2:svn15878.0-38.el7                 base    201 k
                           texlive-chngcntr      noarch 2:svn17157.1.0a-38.el7              base     19 k
                           texlive-cite          noarch 2:svn19955.5.3-38.el7               base     42 k
                           texlive-cm            noarch 2:svn29581.0-38.el7                 base    291 k
                           texlive-cm-super      noarch 2:svn15878.0-38.el7                 base     62 M
                           texlive-cmap          noarch 2:svn26568.0-38.el7                 base     23 k
                           texlive-cmextra       noarch 2:svn14075.0-38.el7                 base     31 k
                           texlive-collection-basic
                                                 noarch 2:svn26314.0-38.20130427_r30134.el7 base     16 k
                           texlive-collection-documentation-base
                                                 noarch 2:svn17091.0-38.20130427_r30134.el7 base     16 k
                           texlive-collection-fontsrecommended
                                                 noarch 2:svn28082.0-38.20130427_r30134.el7 base     16 k
                           texlive-collection-latex
                                                 noarch 2:svn25030.0-38.20130427_r30134.el7 base     16 k
                           texlive-collection-latexrecommended
                                                 noarch 2:svn25795.0-38.20130427_r30134.el7 base     17 k
                           texlive-colortbl      noarch 2:svn25394.v1.0a-38.el7             base     20 k
                           texlive-courier       noarch 2:svn28614.0-38.el7                 base    542 k
                           texlive-crop          noarch 2:svn15878.1.5-38.el7               base     22 k
                           texlive-csquotes      noarch 2:svn24393.5.1d-38.el7              base     36 k
                           texlive-ctable        noarch 2:svn26694.1.23-38.el7              base     20 k
                           texlive-currfile      noarch 2:svn29012.0.7b-38.el7              base     21 k
                           texlive-dvipdfm       noarch 2:svn26689.0.13.2d-38.el7           base     23 k
                           texlive-dvipdfm-bin   noarch 2:svn13663.0-38.20130427_r30134.el7 base     18 k
                           texlive-dvipdfmx      noarch 2:svn26765.0-38.el7                 base     53 k
                           texlive-dvipdfmx-bin  x86_64 2:svn26509.0-38.20130427_r30134.el7 base    278 k
                           texlive-dvipdfmx-def  noarch 2:svn15878.0-38.el7                 base     19 k
                           texlive-dvips         noarch 2:svn29585.0-38.el7                 base    217 k
                           texlive-dvips-bin     x86_64 2:svn26509.0-38.20130427_r30134.el7 base    129 k
                           texlive-ec            noarch 2:svn25033.1.0-38.el7               base    467 k
                           texlive-enctex        noarch 2:svn28602.0-38.el7                 base     47 k
                           texlive-enumitem      noarch 2:svn24146.3.5.2-38.el7             base     29 k
                           texlive-epsf          noarch 2:svn21461.2.7.4-38.el7             base     25 k
                           texlive-eso-pic       noarch 2:svn21515.2.0c-38.el7              base     21 k
                           texlive-etex          noarch 2:svn22198.2.1-38.el7               base     32 k
                           texlive-etex-pkg      noarch 2:svn15878.2.0-38.el7               base     22 k
                           texlive-etoolbox      noarch 2:svn20922.2.1-38.el7               base     25 k
                           texlive-euler         noarch 2:svn17261.2.5-38.el7               base     20 k
                           texlive-euro          noarch 2:svn22191.1.1-38.el7               base     19 k
                           texlive-eurosym       noarch 2:svn17265.1.4_subrfix-38.el7       base    158 k
                           texlive-extsizes      noarch 2:svn17263.1.4a-38.el7              base     30 k
                           texlive-fancybox      noarch 2:svn18304.1.4-38.el7               base     25 k
                           texlive-fancyhdr      noarch 2:svn15878.3.1-38.el7               base     26 k
                           texlive-fancyref      noarch 2:svn15878.0.9c-38.el7              base     20 k
                           texlive-fancyvrb      noarch 2:svn18492.2.8-38.el7               base     30 k
                           texlive-filecontents  noarch 2:svn24250.1.3-38.el7               base     19 k
                           texlive-filehook      noarch 2:svn24280.0.5d-38.el7              base     22 k
                           texlive-fix2col       noarch 2:svn17133.0-38.el7                 base     19 k
                           texlive-float         noarch 2:svn15878.1.3d-38.el7              base     20 k
                           texlive-fontspec      noarch 2:svn29412.v2.3a-38.el7             base     38 k
                           texlive-footmisc      noarch 2:svn23330.5.5b-38.el7              base     23 k
                           texlive-fp            noarch 2:svn15878.0-38.el7                 base     39 k
                           texlive-fpl           noarch 2:svn15878.1.002-38.el7             base    376 k
                           texlive-geometry      noarch 2:svn19716.5.6-38.el7               base     26 k
                           texlive-glyphlist     noarch 2:svn28576.0-38.el7                 base     43 k
                           texlive-graphics      noarch 2:svn25405.1.0o-38.el7              base     33 k
                           texlive-gsftopk       noarch 2:svn26689.1.19.2-38.el7            base     24 k
                           texlive-gsftopk-bin   x86_64 2:svn26509.0-38.20130427_r30134.el7 base     30 k
                           texlive-helvetic      noarch 2:svn28614.0-38.el7                 base    614 k
                           texlive-hyperref      noarch 2:svn28213.6.83m-38.el7             base    139 k
                           texlive-hyph-utf8     noarch 2:svn29641.0-38.el7                 base    2.2 M
                           texlive-hyphen-base   noarch 2:svn29197.0-38.el7                 base     39 k
                           texlive-ifetex        noarch 2:svn24853.1.2-38.el7               base     18 k
                           texlive-ifluatex      noarch 2:svn26725.1.3-38.el7               base     19 k
                           texlive-ifxetex       noarch 2:svn19685.0.5-38.el7               base     18 k
                           texlive-index         noarch 2:svn24099.4.1beta-38.el7           base     29 k
                           texlive-jknapltx      noarch 2:svn19440.0-38.el7                 base     28 k
                           texlive-kastrup       noarch 2:svn15878.0-38.el7                 base     18 k
                           texlive-koma-script   noarch 2:svn27255.3.11b-38.el7             base    5.1 M
                           texlive-kpathsea      noarch 2:svn28792.0-38.el7                 base    140 k
                           texlive-kpathsea-bin  x86_64 2:svn27347.0-38.20130427_r30134.el7 base     40 k
                           texlive-kpathsea-lib  x86_64 2:2012-38.20130427_r30134.el7       base     78 k
                           texlive-l3experimental
                                                 noarch 2:svn29361.SVN_4467-38.el7          base     56 k
                           texlive-l3kernel      noarch 2:svn29409.SVN_4469-38.el7          base    107 k
                           texlive-l3packages    noarch 2:svn29361.SVN_4467-38.el7          base     36 k
                           texlive-latex         noarch 2:svn27907.0-38.el7                 base    197 k
                           texlive-latex-bin     noarch 2:svn26689.0-38.el7                 base     20 k
                           texlive-latex-bin-bin noarch 2:svn14050.0-38.20130427_r30134.el7 base     17 k
                           texlive-latex-fonts   noarch 2:svn28888.0-38.el7                 base     42 k
                           texlive-latexconfig   noarch 2:svn28991.0-38.el7                 base     26 k
                           texlive-listings      noarch 2:svn15878.1.4-38.el7               base    138 k
                           texlive-lm            noarch 2:svn28119.2.004-38.el7             base     13 M
                           texlive-lm-math       noarch 2:svn29044.1.958-38.el7             base    426 k
                           texlive-ltxmisc       noarch 2:svn21927.0-38.el7                 base     34 k
                           texlive-lua-alt-getopt
                                                 noarch 2:svn29349.0.7.0-38.el7             base     19 k
                           texlive-lualatex-math noarch 2:svn29346.1.2-38.el7               base     21 k
                           texlive-luaotfload    noarch 2:svn26718.1.26-38.el7              base    101 k
                           texlive-luaotfload-bin
                                                 noarch 2:svn18579.0-38.20130427_r30134.el7 base     17 k
                           texlive-luatex        noarch 2:svn26689.0.70.1-38.el7            base     37 k
                           texlive-luatex-bin    x86_64 2:svn26912.0-38.20130427_r30134.el7 base    1.7 M
                           texlive-luatexbase    noarch 2:svn22560.0.31-38.el7              base     27 k
                           texlive-makeindex     noarch 2:svn26689.2.12-38.el7              base     30 k
                           texlive-makeindex-bin x86_64 2:svn26509.0-38.20130427_r30134.el7 base     38 k
                           texlive-marginnote    noarch 2:svn25880.v1.1i-38.el7             base     20 k
                           texlive-marvosym      noarch 2:svn29349.2.2a-38.el7              base    151 k
                           texlive-mathpazo      noarch 2:svn15878.1.003-38.el7             base     84 k
                           texlive-mdwtools      noarch 2:svn15878.1.05.4-38.el7            base     38 k
                           texlive-memoir        noarch 2:svn21638.3.6j_patch_6.0g-38.el7   base     97 k
                           texlive-metafont      noarch 2:svn26689.2.718281-38.el7          base     63 k
                           texlive-metafont-bin  x86_64 2:svn26912.0-38.20130427_r30134.el7 base    185 k
                           texlive-metalogo      noarch 2:svn18611.0.12-38.el7              base     19 k
                           texlive-mflogo        noarch 2:svn17487.0-38.el7                 base     43 k
                           texlive-mfnfss        noarch 2:svn19410.0-38.el7                 base     20 k
                           texlive-mfware        noarch 2:svn26689.0-38.el7                 base     31 k
                           texlive-mfware-bin    x86_64 2:svn26509.0-38.20130427_r30134.el7 base     89 k
                           texlive-mh            noarch 2:svn29420.0-38.el7                 base     61 k
                           texlive-microtype     noarch 2:svn29392.2.5-38.el7               base     67 k
                           texlive-misc          noarch 2:svn24955.0-38.el7                 base     67 k
                           texlive-mparhack      noarch 2:svn15878.1.4-38.el7               base     20 k
                           texlive-mptopdf       noarch 2:svn26689.0-38.el7                 base     58 k
                           texlive-mptopdf-bin   noarch 2:svn18674.0-38.20130427_r30134.el7 base     17 k
                           texlive-ms            noarch 2:svn24467.0-38.el7                 base     24 k
                           texlive-multido       noarch 2:svn18302.1.42-38.el7              base     21 k
                           texlive-natbib        noarch 2:svn20668.8.31b-38.el7             base     35 k
                           texlive-ncntrsbk      noarch 2:svn28614.0-38.el7                 base    338 k
                           texlive-ntgclass      noarch 2:svn15878.0-38.el7                 base     35 k
                           texlive-oberdiek      noarch 2:svn26725.0-38.el7                 base    307 k
                           texlive-palatino      noarch 2:svn28614.0-38.el7                 base    384 k
                           texlive-paralist      noarch 2:svn15878.2.3b-38.el7              base     21 k
                           texlive-parallel      noarch 2:svn15878.0-38.el7                 base     21 k
                           texlive-parskip       noarch 2:svn19963.2.0-38.el7               base     19 k
                           texlive-pdfpages      noarch 2:svn27574.0.4t-38.el7              base     31 k
                           texlive-pdftex        noarch 2:svn29585.1.40.11-38.el7           base    140 k
                           texlive-pdftex-bin    x86_64 2:svn27321.0-38.20130427_r30134.el7 base    360 k
                           texlive-pdftex-def    noarch 2:svn22653.0.06d-38.el7             base     31 k
                           texlive-pgf           noarch 2:svn22614.2.10-38.el7              base    468 k
                           texlive-plain         noarch 2:svn26647.0-38.el7                 base     63 k
                           texlive-powerdot      noarch 2:svn25656.1.4i-38.el7              base     48 k
                           texlive-psfrag        noarch 2:svn15878.3.04-38.el7              base     21 k
                           texlive-pslatex       noarch 2:svn16416.0-38.el7                 base     24 k
                           texlive-psnfss        noarch 2:svn23394.9.2a-38.el7              base     45 k
                           texlive-pspicture     noarch 2:svn15878.0-38.el7                 base     19 k
                           texlive-pst-3d        noarch 2:svn17257.1.10-38.el7              base     21 k
                           texlive-pst-blur      noarch 2:svn15878.2.0-38.el7               base     19 k
                           texlive-pst-coil      noarch 2:svn24020.1.06-38.el7              base     21 k
                           texlive-pst-eps       noarch 2:svn15878.1.0-38.el7               base     20 k
                           texlive-pst-fill      noarch 2:svn15878.1.01-38.el7              base     21 k
                           texlive-pst-grad      noarch 2:svn15878.1.06-38.el7              base     21 k
                           texlive-pst-math      noarch 2:svn20176.0.61-38.el7              base     22 k
                           texlive-pst-node      noarch 2:svn27799.1.25-38.el7              base     40 k
                           texlive-pst-plot      noarch 2:svn28729.1.44-38.el7              base     36 k
                           texlive-pst-slpe      noarch 2:svn24391.1.31-38.el7              base     21 k
                           texlive-pst-text      noarch 2:svn15878.1.00-38.el7              base     21 k
                           texlive-pst-tree      noarch 2:svn24142.1.12-38.el7              base     24 k
                           texlive-pstricks      noarch 2:svn29678.2.39-38.el7              base     97 k
                           texlive-pstricks-add  noarch 2:svn28750.3.59-38.el7              base     41 k
                           texlive-pxfonts       noarch 2:svn15878.0-38.el7                 base    497 k
                           texlive-qstest        noarch 2:svn15878.0-38.el7                 base     22 k
                           texlive-rcs           noarch 2:svn15878.0-38.el7                 base     30 k
                           texlive-rotating      noarch 2:svn16832.2.16b-38.el7             base     20 k
                           texlive-rsfs          noarch 2:svn15878.0-38.el7                 base     75 k
                           texlive-sansmath      noarch 2:svn17997.1.1-38.el7               base     20 k
                           texlive-sauerj        noarch 2:svn15878.0-38.el7                 base     23 k
                           texlive-section       noarch 2:svn20180.0-38.el7                 base     27 k
                           texlive-seminar       noarch 2:svn18322.1.5-38.el7               base     43 k
                           texlive-sepnum        noarch 2:svn20186.2.0-38.el7               base     20 k
                           texlive-setspace      noarch 2:svn24881.6.7a-38.el7              base     24 k
                           texlive-showexpl      noarch 2:svn27790.v0.3j-38.el7             base     21 k
                           texlive-soul          noarch 2:svn15878.2.4-38.el7               base     23 k
                           texlive-subfig        noarch 2:svn15878.1.3-38.el7               base     24 k
                           texlive-symbol        noarch 2:svn28614.0-38.el7                 base     55 k
                           texlive-tetex         noarch 2:svn29585.3.0-38.el7               base     88 k
                           texlive-tetex-bin     noarch 2:svn27344.0-38.20130427_r30134.el7 base     18 k
                           texlive-tex           noarch 2:svn26689.3.1415926-38.el7         base     23 k
                           texlive-tex-bin       x86_64 2:svn26912.0-38.20130427_r30134.el7 base    171 k
                           texlive-tex-gyre      noarch 2:svn18651.2.004-38.el7             base    7.0 M
                           texlive-tex-gyre-math noarch 2:svn29045.0-38.el7                 base    582 k
                           texlive-texconfig     noarch 2:svn29349.0-38.el7                 base     32 k
                           texlive-texconfig-bin noarch 2:svn27344.0-38.20130427_r30134.el7 base     17 k
                           texlive-texlive.infra noarch 2:svn28217.0-38.el7                 base    137 k
                           texlive-texlive.infra-bin
                                                 x86_64 2:svn22566.0-38.20130427_r30134.el7 base     16 k
                           texlive-textcase      noarch 2:svn15878.0-38.el7                 base     18 k
                           texlive-thumbpdf      noarch 2:svn26689.3.15-38.el7              base     38 k
                           texlive-thumbpdf-bin  noarch 2:svn6898.0-38.20130427_r30134.el7  base     17 k
                           texlive-times         noarch 2:svn28614.0-38.el7                 base    388 k
                           texlive-tipa          noarch 2:svn29349.1.3-38.el7               base    2.8 M
                           texlive-tools         noarch 2:svn26263.0-38.el7                 base     62 k
                           texlive-txfonts       noarch 2:svn15878.0-38.el7                 base    768 k
                           texlive-type1cm       noarch 2:svn21820.0-38.el7                 base     19 k
                           texlive-typehtml      noarch 2:svn17134.0-38.el7                 base     24 k
                           texlive-ucs           noarch 2:svn27549.2.1-38.el7               base    360 k
                           texlive-underscore    noarch 2:svn18261.0-38.el7                 base     22 k
                           texlive-unicode-math  noarch 2:svn29413.0.7d-38.el7              base     61 k
                           texlive-url           noarch 2:svn16864.3.2-38.el7               base     26 k
                           texlive-utopia        noarch 2:svn15878.0-38.el7                 base    233 k
                           texlive-varwidth      noarch 2:svn24104.0.92-38.el7              base     21 k
                           texlive-wasy          noarch 2:svn15878.0-38.el7                 base    256 k
                           texlive-wasysym       noarch 2:svn15878.2.0-38.el7               base     21 k
                           texlive-xcolor        noarch 2:svn15878.2.11-38.el7              base     35 k
                           texlive-xdvi          noarch 2:svn26689.22.85-38.el7             base     60 k
                           texlive-xdvi-bin      x86_64 2:svn26509.0-38.20130427_r30134.el7 base    278 k
                           texlive-xkeyval       noarch 2:svn27995.2.6a-38.el7              base     27 k
                           texlive-xunicode      noarch 2:svn23897.0.981-38.el7             base     44 k
                           texlive-zapfchan      noarch 2:svn28614.0-38.el7                 base    102 k
                           texlive-zapfding      noarch 2:svn28614.0-38.el7                 base     65 k

                          tex 安装的位置和版本如下

                          > which tex
                          /usr/bin/tex
                          > tex -v
                          TeX 3.1415926 (TeX Live 2013)
                          kpathsea version 6.1.1
                          Copyright 2013 D.E. Knuth.
                          There is NO warranty.  Redistribution of this software is
                          covered by the terms of both the TeX copyright and
                          the Lesser GNU General Public License.
                          For more information about these matters, see the file
                          named COPYING and the TeX source.
                          Primary author of TeX: D.E. Knuth.
                          1. 安装 tinytex
                          install.packages("tinytex")
                          Installing package into ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.4’
                          (as ‘lib’ is unspecified)
                          试开URL’https://cran.rstudio.com/src/contrib/tinytex_0.1.tar.gz'
                          Content type 'application/x-gzip' length 12812 bytes (12 KB)
                          ==================================================
                          downloaded 12 KB
                          
                          * installing *source* package ‘tinytex’ ...
                          ** 成功将‘tinytex’程序包解包并MD5和检查
                          ** R
                          ** preparing package for lazy loading
                          ** help
                          *** installing help indices
                            converting help for package ‘tinytex’
                              finding HTML links ...    install_tinytex                         html   好了
                          
                              latexmk                                 html  
                              parse_packages                          html  
                              r_texmf                                 html  
                              tlmgr                                   html  
                          ** building package indices
                          ** testing if installed package can be loaded
                          * DONE (tinytex)
                          
                          The downloaded source packages are in
                          	‘/tmp/Rtmpit3F1C/downloaded_packages’

                          TinyTeX 安装记录

                          > tinytex::install_tinytex()
                          试开URL’https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh'
                          Content type 'text/plain; charset=utf-8' length 758 bytes
                          ==================================================
                          downloaded 758 bytes
                          
                          Downloading install-tl-unx.tar.gz to /tmp ...
                          --2017-12-18 11:10:36--  http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
                          正在解析主机 mirror.ctan.org (mirror.ctan.org)... 176.28.54.184, 2a01:488:67:1000:b01c:36b8:0:1
                          正在连接 mirror.ctan.org (mirror.ctan.org)|176.28.54.184|:80... 已连接。
                          已发出 HTTP 请求,正在等待回应... 302 Found
                          位置:http://mirrors.ustc.edu.cn/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz [跟随至新的 URL]
                          --2017-12-18 11:10:36--  http://mirrors.ustc.edu.cn/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
                          正在解析主机 mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)... 202.38.95.110, 2001:da8:d800:95::110
                          正在连接 mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)|202.38.95.110|:80... 已连接。
                          已发出 HTTP 请求,正在等待回应... 200 OK
                          长度:4031401 (3.8M) [application/gzip]
                          正在保存至: “install-tl-unx.tar.gz”
                          
                               0K .......... .......... .......... .......... ..........  1%  158K 25s
                              50K .......... .......... .......... .......... ..........  2% 1.84M 13s
                             100K .......... .......... .......... .......... ..........  3% 1.67M 9s
                             150K .......... .......... .......... .......... ..........  5% 5.54M 7s
                             200K .......... .......... .......... .......... ..........  6% 5.45M 6s
                             250K .......... .......... .......... .......... ..........  7% 4.58M 5s
                             300K .......... .......... .......... .......... ..........  8% 6.19M 4s
                             350K .......... .......... .......... .......... .......... 10% 8.26M 4s
                             400K .......... .......... .......... .......... .......... 11% 9.19M 3s
                             450K .......... .......... .......... .......... .......... 12% 1.09M 3s
                             500K .......... .......... .......... .......... .......... 13% 16.1M 3s
                             550K .......... .......... .......... .......... .......... 15% 9.69M 3s
                             600K .......... .......... .......... .......... .......... 16% 11.1M 2s
                             650K .......... .......... .......... .......... .......... 17% 10.2M 2s
                             700K .......... .......... .......... .......... .......... 19% 22.4M 2s
                             750K .......... .......... .......... .......... .......... 20% 11.7M 2s
                             800K .......... .......... .......... .......... .......... 21% 21.3M 2s
                             850K .......... .......... .......... .......... .......... 22% 7.88M 2s
                             900K .......... .......... .......... .......... .......... 24% 10.4M 2s
                             950K .......... .......... .......... .......... .......... 25% 26.2M 1s
                            1000K .......... .......... .......... .......... .......... 26% 6.99M 1s
                            1050K .......... .......... .......... .......... .......... 27% 5.19M 1s
                            1100K .......... .......... .......... .......... .......... 29% 2.21M 1s
                            1150K .......... .......... .......... .......... .......... 30% 2.48M 1s
                            1200K .......... .......... .......... .......... .......... 31%  445K 1s
                            1250K .......... .......... .......... .......... .......... 33% 40.7M 1s
                            1300K .......... .......... .......... .......... .......... 34%  358M 1s
                            1350K .......... .......... .......... .......... .......... 35% 23.5M 1s
                            1400K .......... .......... .......... .......... .......... 36% 4.18M 1s
                            1450K .......... .......... .......... .......... .......... 38% 3.68M 1s
                            1500K .......... .......... .......... .......... .......... 39% 4.41M 1s
                            1550K .......... .......... .......... .......... .......... 40% 2.44M 1s
                            1600K .......... .......... .......... .......... .......... 41% 2.22M 1s
                            1650K .......... .......... .......... .......... .......... 43% 2.45M 1s
                            1700K .......... .......... .......... .......... .......... 44% 2.25M 1s
                            1750K .......... .......... .......... .......... .......... 45% 2.28M 1s
                            1800K .......... .......... .......... .......... .......... 46%  663K 1s
                            1850K .......... .......... .......... .......... .......... 48%  491M 1s
                            1900K .......... .......... .......... .......... .......... 49%  532M 1s
                            1950K .......... .......... .......... .......... .......... 50% 1.72M 1s
                            2000K .......... .......... .......... .......... .......... 52% 11.1M 1s
                            2050K .......... .......... .......... .......... .......... 53% 2.44M 1s
                            2100K .......... .......... .......... .......... .......... 54% 2.19M 1s
                            2150K .......... .......... .......... .......... .......... 55% 2.30M 1s
                            2200K .......... .......... .......... .......... .......... 57% 2.24M 1s
                            2250K .......... .......... .......... .......... .......... 58% 2.44M 1s
                            2300K .......... .......... .......... .......... .......... 59%  622K 1s
                            2350K .......... .......... .......... .......... .......... 60%  673M 1s
                            2400K .......... .......... .......... .......... .......... 62% 7.69M 1s
                            2450K .......... .......... .......... .......... .......... 63% 2.39M 1s
                            2500K .......... .......... .......... .......... .......... 64% 9.60M 1s
                            2550K .......... .......... .......... .......... .......... 66% 3.15M 1s
                            2600K .......... .......... .......... .......... .......... 67% 2.34M 1s
                            2650K .......... .......... .......... .......... .......... 68% 2.21M 1s
                            2700K .......... .......... .......... .......... .......... 69% 2.18M 1s
                            2750K .......... .......... .......... .......... .......... 71% 2.45M 1s
                            2800K .......... .......... .......... .......... .......... 72%  632K 1s
                            2850K .......... .......... .......... .......... .......... 73% 18.2M 0s
                            2900K .......... .......... .......... .......... .......... 74% 22.6M 0s
                            2950K .......... .......... .......... .......... .......... 76% 2.13M 0s
                            3000K .......... .......... .......... .......... .......... 77% 4.44M 0s
                            3050K .......... .......... .......... .......... .......... 78% 3.66M 0s
                            3100K .......... .......... .......... .......... .......... 80% 2.65M 0s
                            3150K .......... .......... .......... .......... .......... 81% 2.30M 0s
                            3200K .......... .......... .......... .......... .......... 82% 2.20M 0s
                            3250K .......... .......... .......... .......... .......... 83% 2.21M 0s
                            3300K .......... .......... .......... .......... .......... 85% 2.46M 0s
                            3350K .......... .......... .......... .......... .......... 86% 2.30M 0s
                            3400K .......... .......... .......... .......... .......... 87% 2.14M 0s
                            3450K .......... .......... .......... .......... .......... 88% 2.31M 0s
                            3500K .......... .......... .......... .......... .......... 90% 2.33M 0s
                            3550K .......... .......... .......... .......... .......... 91% 2.36M 0s
                            3600K .......... .......... .......... .......... .......... 92% 2.09M 0s
                            3650K .......... .......... .......... .......... .......... 93% 2.33M 0s
                            3700K .......... .......... .......... .......... .......... 95% 2.48M 0s
                            3750K .......... .......... .......... .......... .......... 96% 2.29M 0s
                            3800K .......... .......... .......... .......... .......... 97% 2.14M 0s
                            3850K .......... .......... .......... .......... .......... 99% 2.42M 0s
                            3900K .......... .......... .......... ......               100% 2.25M=1.7s
                          
                          2017-12-18 11:10:38 (2.22 MB/s) - 已保存 “install-tl-unx.tar.gz” [4031401/4031401])
                          
                          Can't locate Digest/MD5.pm in @INC (@INC contains: ../install-tl-20171217/tlpkg /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ../install-tl-20171217/tlpkg/TeXLive/TLCrypto.pm line 9.
                          BEGIN failed--compilation aborted at ../install-tl-20171217/tlpkg/TeXLive/TLCrypto.pm line 9.
                          Compilation failed in require at ../install-tl-20171217/tlpkg/TeXLive/TLPOBJ.pm line 16.
                          BEGIN failed--compilation aborted at ../install-tl-20171217/tlpkg/TeXLive/TLPOBJ.pm line 16.
                          Compilation failed in require at ../install-tl-20171217/install-tl line 55.
                          BEGIN failed--compilation aborted at ../install-tl-20171217/install-tl line 55.
                          rm: 无法删除"install-tl.log": 没有那个文件或目录
                          sh: 第 25 行:cd: bin/*: 没有那个文件或目录
                          sh:行26: ./tlmgr: 没有那个文件或目录
                          mv: 无法获取"texlive/*" 的文件状态(stat): 没有那个文件或目录
                          install-unx.sh:行24: /home/rstudio/.TinyTeX/bin/*/tlmgr: 没有那个文件或目录
                          install-unx.sh:行31: /home/rstudio/.TinyTeX/bin/*/tlmgr: 没有那个文件或目录
                          Warning message:
                          In tinytex::install_tinytex() :
                            TinyTeX was not successfully installed or configured.
                          1. 相关软件 Rperl
                          devtools::session_info()
                          Session info ---------------------------------------------------------------------
                           setting  value                       
                           version  R version 3.4.2 (2017-09-28)
                           system   x86_64, linux-gnu           
                           ui       RStudio (1.1.383)           
                           language (EN)                        
                           collate  zh_CN.UTF-8                 
                           tz       Asia/Shanghai               
                           date     2017-12-18                  
                          
                          Packages -------------------------------------------------------------------------
                           package   * version date       source        
                           backports   1.1.2   2017-12-13 CRAN (R 3.4.2)
                           base      * 3.4.2   2017-10-30 local         
                           compiler    3.4.2   2017-10-30 local         
                           datasets  * 3.4.2   2017-10-30 local         
                           devtools    1.13.4  2017-11-09 CRAN (R 3.4.2)
                           digest      0.6.13  2017-12-14 CRAN (R 3.4.2)
                           evaluate    0.10.1  2017-06-24 CRAN (R 3.4.2)
                           graphics  * 3.4.2   2017-10-30 local         
                           grDevices * 3.4.2   2017-10-30 local         
                           htmltools   0.3.6   2017-04-28 CRAN (R 3.4.2)
                           knitr       1.17    2017-08-10 CRAN (R 3.4.2)
                           magrittr    1.5     2014-11-22 CRAN (R 3.4.2)
                           memoise     1.1.0   2017-04-21 CRAN (R 3.4.2)
                           methods   * 3.4.2   2017-10-30 local         
                           Rcpp        0.12.14 2017-11-23 CRAN (R 3.4.2)
                           rmarkdown   1.8     2017-11-17 CRAN (R 3.4.2)
                           rprojroot   1.2     2017-01-16 CRAN (R 3.4.2)
                           stats     * 3.4.2   2017-10-30 local         
                           stringi     1.1.6   2017-11-17 CRAN (R 3.4.2)
                           stringr     1.2.0   2017-02-18 CRAN (R 3.4.2)
                           tinytex     0.1     2017-12-13 CRAN (R 3.4.2)
                           tools       3.4.2   2017-10-30 local         
                           utils     * 3.4.2   2017-10-30 local         
                           withr       2.1.0   2017-11-01 CRAN (R 3.4.2)
                           yaml        2.1.16  2017-12-12 CRAN (R 3.4.2)
                          
                          > which perl
                          /usr/bin/perl
                          
                          > perl -v
                          
                          This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
                          (with 33 registered patches, see perl -V for more detail)
                          
                          Copyright 1987-2012, Larry Wall
                          
                          Perl may be copied only under the terms of either the Artistic License or the
                          GNU General Public License, which may be found in the Perl 5 source kit.
                          
                          Complete documentation for Perl, including FAQ lists, should be found on
                          this system using "man perl" or "perldoc perl".  If you have access to the
                          Internet, point your browser at http://www.perl.org/, the Perl Home Page.

                            lovebluesky 这个错误我不太明白是什么原因引起的(校验失败),听起来像是下载不完整。你可以重试一下。当然最好是 TinyTeX 能够提供一个设置初始 CTAN 镜像地址的选项,目前只能自动选择,在你的机器上自动选择的是清华的镜像,我也不知道为什么下载校验失败了。

                            Cloud2016 关于自动安装那一坨 texlive-* 包的问题,我不知道 CentOS 下有没有跟 Debian/Ubuntu 下的 equivs-build 类似的工具,能让你欺骗 yum 叫它不要安装那一坨依赖。参见 FAQ 9:https://yihui.name/tinytex/faq/

                            至于 install_tinytex() 失败的问题,我看不懂这个错误消息。而且我只熟悉 Debian/Ubuntu,几乎没用过 CentOS。

                              yihui 我接触CentOS的时间也比较短,很多问题搞不清楚状况,比如如何安装 tlmgr,我甚至找不到 ctex 包 (如果不用 texlive 全家桶),中文字体更是个老大难的问题,写中文文档的初步探索结果见 rmd文件

                              BTW,我很看好rocker项目 <https://github.com/rocker-org/rocker/>,但是 eddelbuettel 对是否用 tlmgr 代替那一坨 texlive-*包不太感兴趣 #266 ,好像宁愿多花4个G,我总觉得Docker 太大不是件好事,可能外国人不用中文,关系不太大,我用VBox打包了一个虚拟机镜像放在百度云,分享链接: https://pan.baidu.com/s/1nv67anJ 密码: v3mr,用账户 cloud2016 密码 cloud登陆即可使用,功能上和rocker/tidyverse 差不多 <https://hub.docker.com/r/rocker/tidyverse/>

                                yihui 我重试过几次,一样的报错,另外,忘记讲了,看了一下 Cloud2016 的问题我才记起来,我 fedora 虽然是前一段时间新安装的,没有主动安装过 texlive,但在安装某些东西的时候也安装了一些 texlive 的东西,具体是什么我也记不清了,不知有没有关系。

                                  Cloud2016 那为啥还用 CentOS 呢?

                                  eddelbuettel 大人很瞧不起我的工作,对 Debian 有强烈的信仰,认为无知的我在重造无谓的轮子,不过他理不理解这件事我懒得操心,能有一部分群众觉得好就好了。Docker 要是太大,对我来说就失去了它最大的优势之一(轻便)。

                                  lovebluesky 我也不确定。如我前面所说,我对 CentOS 不熟,无法帮你,不行你就只能继续仰仗你的系统提供的那一大坨 TeX Live 包了。我只能帮 Debian/Ubuntu 用户。