{ config, lib, pkgs, ... }:

let cfg = config.sydnix.users.msyds.emacs.tufte-latex;
in {
  options.sydnix.users.msyds.emacs.tufte-latex = {
    enable = lib.mkEnableOption "Tufte LaTeX";
  };

  config = lib.mkIf cfg.enable {
    sydnix.emacs.tex.extraTexPackages = {
      inherit (pkgs.texlive)
        tufte-latex
        xkeyval
        changepage
        fancyhdr
        geometry
        natbib
        paralist
        placeins
        ragged2e
        setspace
        textcase
        titlesec
        xcolor
        hardwrap
        xifthen
        catchfile
        ;
    };
  };
}
