diff --git a/nvim/ultisnips/tex.snippets b/nvim/ultisnips/tex.snippets index d69501d..77091d1 100644 --- a/nvim/ultisnips/tex.snippets +++ b/nvim/ultisnips/tex.snippets @@ -784,7 +784,7 @@ if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: snip.rv = ' ' else: snip.rv = '' -`$2 +`$3 endsnippet snippet dc "Block Code" wA diff --git a/tex/booknotes.cls b/tex/booknotes.cls index 1660dad..f3a7b16 100644 --- a/tex/booknotes.cls +++ b/tex/booknotes.cls @@ -2,6 +2,7 @@ \ProvidesClass{booknotes} \LoadClass[twoside]{report} +\RequirePackage{tex-macros} \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{stmaryrd} @@ -47,18 +48,6 @@ \RequirePackage[framemethod=TikZ]{mdframed} \mdfsetup{skipabove=1em, skipbelow=0em, innertopmargin=5pt, innerbottommargin=6pt} -\newcommand\N{\ensuremath{\mathbb{N}}} -\newcommand\R{\ensuremath{\mathbb{R}}} -\newcommand\Z{\ensuremath{\mathbb{Z}}} -\newcommand\Q{\ensuremath{\mathbb{Q}}} -\newcommand\C{\ensuremath{\mathbb{C}}} - -\let\sidesum\sum% -\let\sidelim\lim% -\renewcommand\sum{\sidesum\limits} -\renewcommand\lim{\sidelim\limits} - - \theoremstyle{definition} \makeatletter @@ -299,13 +288,13 @@ } } -\newcommand{\exercise}[1]{% - \def\@exercise{#1}% - \subsection*{Exercise #1} +\newcommand{\exercise}[2][]{% + \def\@exercise{#2}% + \subsection*{Exercise #2. #1} } -\newcommand{\subexercise}[1]{% - \subsubsection*{Exercise \@exercise.#1} +\newcommand{\subexercise}[2][]{% + \subsubsection*{Exercise \@exercise.#2. #1} } \newcommand{\sect}[1]{ @@ -336,12 +325,5 @@ \import{./figures/}{#1.pdf_tex} } -\DeclareMathOperator{\GL}{GL} -\DeclareMathOperator{\Imm}{Im} -\DeclareMathOperator{\Ker}{Ker} -\DeclareMathOperator{\Aut}{Aut} -\DeclareMathOperator{\Hom}{Hom} -\DeclareMathOperator{\Hol}{Hol} - \makeatother diff --git a/tex/handout.cls b/tex/handout.cls index d85db16..de8d15d 100644 --- a/tex/handout.cls +++ b/tex/handout.cls @@ -1,6 +1,7 @@ \ProvidesClass{handout} \LoadClass{scrartcl} +\RequirePackage{tex-macros} \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{stmaryrd} @@ -47,18 +48,6 @@ \RequirePackage[framemethod=TikZ]{mdframed} \mdfsetup{skipabove=1em, skipbelow=0em, innertopmargin=5pt, innerbottommargin=6pt} -\newcommand\N{\ensuremath{\mathbb{N}}} -\newcommand\R{\ensuremath{\mathbb{R}}} -\newcommand\Z{\ensuremath{\mathbb{Z}}} -\newcommand\Q{\ensuremath{\mathbb{Q}}} -\newcommand\C{\ensuremath{\mathbb{C}}} - -\let\sidesum\sum% -\let\sidelim\lim% -\renewcommand\sum{\sidesum\limits} -\renewcommand\lim{\sidelim\limits} - - \theoremstyle{definition} \makeatletter @@ -302,13 +291,13 @@ } } -\newcommand{\exercise}[1]{% - \def\@exercise{#1}% - \subsection*{Exercise #1} +\newcommand{\exercise}[2][]{% + \def\@exercise{#2}% + \subsection*{Exercise #2. #1} } -\newcommand{\subexercise}[1]{% - \subsubsection*{Exercise \@exercise.#1} +\newcommand{\subexercise}[2][]{% + \subsubsection*{Exercise \@exercise.#2. #1} } \newcommand{\sect}[1]{ @@ -342,14 +331,6 @@ \import{./figures/}{#1.pdf_tex} } - -\DeclareMathOperator{\GL}{GL} -\DeclareMathOperator{\Imm}{Im} -\DeclareMathOperator{\Ker}{Ker} -\DeclareMathOperator{\Aut}{Aut} -\DeclareMathOperator{\Hom}{Hom} -\DeclareMathOperator{\Hol}{Hol} - \pagestyle{fancy} \fancyhead[L]{\@title} \fancyhead[R]{\@section} diff --git a/tex/homework.cls b/tex/homework.cls index a461a3d..a404dbb 100644 --- a/tex/homework.cls +++ b/tex/homework.cls @@ -50,6 +50,15 @@ \geometry{top=20mm,bottom=20mm} + +\usemintedstyle{bw} + +\newenvironment{code}[1]{\VerbatimEnvironment\begin{minted}[frame=lines,framesep=7pt, linenos, breaklines]{#1}}{\end{minted}} + +\newcommand{\inlinecode}[2]{\mintinline{#1}|#2|} + +\newcommand{\importcode}[2]{\inputminted[frame=lines, framesep=7pt, linenos, breaklines]{#1}{#2}} + \newcommand{\specialquote}[2] { \begin{flushright} diff --git a/tex/notes.cls b/tex/notes.cls index 6910ec8..12fc49e 100644 --- a/tex/notes.cls +++ b/tex/notes.cls @@ -1,6 +1,7 @@ \ProvidesClass{notes} \LoadClass{article} +\RequirePackage{tex-macros} \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{stmaryrd} @@ -46,17 +47,6 @@ \RequirePackage[framemethod=TikZ]{mdframed} \mdfsetup{skipabove=1em, skipbelow=0em, innertopmargin=5pt, innerbottommargin=6pt} -\newcommand\N{\ensuremath{\mathbb{N}}} -\newcommand\R{\ensuremath{\mathbb{R}}} -\newcommand\Z{\ensuremath{\mathbb{Z}}} -\newcommand\Q{\ensuremath{\mathbb{Q}}} -\newcommand\C{\ensuremath{\mathbb{C}}} - -\let\sidesum\sum% -\let\sidelim\lim% -\renewcommand\sum{\sidesum\limits} -\renewcommand\lim{\sidelim\limits} - \theoremstyle{definition} \makeatletter @@ -298,13 +288,13 @@ } } -\newcommand{\exercise}[1]{% - \def\@exercise{#1}% - \subsection*{Exercise #1} +\newcommand{\exercise}[2][]{% + \def\@exercise{#2}% + \subsection*{Exercise #2. #1} } -\newcommand{\subexercise}[1]{% - \subsubsection*{Exercise \@exercise.#1} +\newcommand{\subexercise}[2][]{% + \subsubsection*{Exercise \@exercise.#2. #1} } \newcommand{\sect}[1]{ @@ -341,12 +331,5 @@ \newcommand{\toc}{\tableofcontents\raggedbottom} -\DeclareMathOperator{\GL}{GL} -\DeclareMathOperator{\Imm}{Im} -\DeclareMathOperator{\Ker}{Ker} -\DeclareMathOperator{\Aut}{Aut} -\DeclareMathOperator{\Hom}{Hom} -\DeclareMathOperator{\Hol}{Hol} - \makeatother diff --git a/tex/tex-macros.sty b/tex/tex-macros.sty new file mode 100644 index 0000000..af4be23 --- /dev/null +++ b/tex/tex-macros.sty @@ -0,0 +1,24 @@ +\ProvidesPackage{tex-macros} + +\RequirePackage{amsmath} + +\let\sidesum\sum% +\let\sidelim\lim% +\renewcommand\sum{\sidesum\limits} +\renewcommand\lim{\sidelim\limits} +\newcommand{\problem}[1]{\subsection*{#1.}} +\newcommand{\pbl}[1]{\subsection*{#1.}} +\newcommand{\N}{\ensuremath{\mathbb{N}}} +\newcommand{\Z}{\ensuremath{\mathbb{Z}}} +\newcommand{\R}{\ensuremath{\mathbb{R}}} +\newcommand{\Q}{\ensuremath{\mathbb{Q}}} +\newcommand\C{\ensuremath{\mathbb{C}}} + + +\DeclareMathOperator{\GL}{GL} +\DeclareMathOperator{\Imm}{Im} +\DeclareMathOperator{\Ker}{Ker} +\DeclareMathOperator{\Aut}{Aut} +\DeclareMathOperator{\Hom}{Hom} +\DeclareMathOperator{\Hol}{Hol} +\DeclareMathOperator{\Arg}{Arg} diff --git a/zshenv b/zshenv index 2b166d5..aa94060 100644 --- a/zshenv +++ b/zshenv @@ -38,7 +38,7 @@ export MOZILLA_HOME="$XDG_DATA_HOME"/mozilla export SPOTIFY_HOME="$HOME"/media/spotify export KRUNKER_HOME="$HOME"/media/games/krunker export FEH_HOME="$HOME"/.config/feh/ -export R_HOME="$HOME"/.local/share/R +# export R_HOME="$HOME"/.local/share/R export R_HOME_DIR="$HOME"/.local/share/R export SCREENSHOT_HOME="$HOME"/media/images