diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/thucoursework/iidef.sty | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/thucoursework/iidef.sty b/Master/texmf-dist/tex/latex/thucoursework/iidef.sty new file mode 100644 index 00000000000..bf20d1d025c --- /dev/null +++ b/Master/texmf-dist/tex/latex/thucoursework/iidef.sty @@ -0,0 +1,136 @@ +%% GPL v2.1 +%% version 2.3 +%% UPDATE: 30/03/2018 by zhaofeng-shu33 +%% This package requires package kvoptions,enumitems +\ProvidesPackage{iidef} +% semester +\def\@term{term} +\newcommand{\theterm}[1]{\renewcommand\@term{#1}} +% institute +\newcommand{\@courseinstitute}[1]{institute} +\newcommand{\thecourseinstitute}[1]{\renewcommand\@courseinstitute{#1}} +% coursename +\newcommand{\@coursename}[1]{coursename} +\newcommand{\thecoursename}[1]{\renewcommand\@coursename{\textsc{#1}}} + +% configuration of nested enumerate env +\RequirePackage{enumitem} +% set hwcount key-value option +\RequirePackage{kvoptions} +% required by macro DeclareMathOperator +\RequirePackage{amsmath} + +% \iidef@thehwcnt = 1 +\DeclareStringOption[1]{thehwcnt} + +\ProcessKeyvalOptions* +\def\thehwcnt{\iidef@thehwcnt} +% enumitem related configuration +\setlist[enumerate,1]{label=\thehwcnt.\arabic*.} +\setlist[enumerate,2]{label=(\alph*)} +\setlist[enumerate,3]{label=\roman*.} +\setlist[enumerate,4]{label=\greek*)} + +% user can rewrite homework name +\def\@hwname{Homework} +\def\hwname#1{\renewcommand\@hwname{#1}} + +% page header setup, distinguish between first page(plain style) and second page on (runningpage style) +%***************************************************************************************************** +\newcommand{\courseheader}{ +\thispagestyle{plain}%first page use native plain style to suppress header +\vspace*{-1in} +\begin{center} +\@courseinstitute\\ +\@coursename\\ +\@term +\vspace*{0.1in} +\hrule +\end{center} +\begin{center} + \underline{\bf \@hwname\;\thehwcnt} \\ +\end{center} +} +% Set up page headers using with fancyhdr +\RequirePackage{fancyhdr} +\fancypagestyle{runningpage} +{ + \fancyhead[L]{\small\@coursename} + \fancyhead[R]{\small\@courseinstitute} +} +% use runningpage style from second page on +\pagestyle{runningpage} +% ********************************************************************************************* + +%common math symbols go here +%************************************************* +\def\v#1{\underline{#1}} +\newcommand{\uc}{\underline{c}} % c, vec +\newcommand{\uv}{\underline{v}} % x, vec +\newcommand{\uw}{\underline{w}} % w, vec +\newcommand{\ux}{\underline{x}} % x, vec +\newcommand{\uy}{\underline{y}} % y, vec +\newcommand{\uz}{\underline{z}} % z, vec +\newcommand{\um}{\underline{m}} % m, vec +\newcommand{\rvx}{\mathsf{x}} % x, r.v. +\newcommand{\rvy}{\mathsf{y}} % y, r.v. +\newcommand{\rvz}{\mathsf{z}} % z, r.v. +\newcommand{\rvw}{\mathsf{w}} % w, r.v. +\newcommand{\rvH}{\mathsf{H}} % H, r.v. +\newcommand{\urvx}{\underline{\mathsf{x}}} % x, r.v. vec +\newcommand{\urvy}{\underline{\mathsf{y}}} % y, r.v. vec +\newcommand{\urvz}{\underline{\mathsf{z}}} % z, r.v. vec +\newcommand{\urvw}{\underline{\mathsf{w}}} % w, r.v. vec + +\newcommand{\defas}{\triangleq} %\coloneqq +\newcommand{\reals}{\mathbb{R}} +\newcommand{\TT}{\mathrm{T}} % transpose +\DeclareMathOperator*{\argmax}{arg\,max} +\DeclareMathOperator*{\argmin}{arg\,min} +\DeclareMathOperator*{\argsup}{arg\,sup} +\DeclareMathOperator*{\arginf}{arg\,inf} +\DeclareMathOperator{\diag}{diag} +\DeclareMathOperator{\Var}{Var} +\DeclareMathOperator{\Cov}{Cov} +\DeclareMathOperator{\MSE}{MSE} +\DeclareMathOperator{\1}{\mathds{1}} +\DeclareMathOperator{\In}{\mathbb{I}} +\DeclareMathOperator{\E}{\mathbb{E}} +\DeclareMathOperator{\Prob}{\mathbb{P}} +\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} +\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}} +%************************************************************************************ + +%name command macro +%************************* +\newcommand{\name}[1]{ +\begin{flushleft} + #1\hfill + \today +\end{flushleft} +\hrule + +\vspace{2em} + +\flushleft +} +%************************* + +%define the solution env with amsthm proof +%****************************** +\RequirePackage{amsthm} + +\def\@slname{Solution} +\def\slname#1{\renewcommand\@slname{#1}} + +\newenvironment{solution} +{ +\proof[\@slname] +} +{ +% no qed symbol in solution env +\renewcommand{\qedsymbol}{} +\endproof +} +%****************************** +\endinput |