晚上刷微博的时候,看到陈老师的微博发布一则消息: Ian Goodfellow 在 Github 和官网发布 deep learning 的 notation 源代码,恰好最近在用 bookdown 排论文,顺便用 bookdown 把这个 notation 包裹起来给大家。

Cloud2016 更改标题为「基于 bookdown 实现《deep learning》 的 notation 模板
22 天 后

bookdownplus 包的 'thesis_ubt' 模板里有 notation,跟这个类似,只是稍微简单一点。

devtools::install_github("pzhaonet/bookdownplus")
library('bookdownplus')
bookdownplus(template = 'thesis_ubt')

    dapengde 顺手测试了这个模板,报错了。粗看了模板文件template_thesis_ubt.tex,内容组织上建议模板归模版,版面样式归版面样式,内容归内容,都分开来,这样便于后期维护。虽然我没有了解 TeX 包之间的深深依赖,但是真的需要加载这么多TeX包吗?建议在 pandoc-template 基础上定制。

    日志如下:

    bookdownplus::bookdownplus(template = 'thesis_ubt')
    
    
    processing file: thesis_ubt.Rmd
      |.............                                                    |  20%
      ordinary text without R code
    
      |..........................                                       |  40%
    label: fig1 (with options) 
    List of 4
     $ fig.cap  : chr "caption"
     $ out.width: chr "80%"
     $ fig.align: chr "center"
     $ echo     : logi FALSE
    
      |.......................................                          |  60%
      ordinary text without R code
    
      |....................................................             |  80%
    label: tab1 (with options) 
    List of 2
     $ tidy: logi FALSE
     $ echo: logi FALSE
    
      |.................................................................| 100%
      ordinary text without R code
    
    
    output file: thesis_ubt.knit.md
    
    /usr/lib/rstudio-server/bin/pandoc/pandoc +RTS -K512m -RTS thesis_ubt.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_ubt.tex --table-of-contents --toc-depth 3 --template tex/template_thesis_ubt.tex --number-sections --highlight-style tango --latex-engine pdflatex --natbib --chapters --variable tables=yes --standalone 
    [pandoc warning] --chapters is deprecated. Use --top-level-division=chapter instead.
    tlmgr search --file --global '/scrreprt.cls'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install koma-script
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: koma-script [13241k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/english.ldf'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install babel-english
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: babel-english [3k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/pifont.sty'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install psnfss
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: psnfss [12k]
    running mktexlsr ...
    done running mktexlsr.
    running updmap-sys ...
    done running updmap-sys.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/psyr[.](tfm|afm|mf|otf)'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install symbol
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: symbol [36k]
    running mktexlsr ...
    done running mktexlsr.
    running updmap-sys ...
    done running updmap-sys.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/float.sty'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install float
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: float [3k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/subfigure.sty'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install subfigure
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: subfigure [5k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/titleref.sty'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install titleref
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: titleref [3k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    tlmgr search --file --global '/multirow.sty'
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    Trying to automatically install missing LaTeX packages...
    tlmgr install multirow
    TeX Live 2017 is frozen forever and will no
    longer be updated.  This happens in preparation for a new release.
    
    If you're interested in helping to pretest the new release (when
    pretests are available), please read http://tug.org/texlive/pretest.html.
    Otherwise, just wait, and the new release will be ready in due time.
    tlmgr: package repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
    [1/1, ??:??/??:??] install: multirow [3k]
    running mktexlsr ...
    done running mktexlsr.
    tlmgr: package log updated: /opt/TinyTeX/texmf-var/web2c/tlmgr.log
    tlmgr path add
    ! Class scrreprt Error: undefined old font command `\bf'.
    
    Error: Failed to compile thesis_ubt.tex. See thesis_ubt.log for more info.
    Please delete thesis_ubt.Rmd after you finish debugging the error.
    devtools::session_info('bookdownplus')
    Session info -------------------------------------------------------------------------------------------
     setting  value                       
     version  R version 3.4.4 (2018-03-15)
     system   x86_64, linux-gnu           
     ui       RStudio (1.1.442)           
     language (EN)                        
     collate  en_US.UTF-8                 
     tz       Etc/UTC                     
     date     2018-03-26                  
    
    Packages -----------------------------------------------------------------------------------------------
     package      * version date       source                        
     backports      1.1.2   2017-12-13 CRAN (R 3.4.4)                
     base64enc      0.1-3   2015-07-28 CRAN (R 3.4.4)                
     bookdown       0.7     2018-02-18 CRAN (R 3.4.4)                
     bookdownplus   1.3.2   2017-10-10 CRAN (R 3.4.4)                
     digest         0.6.15  2018-01-28 CRAN (R 3.4.4)                
     evaluate       0.10.1  2017-06-24 CRAN (R 3.4.4)                
     glue           1.2.0   2017-10-29 CRAN (R 3.4.4)                
     graphics     * 3.4.4   2018-03-24 local                         
     grDevices    * 3.4.4   2018-03-24 local                         
     highr          0.6     2016-05-09 CRAN (R 3.4.4)                
     htmltools      0.3.6   2017-04-28 CRAN (R 3.4.4)                
     jsonlite       1.5     2017-06-01 CRAN (R 3.4.4)                
     knitr          1.20    2018-02-20 CRAN (R 3.4.4)                
     magrittr       1.5     2014-11-22 CRAN (R 3.4.4)                
     markdown       0.8     2017-04-20 CRAN (R 3.4.4)                
     methods      * 3.4.4   2018-03-24 local                         
     mime           0.5     2016-07-07 CRAN (R 3.4.4)                
     Rcpp           0.12.16 2018-03-13 CRAN (R 3.4.4)                
     rmarkdown      1.9     2018-03-01 CRAN (R 3.4.4)                
     rprojroot      1.3-2   2018-01-03 CRAN (R 3.4.4)                
     stats        * 3.4.4   2018-03-24 local                         
     stringi        1.1.7   2018-03-12 CRAN (R 3.4.4)                
     stringr        1.3.0   2018-02-19 CRAN (R 3.4.4)                
     tinytex        0.4.2   2018-03-24 Github (yihui/tinytex@c7d62e1)
     tools          3.4.4   2018-03-24 local                         
     utils        * 3.4.4   2018-03-24 local                         
     xfun           0.1     2018-01-22 CRAN (R 3.4.4)                
     yaml           2.1.18  2018-03-08 CRAN (R 3.4.4)                

    thesis_ubt.log 日志文件的关键内容,已经在前面展示了,

    Overfull \vbox (1.39674pt too high) has occurred while \output is active []
    
    [2] (./thesis_ubt.los
    
    ! Class scrreprt Error: undefined old font command `\bf'.
    
    See the scrreprt class documentation for explanation.
    Type  H <return>  for immediate help.
     ...                                              
                                                      
    l.1 \makenicesymbolline {{\bf Abbreviations}}{~}

      Cloud2016 谢谢反馈。我目前手头没有 linux 系统,暂时没法重现这个错误,等我回头研究研究。

      bookdownplus 里的 tex 模板,来自我积攒的库存,来源很杂,弄成 bookdown 模板的时候没有仔细优化,心态是“能用就行”,结构和代码都有太多可调整的地方,我没弄(我宁愿花时间多搜罗几个能用的模板进去),期待志愿者加入,把代码弄得漂亮一点,结构上弄得合理一点——这事儿我不敢动手,怕一入 LaTeX 误终身。

      不知你这个源码是否允许收到 bookdownplus 包里?

        dapengde
        我也不是真的装了个 Linux 系统,从 rocker 上拉取一个 Docker 镜像而已,Windows系统也可以玩。

        LaTeX 的水确实很深,所以我只是基于 pandoc-template 做,这样,LaTeX导言区,要我写的部分就少多了,模板很大一部分其实是由他人维护着。我的论文模板也是这么搞的 master-thesis-template 此处多谢谢大的指点。

        可以收录?

        BTW,上面日志中的错误是说 scrreprt 升级了,\bf命令被抛弃了,然后需要找新的替代命令,这个 scrreprt文类 第一次见,稍微看了下用 \textbf 替代就好了

          4 天 后