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
tex-gyre: init at ~2.005 #35028
tex-gyre: init at ~2.005 #35028
Conversation
@jtojnar Are these the OTF versions? Are you hoping to use these with |
Yes, they are. Yes, I am using them with |
{ nixpkgs ? (import <nixpkgs> {}) }:
with nixpkgs;
let
tex-deps = {
inherit (texlive) collection-bibtexextra collection-latexextra latexmk scheme-small tex-gyre-math;
};
src = writeText "thesis" ''
\documentclass{fithesis3}
\thesissetup{
date = \the\year/\the\month/\the\day,
}
\begin{document}
Test
\end{document}
'';
buildPhase = ''
latexmk -xelatex -shell-escape -view=pdf "${src}"
install -Dt $out *-thesis.pdf
'';
in {
bad = runCommandNoCC "thesis-bad" {
# TeX Gyre Pagella from texlive.tex-gyre is not recognized
buildInputs = [ (texlive.combine (tex-deps // { inherit (texlive) tex-gyre; })) ];
} buildPhase;
good = runCommandNoCC "thesis-good" {
buildInputs = [ (texlive.combine tex-deps) ];
# Using OTF font from the pull request works
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ tex-gyre.pagella ]; };
} buildPhase;
} $ nix-build tex-gyre.nix -A good
[…]
Latexmk: All targets (3bpbqyzchjg759snvaz5zr8dhjy162gz-thesis.pdf 3bpbqyzchjg759snvaz5zr8dhjy162gz-thesis.xdv) are up-to-date
$ nix-build tex-gyre.nix -A bad
[…]
tex/latex/unicode-math/unicode-math-table.tex)))kpathsea:make_tex: Invalid fontname `TeX Gyre Pagella', contains ' '
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "TeX Gyre Pagella" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.116 ...mainfont[Ligatures=TeX]{TeX Gyre Pagella}
?
! Emergency stop.
!...............................................
l.116 ...mainfont[Ligatures=TeX]{TeX Gyre Pagella}
No pages of output.
Transcript written on 3bpbqyzchjg759snvaz5zr8dhjy162gz-thesis.log.
Collected error summary (may duplicate other messages):
xelatex: Command for 'xelatex' gave return code 1
Refer to '3bpbqyzchjg759snvaz5zr8dhjy162gz-thesis.log' for details
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
=== TeX engine is 'XeTeX'
Latexmk: Errors, so I did not complete making targets |
Interestingly enough,
|
The second issue you mention is a little bizzare. The first issue, that |
It does include OTF on CTAN: https://www.ctan.org/texarchive/fonts/tex-gyre/fonts/opentype/public/tex-gyre. Edit: So does nixpkgs: ls (find (nix-build -E 'with import <nixpkgs> {}; texlive.combine { inherit (texlive) scheme-basic tex-gyre tex-gyre-math; }') -name opentype)/public/*
/nix/store/77iffrgw53vkwpb92lg0abzl1kc3bv6f-texlive-combined-2017/share/texmf/fonts/opentype/public/tex-gyre:
texgyreadventor-bolditalic.otf texgyrebonum-bold.otf texgyrecursor-bold.otf texgyreheroscn-bolditalic.otf texgyreheros-regular.otf texgyreschola-bolditalic.otf texgyretermes-bold.otf
texgyreadventor-bold.otf texgyrebonum-italic.otf texgyrecursor-italic.otf texgyreheroscn-bold.otf texgyrepagella-bolditalic.otf texgyreschola-bold.otf texgyretermes-italic.otf
texgyreadventor-italic.otf texgyrebonum-regular.otf texgyrecursor-regular.otf texgyreheroscn-italic.otf texgyrepagella-bold.otf texgyreschola-italic.otf texgyretermes-regular.otf
texgyreadventor-regular.otf texgyrechorus-mediumitalic.otf texgyreheros-bolditalic.otf texgyreheroscn-regular.otf texgyrepagella-italic.otf texgyreschola-regular.otf
texgyrebonum-bolditalic.otf texgyrecursor-bolditalic.otf texgyreheros-bold.otf texgyreheros-italic.otf texgyrepagella-regular.otf texgyretermes-bolditalic.otf
/nix/store/77iffrgw53vkwpb92lg0abzl1kc3bv6f-texlive-combined-2017/share/texmf/fonts/opentype/public/tex-gyre-math:
texgyrebonum-math.otf texgyredejavu-math.otf texgyrepagella-math.otf texgyreschola-math.otf texgyretermes-math.otf And the font names seem to match:
I would understand if it could not load the OTF files not in fontconfig but it can still find Maybe @Witiko will know something more? Witiko/fithesis@79ce60c#diff-15fec5e8e22ba5674ee44b51beba6c3aR176 |
There is a difference between XeLaTeX and LuaLaTeX in how they handle OpenType font files. LuaTeX features its own font loader, whereas XeLaTeX defers to the system font loader (e.g. Fontconfig on Linux). Therefore, it is not enough for XeLaTeX to include the otf files in the TeX Live installation, the system font loader needs to be aware of these files as well. |
@Witiko That makes sense, except for that it works for |
I am not sure I completely understand the report, but to me the issue seems to be the following:
For more information on the font loader, please refer to sections 1.1 and 1.2 of the fontspec package manual. |
This is the piece I was missing. Now it makes sense. I would actually prefer to use Fontconfig even for the Math fonts, since that is how I handle all other fonts. Would it be possible to change the file name to the |
Actually, I would much rather circumvent Fontconfig altogether and load even the text fonts by their file names. The CTAN font file names rarely change, but the font loader can be easily broken (e.g. by removing the |
Motivation for this change
For some reason, TeX Gyre Pagella is not recognized by
texlive.fithesis
whentexlive.tex-gyre
is used.cc @siddharthist who maintains the Math variants.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)