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

Suggestion to use match.arg() for input arguments such as bundle #408

Closed
3 tasks done
kellijohnson-NOAA opened this issue Mar 21, 2023 · 3 comments
Closed
3 tasks done

Comments

@kellijohnson-NOAA
Copy link

Recently, I used install_tinytex() and had a typo in bundle, e.g., install_tinytex(bundle = "TinyTex-2"), where it should have been install_tinytex(bundle = "TinyTeX-2"). I think that adding the following to the source code for install_tinytex()

bundle <- match.arg(bundle)

after changing the following line

force = FALSE, dir = 'auto', version = 'daily', bundle = 'TinyTeX-1', repository = 'auto',

to something like

force = FALSE, dir = 'auto', version = 'daily',
bundle = c('TinyTeX-1', 'TinyTeX', 'TinyTeX-2', 'TinyTeX-0'),
repository = 'auto',

would help users out quite a bit. I realize this is not necessary and adds code to the repository for you to maintain just so users can be lazy so feel free to close this issue upon reading if you do not think it is a good idea. I am also happy to open a pull request with this feature if you desire help in implementing it. I see it as a benefit to users who read the help files for information because it would clearly list the available input arguments in args(install_tinytex) without you having to list them in the documentation for the input argument or users having to navigate to https://github.com/rstudio/tinytex-releases#releases to see them.

Thanks for entertaining the idea.

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('rstudio/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.

@yihui
Copy link
Member

yihui commented Mar 21, 2023

Thanks for the suggestion! I think this is definitely worth improving! I'll think a little more and let you know. For now I'm not entirely sure if we should use match.arg(), because I guess there is still a tiny chance that we might have TinyTeX-3 or something in future, so I don't want to hard-code the possible bundle names.

@yihui yihui closed this as completed in 24b5848 Apr 4, 2023
@yihui
Copy link
Member

yihui commented Apr 4, 2023

It seems you are on Windows (I'll appreciate it if you could report your session info as indicated by the issue guide), and I think this problem only affects Windows users. Anyway, I just made a change to automatically fix the typo regardless of the spelling (i.e., TinyTeX can be case-insensitive in the bundle name). Thanks again!

@kellijohnson-NOAA
Copy link
Author

Thank you for the fix and yes I am on Windows ☹️ .

> library(tinytex)
> sessionInfo()
R Under development (unstable) (2022-09-12 r82842 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] tinytex_0.43

loaded via a namespace (and not attached):
[1] compiler_4.3.0 tools_4.3.0    xfun_0.36

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

No branches or pull requests

2 participants