Tinytex: fonts.conf gets populated with `C:/Users/appveyor/.../TinyTeX` instead of actual user's path

Created on 4 Jun 2021  路  4Comments  路  Source: yihui/tinytex

Summary

After I install TinyTeX on Windows, the system is configured to look for fonts in a subdirectory of C:/Users/appveyor/AppData/Roaming/TinyTeX, even though there is no user called appveyor and this directory doesn't exist. This means that TeX is unable to use any fonts that I have installed using tlmgr.

If I manually change C:/Users/appveyor/... to C:/Users/erik/... (my username) in C:/Users/erik/AppData/Roaming/TinyTeX/texmf-var/fonts/conf/fonts.conf, the system is able to find fonts. I would expect this config file to refer to the correct path right after I install TinyTeX for the first time.

If I understand correctly, AppVeyor is the service used to build TinyTeX, so I wonder if maybe this path is accidentally hardwired in at some point during the build process?

Session info

> xfun::session_info('tinytex')
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 1.4.1717

Locale:
  LC_COLLATE=English_United Kingdom.1252 
  LC_CTYPE=English_United Kingdom.1252   
  LC_MONETARY=English_United Kingdom.1252
  LC_NUMERIC=C                           
  LC_TIME=English_United Kingdom.1252    

Package version:
  graphics_4.1.0  grDevices_4.1.0 stats_4.1.0     tinytex_0.32.1 
  tools_4.1.0     utils_4.1.0     xfun_0.23

Steps to reproduce

Using Windows 10, logged in as the user erik:

  1. In an R terminal, install TinyTeX: tinytex::install_tinytex()
  2. In a PowerShell/cmd terminal, type: fc-cache -fv, and note the paths beginning with C:\Users\appveyor in the output:
PS C:\Users\erik> fc-cache -fv
Note that it needs some time to create caches,
especially if there are many large font files.
Wait with patience.

Font directories:
        C:/Windows/fonts
        C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/opentype
        C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/truetype
C:/Windows/fonts: caching, new cache contents: 1008 fonts, 0 dirs
C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/opentype: skipping, no such directory
C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/truetype: skipping, no such directory
C:/Users/erik/AppData/Roaming/TinyTeX/texmf-var/fonts/cache: cleaning cache directory

Workaround

In C:/Users/erik/AppData/Roaming/TinyTeX/texmf-var/fonts/conf/fonts.conf, change the lines:

<dir>C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/opentype</dir>
<dir>C:/Users/appveyor/AppData/Roaming/TinyTeX/texmf-dist/fonts/truetype</dir>

to:

<dir>C:/Users/erik/AppData/Roaming/TinyTeX/texmf-dist/fonts/opentype</dir>
<dir>C:/Users/erik/AppData/Roaming/TinyTeX/texmf-dist/fonts/truetype</dir>

By filing an issue to this repo, I promise that

  • [x] I have fully read the issue guide at https://yihui.org/issue/.
  • [x] 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.

  • [x] 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.

Most helpful comment

@norbusan @igelstorm Thank you so much for the super helpful tip! I'll do the post action in my installation scripts.

All 4 comments

Thanks for the report! I can see these absolute paths in texmf-var/fonts/conf/fonts.conf on macOS, too. @norbusan Is it possible not to generate the full absolute path in this case (portable mode)? Thanks!

How should fonts then be made available? AFAIK fontconfig does not allow relative paths in fonts.conf, and thus it fails.

The code is in tlpkg/tlpostcode/xetex.pl, and it seems that the xetex package is pre-installed in tinytex, which would explain the problem.

What can be done is re-running the post-install action with tlmgr postaction xetex or similar (not sure now) on installation. Otherwise once cannot know where the actual files are.

Does this help?

If it helps, I can confirm that if I run tlmgr postaction install script xetex immediately after installing TinyTeX for the first time, the correct paths are set in fonts.conf. 馃憤

@norbusan @igelstorm Thank you so much for the super helpful tip! I'll do the post action in my installation scripts.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leafyeh7 picture leafyeh7  路  6Comments

boltomli picture boltomli  路  3Comments

nickp60 picture nickp60  路  6Comments

Sakura-gh picture Sakura-gh  路  6Comments

woodwm picture woodwm  路  5Comments