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?
> 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
Using Windows 10, logged in as the user erik:
tinytex::install_tinytex()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
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
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').I understand that my issue may be closed if I don't fulfill my promises.
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.
Most helpful comment
@norbusan @igelstorm Thank you so much for the super helpful tip! I'll do the post action in my installation scripts.