%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% seu-ml-assign.cls %% %% %% %% ================================================== %% %% %% %% Version: 1.1 (2022/03/28) %% %% Author: Teddy van Jerry (Wuqiong Zhao) %% %% License: MIT LICENSE %% %% GitHub Repo: https://tvj.one/ml-tex %% %% Compiler: latex, pdflatex, xelatex, lualatex %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{seu-ml-assign}[2022/03/28 SEU Machine Learning Assignment Template] %% Class and Options \def\@@ptsize{10pt} % font size \DeclareOption{9pt}{\def\@@ptsize{9pt}} \DeclareOption{10pt}{\def\@@ptsize{10pt}} \DeclareOption{11pt}{\def\@@ptsize{11pt}} \DeclareOption{12pt}{\def\@@ptsize{12pt}} \def\@@solutionmode{1} % default as the solution mode \DeclareOption{solution}{\def\@@solutionmode{1}} % solution mode \DeclareOption{problem}{\def\@@solutionmode{0}} % problem mode \def\@twoside{0} % default as oneside \DeclareOption{oneside}{\def\@twoside{0}} % one-side document \DeclareOption{twoside}{\def\@twoside{1}} % two-side document \ProcessOptions\relax \LoadClass[a4paper,onecolumn,\@@ptsize]{article} %% Page Settings \RequirePackage[inner=2.0cm,outer=2.0cm,top=1.2cm,bottom=3.5cm]{geometry} \newcommand{\firstfooteradditionalheight}{2em} % additional height for footer on the first page \hfuzz=.5em % disable false positive of overfull \hbox %% Document Propertities \global\let\@assignno\@empty \global\let\@semester\@empty \global\let\@studentID\@empty \global\let\@instructor\@empty \global\let\@duedate\@empty \global\let\@author\@empty \global\let\@mainproblem\@empty \newcommand{\assignno}[1]{\gdef\@assignno{#1}} % Assignment Number \newcommand{\semester}[1]{\gdef\@semester{#1}} % Semester \newcommand{\studentID}[1]{\gdef\@studentID{#1}} % Student ID \newcommand{\instructor}[1]{\gdef\@instructor{#1}} % Instructor \newcommand{\duedate}[1]{\gdef\@duedate{#1}} % Due Date of the Assignment \newcommand{\mainproblem}[1]{\gdef\@mainproblem{#1}} % The main problem of the assignment %% Fonts and Colors \RequirePackage[T1]{fontenc} \RequirePackage[usenames,dvipsnames]{xcolor} %% TikZ Rule \RequirePackage{tikz} \usetikzlibrary{fadings, calc} \newcommand{\tikzrule}[3][]{\tikz{\fill[#1] (0,0) rectangle (#2,#3);}} %% Sections Settings \RequirePackage[explicit]{titlesec} % explained in https://tex.stackexchange.com/a/292307/234654 \RequirePackage{suffix} % http://mirrors.ctan.org/macros/latex/contrib/titlesec/titlesec.pdf \pgfdeclarelayer{background} \pgfsetlayers{background,main} \global\let\@problempts\@empty \newcommand{\problempts}[1]{\gdef\@problempts{#1}} % Points of the Problem \newcommand{\problemptsprint}{\ifx\@problempts\@empty\else(\@problempts~points)\fi} \newcommand{\sectionheadname}{Problem} % Name for the Section (default as 'Problem') % Reference: https://tex.stackexchange.com/a/12269/234654 \newcommand{\boxedsection}[4][blue!20]{{% \begin{tikzpicture}[inner sep=0pt, inner ysep=0.3ex] \node[anchor=base west] at (0,0) (counter) {#2}; \path let \p1 = (counter.base east) in node[anchor=base west, text width={\textwidth-\x1-#4}] (content) at ($(counter.base east)+(#4,0)$) {#3}; \begin{pgfonlayer}{background} \shade[left color=#1,right color=white] let \p1=(counter.north), \p2=(content.north) in (0,{max(\y1,\y2)}) rectangle (content.south east); \end{pgfonlayer} \end{tikzpicture} }} % For numbered section, i.e. \section{} \titleformat{\section}% {\Large\bfseries}% {}%