Add latex and math setup to flake.nix
This commit is contained in:
parent
eeb858aec8
commit
8f46ca7744
31
flake.nix
31
flake.nix
|
@ -203,6 +203,30 @@
|
||||||
gbenchmark
|
gbenchmark
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tex = nativePkgs.texlive.combine {
|
||||||
|
inherit (nativePkgs.texlive)
|
||||||
|
scheme-minimal
|
||||||
|
latex-bin
|
||||||
|
latexmk
|
||||||
|
xelatex-dev
|
||||||
|
sourcesanspro
|
||||||
|
xkeyval
|
||||||
|
etoolbox
|
||||||
|
titlesec
|
||||||
|
fontspec
|
||||||
|
hyperref
|
||||||
|
mfirstuc
|
||||||
|
parskip
|
||||||
|
geometry
|
||||||
|
pdftexcmds
|
||||||
|
infwarerr
|
||||||
|
kvoptions
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
mathDeps = (with nativePkgs; [
|
mathDeps = (with nativePkgs; [
|
||||||
idris2
|
idris2
|
||||||
agda
|
agda
|
||||||
|
@ -211,8 +235,10 @@
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
zsh-autocomplete
|
zsh-autocomplete
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting
|
||||||
|
tex
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
devShells.default = (pkgs.mkShell.override { stdenv = stdenv';}) {
|
devShells.default = (pkgs.mkShell.override { stdenv = stdenv';}) {
|
||||||
|
@ -227,10 +253,11 @@
|
||||||
# This shell is gcc based and we use it only
|
# This shell is gcc based and we use it only
|
||||||
# for the mathematics side of our design
|
# for the mathematics side of our design
|
||||||
devShells.math = nativePkgs.mkShell {
|
devShells.math = nativePkgs.mkShell {
|
||||||
nativeBuildInputs = mathDeps;
|
#nativeBuildInputs = mathDeps;
|
||||||
|
buildInputs = mathDeps;
|
||||||
shellHook =
|
shellHook =
|
||||||
''
|
''
|
||||||
BUILDER=math ZDOTDIR=${zshDir} zsh -d -i && exit
|
BUILDER=Math ZDOTDIR=${zshDir} zsh -d && exit
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
\documentclass{article}
|
||||||
|
|
||||||
|
\title{Serene's mathematical cheatsheet}
|
||||||
|
\author{Sameer Rahmani}
|
||||||
|
\date{January 2024}
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\usepackage[default,light,semibold]{sourcesanspro}
|
||||||
|
\setsansfont{Source Sans Pro}
|
||||||
|
\usepackage{etoolbox}
|
||||||
|
\usepackage{titlesec}
|
||||||
|
\usepackage{fontspec}
|
||||||
|
\usepackage[left=0.6in,top=0.3in,right=0.6in,bottom=0.6in]{geometry} % Document margins
|
||||||
|
\usepackage{hyperref}
|
||||||
|
\usepackage{mfirstuc}
|
||||||
|
|
||||||
|
\edef\restoreparindent{\parindent=\the\parindent\relax}
|
||||||
|
\usepackage{parskip}
|
||||||
|
\restoreparindent{}
|
||||||
|
\pagestyle{empty}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\end{document}
|
|
@ -67,7 +67,7 @@ zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||||
echo "Welcome to serene's development environment"
|
echo "Welcome to serene's development environment"
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%F{015}[%F{099}SERENE%F{015}][%F{198}$(git branch --show-current)%F{015}]
|
%F{015}[%F{099}${BUILDER:-SERENE}%F{015}][%F{198}$(git branch --show-current)%F{015}]
|
||||||
%F{005}%~%F{003} $(user_prompt)%f'
|
%F{005}%~%F{003} $(user_prompt)%f'
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,10 +83,19 @@ echo -e "\nUse the 'help' command to view a list of helpers.\n"
|
||||||
ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P)
|
ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P)
|
||||||
export ME
|
export ME
|
||||||
|
|
||||||
|
BUILD_DIR_NAME="build"
|
||||||
|
export BUILD_DIR_NAME
|
||||||
|
|
||||||
|
BUILD_DIR="$ME/$BUILD_DIR_NAME"
|
||||||
|
export BUILD_DIR
|
||||||
|
|
||||||
|
SERENE_HOME_DIR="$HOME/.serene"
|
||||||
|
export SERENE_HOME_DIR
|
||||||
|
|
||||||
VERSION="0.9.0"
|
VERSION="0.9.0"
|
||||||
|
builder="${BUILDER:l}"
|
||||||
|
|
||||||
|
. "$ME/scripts/${builder}functions.sh"
|
||||||
. "$ME/scripts/${BUILDER}functions.sh"
|
|
||||||
|
|
||||||
|
|
||||||
export PROMPT
|
export PROMPT
|
||||||
|
|
|
@ -53,14 +53,6 @@ if [[ "$CXX" = "" ]]; then
|
||||||
export CXX
|
export CXX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR_NAME="build"
|
|
||||||
export BUILD_DIR_NAME
|
|
||||||
|
|
||||||
BUILD_DIR="$ME/$BUILD_DIR_NAME"
|
|
||||||
export BUILD_DIR
|
|
||||||
|
|
||||||
SERENE_HOME_DIR="$HOME/.serene"
|
|
||||||
export SERENE_HOME_DIR
|
|
||||||
|
|
||||||
# Serene subprojects. We use this array to run common tasks on all the projects
|
# Serene subprojects. We use this array to run common tasks on all the projects
|
||||||
# like running the test cases
|
# like running the test cases
|
||||||
|
|
|
@ -40,6 +40,12 @@ source "$ME/scripts/utils.sh"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function build-pdf() { ## Build the give tex file as pdf
|
||||||
|
rm -rf "$BUILD_DIR/maths/"
|
||||||
|
mkdir -p "$BUILD_DIR/maths/"
|
||||||
|
latexmk -f -xelatex -interaction=nonstopmode -output-directory="$BUILD_DIR/maths/" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
function help() { ## Print out this help message
|
function help() { ## Print out this help message
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$ME/scripts/mathfunctions.sh" | \
|
grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$ME/scripts/mathfunctions.sh" | \
|
||||||
|
|
Loading…
Reference in New Issue