TexLive: Difference between revisions
imported>StefanSchroeder Restructured table for TeXlive schemes and added another troubleshooting entry. |
Use withPackages to follow the new changes in 23.11, as well as the new names for schemes |
||
| (9 intermediate revisions by 6 users not shown) | |||
| Line 7: | Line 7: | ||
organization of TeX Live into 'schemes' and 'collections' | organization of TeX Live into 'schemes' and 'collections' | ||
The following Tex Live schemes are available: | The following Tex Live schemes are available, inspect <code>texlive.schemes</code> for full list: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name of TeX Live package | ! Name of TeX Live package | ||
! Name of | ! Name of NixOS-derivation | ||
! Comment | ! Comment | ||
|- | |- | ||
|width=20% valign=top| Scheme-full | |width=20% valign=top| Scheme-full | ||
|width=50% valign=top| <code>nixpkgs. | |width=50% valign=top| <code>nixpkgs.texliveFull</code> | ||
|width=30% valign=top| Contains every TeX Live package | |width=30% valign=top| Contains every TeX Live package | ||
|- | |- | ||
| Scheme-medium | | Scheme-medium | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveMedium</code> | ||
| contains everything in the small scheme + more packages and languages | | contains everything in the small scheme + more packages and languages | ||
|- | |- | ||
| Scheme-small | | Scheme-small | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveSmall</code> | ||
| contains everything in the basic scheme + xetex, metapost, a few languages. | | contains everything in the basic scheme + xetex, metapost, a few languages. | ||
|- | |- | ||
| Scheme-basic | | Scheme-basic | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveBasic</code> | ||
| contains everything in the plain scheme but includes latex. | | contains everything in the plain scheme but includes latex. | ||
|- | |- | ||
| Scheme-minimal | | Scheme-minimal | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveMinimal</code> | ||
| contains plain only. | | contains plain only. | ||
|- | |- | ||
| Scheme-teTeX | | Scheme-teTeX | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveTeTex</code> | ||
| contains more than the medium scheme, but nowhere near the full scheme. | | contains more than the medium scheme, but nowhere near the full scheme. | ||
|- | |- | ||
| Scheme-ConTeXt | | Scheme-ConTeXt | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveConTeXt</code> | ||
| contains ConTeXt | | contains ConTeXt | ||
|- | |- | ||
| Scheme-GUST | | Scheme-GUST | ||
| <code>nixpkgs. | | <code>nixpkgs.texliveGUST</code> | ||
| contains gust | | contains gust | ||
|} | |} | ||
| Line 51: | Line 51: | ||
You can install a set with extra packages by using something like | You can install a set with extra packages by using something like | ||
<code>( | <code>(texliveMedium.withPackages (ps: with ps;[xifthen ifmtarg framed paralist titlesec])) | ||
</code> | </code> | ||
For a minimal set of packages needed for Emacs Orgmode, as described in org-latex-default-packages-alist variable, install these packages: | |||
<pre> | |||
{ config, pkgs, ... }: | |||
let | |||
tex = (pkgs.texliveBasic.withPackages ( | |||
ps: with ps; [ | |||
dvisvgm dvipng # for preview and export as html | |||
wrapfig amsmath ulem hyperref capt-of | |||
#(setq org-latex-compiler "lualatex") | |||
#(setq org-preview-latex-default-process 'dvisvgm) | |||
])); | |||
in | |||
{ # home-manager | |||
home.packages = with pkgs; [ | |||
tex | |||
]; | |||
} | |||
</pre> | |||
== Adding a Custom Package == | |||
If you have a custom LaTeX package or style file that is not part of the TeXLive distribution, you can add it to the package set like this: | |||
First, create a derivation for your package. The contents of <code>$out/tex</code> will later be placed in <code>texmf/tex</code> | |||
latex-corporate-identity = pkgs.stdenvNoCC.mkDerivation { | |||
name = "latex-corporate-identity"; | |||
src = ./path/to/package/tree; | |||
installPhase = "cp -r $src $out"; | |||
passthru.tlType = "run"; | |||
}; | |||
texlive-corporate-identity = { | |||
pkgs = [ latex-corporate-identity ]; | |||
}; | |||
The directory tree under the path specified as src looks like this: | |||
└── tex | |||
└── latex | |||
└── corporate-identity | |||
├── corporate-identity.sty | |||
You can now add the package to the combined set as you would with any other texlive package: | |||
tex =(pkgs.texlive.withPackages ( | |||
ps: with ps; [ | |||
texlive-corporate-identity | |||
])); | |||
== Troubleshooting == | == Troubleshooting == | ||
| Line 63: | Line 106: | ||
If you get an error message saying “Invalid fontname ‘Latin Modern Roman/ICU’. . . ”, then you need to add the | If you get an error message saying “Invalid fontname ‘Latin Modern Roman/ICU’. . . ”, then you need to add the | ||
entry | entry '''lmodern''' into your configuration in the section '''fonts.fonts''' and rebuild. | ||
| Line 69: | Line 112: | ||
* [https://www.tug.org/texlive/doc/texlive-en/texlive-en.html The Tex Live Guide 2018] | * [https://www.tug.org/texlive/doc/texlive-en/texlive-en.html The Tex Live Guide 2018] | ||
* [[Tex]] in NixOS-Wiki | * [[Tex]] in NixOS-Wiki | ||
* [https://flyx.org/nix-flakes-latex/ Building LaTeX Documents Reproducibly with Nix Flakes] | |||
[[Category:Applications]] | |||