TexLive: Difference between revisions

imported>2r
add packages for preview latex segments
Add a section on adding a custom package to the combined package set
 
(2 intermediate revisions by 2 users not shown)
Line 64: Line 64:
       dvisvgm dvipng # for preview and export as html
       dvisvgm dvipng # for preview and export as html
       wrapfig amsmath ulem hyperref capt-of;
       wrapfig amsmath ulem hyperref capt-of;
    # support org mode latex export
      #(setq org-latex-compiler "lualatex")
      #(setq org-preview-latex-default-process 'dvisvgm)
   });
   });
in
in
Line 73: Line 74:
}
}
</pre>
</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.combine {
  inherit (pkgs.texlive) scheme-full;
  inherit texlive-corporate-identity;
};


== Troubleshooting ==
== Troubleshooting ==
Line 88: Line 115:
* [[Tex]] in NixOS-Wiki
* [[Tex]] in NixOS-Wiki
* [https://flyx.org/nix-flakes-latex/ Building LaTeX Documents Reproducibly with Nix Flakes]
* [https://flyx.org/nix-flakes-latex/ Building LaTeX Documents Reproducibly with Nix Flakes]
[[Category:Applications]]