Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dependencies more modular #23

Open
3 tasks
GregorDeCillia opened this issue May 27, 2019 · 1 comment
Open
3 tasks

Make dependencies more modular #23

GregorDeCillia opened this issue May 27, 2019 · 1 comment

Comments

@GregorDeCillia
Copy link
Member

GregorDeCillia commented May 27, 2019

Make the following features and their dependencies optional

  • write_xlsx: Dependencies: xlsx, Sys-dependencies: Java
  • write_pdf, knit_print: Dependencies: none. Sys-Dependencies: latex, and certain CTAN packages
  • write_png, knit_print_html: Dependencies: All dependencies for "pdf export" as well as magick and pdftools

Also make sure each of the three modules has a descriptive error function if the dependencies are not available. For example

write_pdf(st)
#> Error in write_pdf: 
#>   Could not find pdflatex on your system. Please refer to the "installation" 
#>   section of vignettes("styledtables-latex") for details
write_png(st)
#> Error in write_png: 
#>   Could not find the R Package magick on your system. Please install with 
#>   install.packages("magick")
install.packages("magick")
write_png(st)
#> Error in write_png: 
#>   Could not find the R Package pdftools on your system. Please install with 
#>   install.packages("pdftools")
write_xlsx(st)
#> Error in write_xlsx:
#>   Could not find the R Package xlsx on your system. Please install with
#>   install.packages("xlsx")
":("
#> [1] ":("

The "styledtables-latex" vignette (#8) therefore needs a installation section at the beginning that documents how latex and the required CTAN packages can be installed. The pimary recommendation for this should be tinytex, since it is platform independent and CTAN packages can be installed on the fly. However, it should also be pointed out that a "normal" tex installation works as well.

@GregorDeCillia
Copy link
Member Author

GregorDeCillia commented May 27, 2019

We should consider to use tools::texi2pdf("table.tex") instead of system("pdflatex table.tex") because of the error handling it provides. In theory, we could just replace the "error latex not found" message thrown by tools with the vignettes("styledtable-latex") message mentioned above and forward all other error messages to the client as-is.

Last time I checked, texi2pdf didn't work on appveyor but I am pretty sure the latex compiler was not properly installed on that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant