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

'pcrr8t' not found - install 'courier' by default? (CentOS) #323

Closed
3 tasks done
kenahoo opened this issue Aug 13, 2021 · 2 comments
Closed
3 tasks done

'pcrr8t' not found - install 'courier' by default? (CentOS) #323

kenahoo opened this issue Aug 13, 2021 · 2 comments

Comments

@kenahoo
Copy link

kenahoo commented Aug 13, 2021

I recently created a CentOS Docker image and performed the following:

Rscript -e 'install.packages("tinytex")'
yum install -y perl perl-Digest-MD5
Rscript -e 'tinytex::install_tinytex()'
~/.TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin && ~/.TinyTeX/bin/*/tlmgr path add

The DESCRIPTION file includes the following fields:

Author: Alice B <alice.b@example.com>
Maintainer: Chad D <chad.d@example.com>

When I build a package source tarball and run R CMD check example_0.32.tar.gz on it, it fails to build the doc PDFs, with an error similar to the Font T1/pcr/m/n/12=pcrr8t at 12.0pt not loadable: Metric (TFM) file not found shown in issue #300. The error message seems to indicate that it's trying to use that font to render the above email addresses.

Doing Rscript -e 'tinytex::tlmgr_install("courier")' solves the problem and the R CMD check command thus succeeds. So I do have a perfectly fine workaround - I'm not asking for any help, just trying to inform the TinyTeX team of an issue they might want to consider.

My question: would it be reasonable to change TinyTeX to include courier in the base install? Reasons in favor:

  1. Existing behavior seems to contradict the "R users won’t need to do anything" mantra of TinyTeX
  2. Doing the identical steps on an Ubuntu image doesn't have a problem, R CMD check succeeds fine without installing courier manually
    Reasons against:
  3. Obviously we want to keep TinyTeX small

Or is there some other solution that would be better?

Apologies if I've misunderstood the issue - I'm always a little befuddled in TeX land.

> xfun::session_info('tinytex')
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Locale: C

Package version:
  grDevices_3.6.3 graphics_3.6.3  stats_3.6.3     tinytex_0.33   
  tools_3.6.3     utils_3.6.3     xfun_0.25      

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.


Please note - I have explicitly NOT upgraded to the latest version of R, because this is on a build server where we let the user choose the version of R they need to run against.

@yihui
Copy link
Member

yihui commented Aug 13, 2021

When you run into LaTeX errors, you can pass the error log to tinytex::parse_packages() to figure out the missing packages (https://bookdown.org/yihui/rmarkdown-cookbook/install-latex-pkgs.html):

> tinytex::parse_packages(text = "! Font T1/pcr/m/n/12=pcrr8t at 12.0pt not loadable: Metric (TFM) file not found")
tlmgr search --file --global '/pcrr8t(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)'
[1] "courier"

Indeed, the most important reason against including additional packages in TinyTeX is to keep the size small.

> tinytex::tl_sizes(pkgs = 'courier')
tlmgr info --list --only-installed --data name,size courier
The total size is 1.1 Mb
  package    size size_h
1 courier 1191936 1.1 Mb

I receive requests for including certain packages in the default installation from time to time (e.g., just yesterday #322). It's always a tough decision to make. For anyone who does not care too much about the package size, you can install a variant of TinyTeX:

tinytex:::install_prebuilt('TinyTeX')

This is probably the easiest solution.

Existing behavior seems to contradict the "R users won’t need to do anything" mantra of TinyTeX

I didn't count R package developers here. Developers may need to install a few additional packages (#135). BTW, there is possibility to make base R work with TinyTeX (#292), but it will require R core's support.

@kenahoo
Copy link
Author

kenahoo commented Aug 17, 2021

Thanks - lots of good options here. I appreciate the clarification about package developers vs. other R users.

@kenahoo kenahoo closed this as completed Aug 17, 2021
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

2 participants