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

added list of tlmgr packages to install as data #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^codecov\.yml$
^TinyTeX\.zip$
^.github$
^data-raw$
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ Description: Helper functions to install and maintain the 'LaTeX' distribution
portable, and easy-to-maintain version of 'TeX Live'. This package also
contains helper functions to compile 'LaTeX' documents, and install missing
'LaTeX' packages automatically.
Imports: xfun (>= 0.5)
Imports:
xfun (>= 0.5),
usethis (>= 1.6.1)
Suggests: testit, rstudioapi
License: MIT + file LICENSE
URL: https://github.com/yihui/tinytex
BugReports: https://github.com/yihui/tinytex/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Depends:
R (>= 2.10)
26 changes: 26 additions & 0 deletions R/jup_pkgs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#' Additional tinytex packages needed for rendering of PDFs in Jupyter
#'
#' These 16 TexLive packages are required to allow for rendering of PDFs in
#' Jupyter when tinytex is used to install LaTeX.
#'
#' @format A vector with 16 package names:
#' \describe{
#' \item{adjustbox}{}
#' \item{caption}{}
#' \item{collectbox}{}
#' \item{enumitem}{}
#' \item{environ}{}
#' \item{eurosym}{}
#' \item{jknapltx}{}
#' \item{parskip}{}
#' \item{pgf}{}
#' \item{rsfs}{}
#' \item{tcolorbox}{}
#' \item{titling}{}
#' \item{trimspaces}{}
#' \item{ucs}{}
#' \item{ulem}{}
#' \item{upquote}{}
#' }
#' @source \url{https://github.com/yihui/tinytex/issues/228}
"jup_pkgs"
22 changes: 22 additions & 0 deletions data-raw/jup_pkgs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## code to prepare `jup_pkgs` dataset goes here

jup_pkgs <- c(
"adjustbox",
"caption",
"collectbox",
"enumitem",
"environ",
"eurosym",
"jknapltx",
"parskip",
"pgf",
"rsfs",
"tcolorbox",
"titling",
"trimspaces",
"ucs",
"ulem",
"upquote"
)

usethis::use_data(jup_pkgs, overwrite = TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to introduce the dependency on usethis only for the purpose of saving a simple vector to .rda and documenting it. I prefer not exporting or documenting jup_pkgs here. That means users will need to use :::, which I think is fine. This is not a super important object anyway.

That said, it will be good to briefly mention it on the TinyTeX documentation site, e.g. after FAQ 12: https://yihui.org/tinytex/faq/

An alternative approach is like this: https://github.com/yihui/tinytex/blob/b84fd550ffb72a8f20d323144fe269f4a5173c9a/R/install.R#L342-L346 i.e. save the list of packages under tools/pkgs-jupyter.txt, so both the R function and the shell script can read it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious as to whether adding usethis::use_data_raw() would mean that it needed to be added as a dev dependency. So I queried Allison Hill on this. She said that "The scripts in data_raw/ are for you. They are your way of creating the package but that directory is added to your .Rbuildignore when you set it up with usethis" (see Twitter conversation here). So in general it seems that technically this does not make usethis a dev dependency. However, I am happy to defer to your preferred way to do this. Another advantage of doing something like install_yihui_pkgs with a the list of packages in tools/pkgs-jupyter.txt is that, as you mentioned, the shell script can read it.

Once you confirm this is for sure the way you want to go, I will change to PR to reflect it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please store the list of packages in tools/pkgs-jupyter.txt, and remove the dependency on usethis. Thank you!

Binary file added data/jup_pkgs.rda
Binary file not shown.
38 changes: 38 additions & 0 deletions man/jup_pkgs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.