Skip to content

Instantly share code, notes, and snippets.

@remlapmot
Created December 8, 2022 18:15
Show Gist options
  • Save remlapmot/b3d3839d4dbbc04ce9d8970e9780424e to your computer and use it in GitHub Desktop.
Save remlapmot/b3d3839d4dbbc04ce9d8970e9780424e to your computer and use it in GitHub Desktop.
Use external Ghostscript in TinyTeX i.e. TeXLive on Windows; Filepath: %appdata%/TinyTeX
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
OSFONTDIR = $SystemRoot/fonts//;$LOCALAPPDATA/Microsoft/Windows/Fonts//
ASYMPTOTE_HOME = $TEXMFCONFIG/asymptote
TEXMFHOME = $TEXMFLOCAL
TEXMFVAR = $TEXMFSYSVAR
TEXMFCONFIG = $TEXMFSYSCONFIG
% Prefer external Perl for third-party TeXLive Perl scripts
% Was set to 1 if at install time a sufficiently recent Perl was detected.
TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0
max_print_line = 10000
TEXMFAUXTREES = C:/PROGRA~1/R/R-42~1.2/share/texmf,
TEXLIVE_WINDOWS_EXTERNAL_GS = C:/Program Files (x86)/gs/gs9.56.1/bin/gswin32c.exe
@remlapmot
Copy link
Author

Seems to fix problem with fonts (the base 35 Ghostscript fonts) not being including in output from pdfcrop.exe.

Also important that it's a 32bit gswin32c.exe that's linked to (I think - well the other TeXLive executables are currently 32 bit).

@remlapmot
Copy link
Author

remlapmot commented Dec 12, 2022

Alternative fix; make symbolic links in TeXLive Ghostscript locations to files/directories in the standard Ghostscript installation (the TinyTeX\tlpkg\tlgs\Resource\Font directory only contains a README file, so doesn't matter if that's deleted before making the directory symbolic link).

mklink %APPDATA%\TinyTeX\tlpkg\tlgs\Resource\Init\Fontmap "%ProgramFiles(x86)%\gs\gs9.56.1\Resource\Init\Fontmap"
mklink %APPDATA%\TinyTeX\tlpkg\tlgs\Resource\Init\Fontmap.GS "%ProgramFiles(x86)%\gs\gs9.56.1\Resource\Init\Fontmap.GS"
rd /s /q %APPDATA%\TinyTeX\tlpkg\tlgs\Resource\Font
mklink /d %APPDATA%\TinyTeX\tlpkg\tlgs\Resource\Font "%ProgramFiles(x86)%\gs\gs9.56.1\Resource\Font"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment