about summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authorBenedikt Tissot <benedikt.tissot@googlemail.com>2024-01-12 16:47:35 +0100
committerGitHub <noreply@github.com>2024-01-12 09:47:35 -0600
commitb28200aa23db05fe6ac29e8828b8119e6a4cd6ff (patch)
tree5a7fed80f0e4ea7edf0f6bfa3c1d15f318d247d5 /doc/languages-frameworks
parentaca297f0d5713852149a795746b521423c701fe1 (diff)
texlive: document LuaLaTeX font cache (#280080)
lualatex assumes a writeable font cache relative to `$HOME`, for nix this has two implications.
First, the cache might diverge from the nix store if users use LuaLaTeX.
Second, `$HOME` needs to be set to a writable path in derivations.
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/texlive.section.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/languages-frameworks/texlive.section.md b/doc/languages-frameworks/texlive.section.md
index 8b1ed92a450c1..01b59f6f34a93 100644
--- a/doc/languages-frameworks/texlive.section.md
+++ b/doc/languages-frameworks/texlive.section.md
@@ -208,3 +208,23 @@ EOF
   cp test.pdf $out
 ''
 ```
+
+## LuaLaTeX font cache {#sec-language-texlive-lualatex-font-cache}
+
+The font cache for LuaLaTeX is written to `$HOME`.
+Therefore, it is necessary to set `$HOME` to a writable path, e.g. [before using LuaLaTeX in nix derivations](https://github.com/NixOS/nixpkgs/issues/180639):
+```nix
+runCommandNoCC "lualatex-hello-world" {
+  buildInputs = [ texliveFull ];
+} ''
+  mkdir $out
+  echo '\documentclass{article} \begin{document} Hello world \end{document}' > main.tex
+  env HOME=$(mktemp -d) lualatex  -interaction=nonstopmode -output-format=pdf -output-directory=$out ./main.tex
+''
+```
+
+Additionally, [the cache of a user can diverge from the nix store](https://github.com/NixOS/nixpkgs/issues/278718).
+To resolve font issues that might follow, the cache can be removed by the user:
+```ShellSession
+luaotfload-tool --cache=erase --flush-lookups --force
+```