latex-setup

My personal LaTeX setup 🦁️⚙️

xexercise.sty (783B)

 1 \NeedsTeXFormat{LaTeX2e}[1994/06/01]
 2 \ProvidesPackage{xexercise}[2020/09/10 1.0.0 Usefull definitions for exercise solutions]
 3 
 4 \RequirePackage{enumitem}
 5 \RequirePackage{kvoptions}
 6 
 7 \SetupKeyvalOptions{
 8   family=xexercise,
 9   prefix=xexercise@
10 }
11 
12 \DeclareStringOption[Exercise]{exerciselabel}
13 \ProcessKeyvalOptions*
14 
15 \newcounter{exercise}
16 \stepcounter{exercise}
17 
18 % Option to reset the exercise label
19 \newcommand{\setexerciselabel}[1]
20   {\renewcommand{\xexercise@exerciselabel}{#1}}
21 
22 % Exercise
23 \newenvironment{exercise}[1][\theexercise]
24   {\vspace{2mm}\noindent {\bfseries \xexercise@exerciselabel\, #1. }}
25   {\stepcounter{exercise}}
26 
27 % Exercise items ((a), (b), (c), ...)
28 \newenvironment{exerciseitems}
29   {\begin{enumerate}[label={\bfseries(\alph*)}]}
30   {\end{enumerate}}
31 
32 \endinput
33