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

Include additional packages in tinytex::install_tinytex() to have it work out of box with Jupyter #228

Open
3 tasks done
ttimbers opened this issue Jul 15, 2020 · 6 comments

Comments

@ttimbers
Copy link

I have moved to using TinyTex with Jupyter, however to do so I need to install 16 additional packages (listed below) to make this work with the version of tinytext on CRAN or if I install the dev version of tinytex.

Would a pull request be welcome to add these into the base install of tinytex::install_tinytex() to have it work out of box with Jupyter?

Packages that need to be added for CRAN version of TinyTex to work with Jupyter

tlmgr install adjustbox \
  caption \
  collectbox \
  enumitem \
  environ \
eurosym \
  jknapltx \
  parskip \
  pgf \
  rsfs \
  tcolorbox \
  titling \
  trimspaces \
  ucs \
  ulem \
  upquote 

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tinytex'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/tinytex').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@cderv
Copy link
Contributor

cderv commented Jul 17, 2020

Just out of curiosity, and to be sure to understand

can't you install them using tinytex::tlmgr_install() or tlmgr install ?

to have it work out of box with Jupyter

I guess you can but it is to have no other step to do than tinytex::install_tinytex(), right ?
Note that you can use the extra_packages = argument in install_tinytex() to this purpose.

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

I ask because adding those packages inside the default installation would make TinyTex less lightweight (see 3. and 4. in the FAQ)

Maybe there could be a helper function (or file) to easily use this list of package when installing TinyTex for Jupyter ?
Is there a reference for those required Tex packages for TinyTex ?

@ttimbers
Copy link
Author

Oooh, I really like the idea of a helper function or file to easily use the list of packages when installing TinyTex for Jupyter! Great suggestions! I am happy to start on a PR for this if it is a welcome addition?

Not sure I understand your last question?

Is there a reference for those required Tex packages for TinyTex ?

What exactly are you asking?

@cderv
Copy link
Contributor

cderv commented Jul 17, 2020

What exactly are you asking?

How do you know which package you need for Jupyter ? Is it a minimum set of required packages based on documentation somewhere or from your own experience ? Can we based the list on something available to help keep it up to date ?

@ttimbers
Copy link
Author

I discovered this via following the error messages after installing TinyTex and trying to use it in Jupyter. Once I installed the packages above it worked. I uninstalled it and replicated twice on Mac, and then replicated it again on ubuntu. Sadly the nbconvert docs (which is what does the PDF conversion in Jupyter) are fairly sparse about the specific TeX package dependencies...

https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex

And in their CI .travis.yml file (https://github.com/jupyter/nbconvert/blob/master/.travis.yml) they again just load Tex Live indiscriminately...

I will open an issue on the nbconvert repo asking if such a minimum set of required packages exists. I will also alert them of this project, as maybe this would be something they (and other Jupyter folks) would like to switch to?

@yihui
Copy link
Member

yihui commented Jul 23, 2020

I'm fine with adding more packages to the default installation of TinyTeX if they are not too big. I don't have a hard limit on the size, but I'd hesitate when it would increase the size by more than 5Mb.

You are definitely not the first user who has asked to include more packages. I've been a little worried about how fast we'll be approaching tlmgr install scheme-full (FAQ 3) :)

And there have been users who complain that TinyTeX is not "tiny", e.g., https://yihui.org/tinytex/#comment-4939627259 although I usually try to ignore such comments.

@ttimbers
Copy link
Author

I am not sure how to estimate what the size of increase of TinyTex would be by adding these packages... So I'll first start with a PR as per @cderv's suggestion.

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

3 participants