From 9fa3738a041aa03ab24a4c82aa312e84703c4b99 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 20 Mar 2022 21:16:16 +0000 Subject: seu-ml-assign (20mar22) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62835 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/seu-ml-assign/seu-ml-assign.cls | 298 +++++++++++++++++++++ 1 file changed, 298 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/seu-ml-assign/seu-ml-assign.cls (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/seu-ml-assign/seu-ml-assign.cls b/Master/texmf-dist/tex/latex/seu-ml-assign/seu-ml-assign.cls new file mode 100644 index 00000000000..eedc7c2f0b5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/seu-ml-assign/seu-ml-assign.cls @@ -0,0 +1,298 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% seu-ml-assign.cls %% +%% %% +%% ================================================== %% +%% %% +%% Version: 1.0 (2022/03/20) %% +%% Author: Teddy van Jerry (Wuqiong Zhao) %% +%% License: MIT LICENSE %% +%% GitHub Repo: https://tvj.one/ml-tex %% +%% Compiler: pdflatex, xelatex, lualatex %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{seu-ml-assign}[2022/02/20 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 +\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 +\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 + +%% 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 +% 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}[3][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-0.33em}] (content) + at ($(counter.base east)+(0.33em,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} +}} +% \titleformat{} +% []{}{