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

add support for installing tinytex #5490

Merged
merged 5 commits into from Oct 9, 2019
Merged

add support for installing tinytex #5490

merged 5 commits into from Oct 9, 2019

Conversation

@kevinushey
Copy link
Contributor

kevinushey commented Sep 30, 2019

Closes #2788.

This PR adds some UI for installing the tinytex package, and uses that to call tinytex::install_tinytex().

Screen Shot 2019-09-30 at 4 38 44 PM

After running that, documents that need to be compiled to PDF (both .Rnw and .Rmd) should be able to be compiled successfully.

Some open thoughts:

  1. Should we provide a modal dialog before starting the install? It could be a place where we could explain "what is tinytex?" and also provide a help link or similar.

  2. We might also want to ensure this warning bar shows up when using an R Markdown document that will be compiled to PDF.

src/cpp/session/SessionModuleContext.cpp Outdated Show resolved Hide resolved
FilePath appData(core::system::getenv("APPDATA"));
binPath = appData.complete("TinyTeX\\bin\\win32");
#elif defined(__APPLE__)
binPath = resolveAliasedPath("~/Library/TinyTeX/bin/x86_64-darwin");

This comment has been minimized.

Copy link
@jmcphers

jmcphers Oct 1, 2019

Member

Any chance we could ask if the tinytex package itself where it installed pdflatex? (worried that these paths could drift in the future with updates to tinytex)

This comment has been minimized.

Copy link
@kevinushey

kevinushey Oct 1, 2019

Author Contributor

That's a good idea. I think we still want this fallback for the case where the tinytex package is not installed or not on the library paths for some reason, though. I'll make a change.

@jmcphers

This comment has been minimized.

Copy link
Member

jmcphers commented Oct 2, 2019

LGTM!

@coatless

This comment has been minimized.

Copy link

coatless commented Oct 4, 2019

@kevinushey anyway that an alternative link to a true TeX distribution could be displayed as well? tinytex is a headache at times.

@kevinushey

This comment has been minimized.

Copy link
Contributor Author

kevinushey commented Oct 4, 2019

tinytex is a headache at times.

I'd rather solve these issues in tinytex (assuming Yihui agrees it's something worth solving) than provide alternative download links, especially since those change and break over time.

What issues are you having with tinytex?

@coatless

This comment has been minimized.

Copy link

coatless commented Oct 4, 2019

From pinp's recent episode, tinytex ended up complicating the debugging process (@eddelbuettel can attest to the loss of a weekend). If someone is using a .Rnw, chances are they want more than what tinytex offers. For rmarkdown, that might be reversed... But, in this case, I'm more worried about tinytex infeccted student systems over a standardized LaTeX distribution. (That said, a majority of LaTeX work is now farmed out to overleaf.)

@kevinushey

This comment has been minimized.

Copy link
Contributor Author

kevinushey commented Oct 4, 2019

Was the issue that tinytex did not install some subset of latex packages required to render the document, or something else? AFAIK tinytex ultimately is just a portable TexLive distribution, but the selection of default packages may be too minimal.

@eddelbuettel

This comment has been minimized.

Copy link

eddelbuettel commented Oct 4, 2019

It completely garbled an error message from latex, possibly interpreting it its own way and sending people scrambling the wrong way. Including somewhat experienced folks like myself and Kurt. There was a simple latex error, but what we got to see due to tinytex was (IIRC) some rambling about the search path and indexing. Which had nothing at all to do with the issue -- a simple error in the latex class file.

I would prefer if I could opt out of tinytex, but I can't. Not from R (b/c when rmarkdown et al depend on it there is no escaping), not from the package itself. My ideal would be an option to toggle 'ok then, let me just pass this through' which would call the base R latex processor just like it used to do. But I haven't had time to work on that / test it and won't for some time.

In short, to me tinytex is pure nuisance. I had all sorts of "fun" and "issues" and "bugs" in 20+ years of R, but I never had latex issues (that weren't solvable at the distro level and entirely orthogonal to R use.).

That said, I didn't bring this up here -- James did -- and I don't really have time or interest to stir a fire here. It is not an issue I have with the IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.