From 1f6394313256f6628c12be81784451fa33983fbe Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 11 Nov 2019 09:53:38 -0600 Subject: [PATCH] fix #1691: use the grffile package only if it exists (it has become a legacy package, and won't be available in future versions of TeX Live) also close #1692 and close yihui/tinytex#152 --- DESCRIPTION | 2 +- NEWS.md | 3 +++ inst/rmd/latex/default-1.14.tex | 6 +++++- inst/rmd/latex/default-1.15.2.tex | 6 +++++- inst/rmd/latex/default-1.17.0.2.tex | 6 +++++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 002f2001bf..7e9cfbf6e5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rmarkdown Type: Package Title: Dynamic Documents for R -Version: 1.16.3 +Version: 1.16.4 Authors@R: c( person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"), person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), diff --git a/NEWS.md b/NEWS.md index 68712b60d1..30cde2a605 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,9 @@ rmarkdown 1.17 - For `ioslides_presentation`, images with atributes (e.g., `![](sample.png){width=80%}`) can be correctly embedded in the self-contained mode now (thanks, @hadley, #1687). +- Fixed the Pandoc LaTeX templates to avoid the error `File `grffile.sty' not found`. This is because the LaTeX **grffile** is no longer available in TeX Live (thanks, @cderv #1691, @smmurphy #1692, @JacobD05 https://github.com/yihui/tinytex/issues/152). + + rmarkdown 1.16 ================================================================================ diff --git a/inst/rmd/latex/default-1.14.tex b/inst/rmd/latex/default-1.14.tex index f20d298430..803231228c 100644 --- a/inst/rmd/latex/default-1.14.tex +++ b/inst/rmd/latex/default-1.14.tex @@ -102,7 +102,11 @@ \usepackage{longtable,booktabs} $endif$ $if(graphics)$ -\usepackage{graphicx,grffile} +\usepackage{graphicx} +% grffile has become a legacy package: https://ctan.org/pkg/grffile +\IfFileExists{grffile.sty}{% +\usepackage{grffile} +}{} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} diff --git a/inst/rmd/latex/default-1.15.2.tex b/inst/rmd/latex/default-1.15.2.tex index 4a775199f8..d7e6574e85 100644 --- a/inst/rmd/latex/default-1.15.2.tex +++ b/inst/rmd/latex/default-1.15.2.tex @@ -118,7 +118,11 @@ \usepackage{longtable,booktabs} $endif$ $if(graphics)$ -\usepackage{graphicx,grffile} +\usepackage{graphicx} +% grffile has become a legacy package: https://ctan.org/pkg/grffile +\IfFileExists{grffile.sty}{% +\usepackage{grffile} +}{} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} diff --git a/inst/rmd/latex/default-1.17.0.2.tex b/inst/rmd/latex/default-1.17.0.2.tex index 81d51005a8..adbc0fd9e0 100644 --- a/inst/rmd/latex/default-1.17.0.2.tex +++ b/inst/rmd/latex/default-1.17.0.2.tex @@ -121,7 +121,11 @@ \usepackage{longtable,booktabs} $endif$ $if(graphics)$ -\usepackage{graphicx,grffile} +\usepackage{graphicx} +% grffile has become a legacy package: https://ctan.org/pkg/grffile +\IfFileExists{grffile.sty}{% +\usepackage{grffile} +}{} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}