refactor: install_tinytex() calls install-bin-unix.sh and install-bin-windows.ps1 directly#495
Draft
refactor: install_tinytex() calls install-bin-unix.sh and install-bin-windows.ps1 directly#495
Conversation
…-windows.ps1 Agent-Logs-Url: https://github.com/rstudio/tinytex/sessions/be1d7fad-94aa-4aa6-86f7-46b65d175692 Co-authored-by: yihui <163582+yihui@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rstudio/tinytex/sessions/be1d7fad-94aa-4aa6-86f7-46b65d175692 Co-authored-by: yihui <163582+yihui@users.noreply.github.com>
|
|
Copilot created this pull request from a session on behalf of
yihui
March 27, 2026 20:55
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors
install_tinytex()so that the binary install path delegates to the official installer scripts (install-bin-unix.shandinstall-bin-windows.ps1, downloaded from https://tinytex.yihui.org/) instead of re-implementing the same logic in R. The source install path (viainstall_tinytex_source()) already usedinstall-unx.shand is unchanged.Changes
tools/install-bin-unix.shTINYTEX_PREVENT_INSTALLenv var check (abort if set totrue)TINYTEX_TEXDIRenv var: lets callers specify the full installation path directly (e.g., the R package passes this for customdir=installs); falls back to the traditionalTINYTEX_DIR-based default. For prebuilt bundles, the extracted archive is renamed to the custom path if needed../tlmgr conf texmf max_print_line 10000post-install (matchespost_install_config()in R, fixes log line-wrapping — issue Automatically install hyphenation patterns when using polyglossia #322)$1/--no-pathargument conflict:$1was used to save the installer to an output dir (for build scripts), but R passes--no-pathas$1. Now checks that$1doesn't start with--before treating it as a save directory.$(dirname "$TEXDIR")to handle paths with spaces correctly.tools/install-bin-windows.ps1TINYTEX_PREVENT_INSTALLenv var check--no-pathargument support (skips& $tlmgr path addwhen passed)TINYTEX_TEXDIRenv var for full-path installs (with move+rename support for custom leaf names)& $tlmgr conf texmf max_print_line 10000post-install$args[0]/--no-pathconflict for the installer save-path featurerd $env:TINYTEX_DIR\TinyTeX(now handled cleanly via$TargetDir)R/install.Rinstall_via_script(): downloads and runs the appropriate OS installer script, then does R-specific post-install steps (r_texmf(), repo config,extra_packages). Sets env varsTINYTEX_INSTALLER,TINYTEX_VERSION, and (for custom dirs)TINYTEX_TEXDIRbefore calling the script.install_tinytex()now routes binary installs throughinstall_via_script()instead ofinstall_prebuilt().install_prebuilt()is kept intact for any direct callers (it is mentioned in NEWS.md as accessible viatinytex:::install_prebuilt()).Differences handled outside scripts (cannot be eliminated)
The following
install_tinytex()behaviors remain in R and are not replicated in the scripts:r_texmf()extra_packagestl_pkgs())tlgpginstallation for HTTPS repostlmgr()integrationforce/ existing LaTeXreadline()/interactive()TEXINPUTenv var warningversion='latest'→ GitHub release lookupxfun::github_releases()extra_packagesmapping for source installs