Add latex and math setup to flake.nix

This commit is contained in:
Sameer Rahmani 2024-01-28 22:01:19 +00:00
parent eeb858aec8
commit 8f46ca7744
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
5 changed files with 74 additions and 13 deletions

View File

@ -203,6 +203,30 @@
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; [
idris2
agda
@ -211,8 +235,10 @@
zsh-autosuggestions
zsh-autocomplete
zsh-syntax-highlighting
tex
]);
in {
inherit pkgs;
devShells.default = (pkgs.mkShell.override { stdenv = stdenv';}) {
@ -227,10 +253,11 @@
# This shell is gcc based and we use it only
# for the mathematics side of our design
devShells.math = nativePkgs.mkShell {
nativeBuildInputs = mathDeps;
#nativeBuildInputs = mathDeps;
buildInputs = mathDeps;
shellHook =
''
BUILDER=math ZDOTDIR=${zshDir} zsh -d -i && exit
BUILDER=Math ZDOTDIR=${zshDir} zsh -d && exit
'';
};

27
maths/cheatsheet.tex Normal file
View File

@ -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}

View File

@ -67,7 +67,7 @@ zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
echo "Welcome to serene's development environment"
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'
@ -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)
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"
builder="${BUILDER:l}"
. "$ME/scripts/${BUILDER}functions.sh"
. "$ME/scripts/${builder}functions.sh"
export PROMPT

View File

@ -53,14 +53,6 @@ if [[ "$CXX" = "" ]]; then
export CXX
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
# like running the test cases

View File

@ -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
echo "Commands:"
grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$ME/scripts/mathfunctions.sh" | \