diff --git a/flake.nix b/flake.nix index 5bc52ef..135f70e 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ''; }; diff --git a/maths/cheatsheet.tex b/maths/cheatsheet.tex new file mode 100644 index 0000000..0bc625d --- /dev/null +++ b/maths/cheatsheet.tex @@ -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} diff --git a/scripts/.zshrc b/scripts/.zshrc index 0092162..ecaee24 100644 --- a/scripts/.zshrc +++ b/scripts/.zshrc @@ -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 diff --git a/scripts/functions.sh b/scripts/functions.sh index 90532ef..2e1c4e4 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -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 diff --git a/scripts/mathfunctions.sh b/scripts/mathfunctions.sh index 5c951a0..5ee2ef2 100644 --- a/scripts/mathfunctions.sh +++ b/scripts/mathfunctions.sh @@ -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" | \