Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \NeedsTeXFormat{LaTeX2e}
- \ProvidesClass{classwork}[2018/11/28 Kogasa's Classwork Class]
- \LoadClass{article}
- %Margins
- %\usepackage[margin=1in]{geometry}
- \usepackage[DIV=10,BCOR=2mm,headinclude=true,footinclude=false]{typearea}
- %Typical packages
- \usepackage{amsmath,amsthm,amssymb,amsfonts,multicol,afterpage,fancyhdr,environ,enumerate,turnstile,titling,xparse}
- %FONTS
- %-------------------------
- %https://tex.stackexchange.com/questions/82001/microtype-settings-for-dummies
- %http://www.khirevich.com/latex/microtype/
- \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true, factor=1100,stretch=10,shrink=10]{microtype}
- \usepackage[T1]{fontenc}
- %Prevents odd spacing message
- \microtypecontext{spacing=nonfrench}
- \SetProtrusion{encoding={*},family={*}, series={*},size={6,7}}
- {1={ ,750},2={ ,500},3={ ,500},4={ ,500},5={ ,500},
- 6={ ,500},7={ ,600},8={ ,500},9={ ,500},0={ ,500}}
- \SetExtraKerning[unit=space]
- {encoding={*}, family={*}, series={*}, size={footnotesize,small,normalsize}}
- {\textendash={400,400}, % en-dash, add more space around it
- "28={ ,150}, % left bracket, add space from right
- "29={150, }, % right bracket, add space from left
- \textquotedblleft={ ,150}, % left quotation mark, space from right
- \textquotedblright={150, }} % right quotation mark, space from left
- \SetExtraKerning[unit=space]
- {encoding={*}, family={*}, series={b}, size={large,Large}}
- {1={-200,-200},
- \textendash={400,400}}
- \SetTracking{encoding={*}, shape=sc}{40}
- \makeatletter
- \def\@maketitle{%
- \newpage
- \null
- \vskip 2em%
- \begin{center}%
- \let \footnote \thanks
- {\LARGE \bfseries \fontfamily{qhv}\selectfont \@title \par}%
- \vskip 1.5em%
- {\large
- \lineskip .5em%
- \begin{tabular}[t]{c}%
- \fontfamily{qhv}\selectfont \@author
- \end{tabular}\par}%
- \vskip 1em%
- {\large \fontfamily{qhv}\selectfont \@date}
- \end{center}%
- \par
- \vskip 1.5em}
- \makeatother
- \usepackage{titlesec,tocloft}
- \titleformat{\section}[hang]{
- \usefont{T1}{qhv}{b}{n}\selectfont} % "qhv" - TeX Gyre Heros, "b" - bold
- {}
- {0em}
- {\hspace{-0.4pt}\Large \thesection\hspace{0.6em}}
- \titleformat{\subsection}{
- \usefont{T1}{qhv}{b}{n}\selectfont} % "qhv" - TeX Gyre Heros, "b" - bold
- {}
- {0em}
- {\hspace{-0.4pt}\large \thesubsection\hspace{0.6em}}
- \titleformat{\subsubsection}{
- \usefont{T1}{qhv}{b}{n}\selectfont} % "qhv" - TeX Gyre Heros, "b" - bold
- {}
- {0em}
- {\thesubsubsection\hspace{0.6em}}
- \renewcommand{\cfttoctitlefont} % ToC title
- {\usefont{T1}{qhv}{b}{n}\selectfont\huge}
- \renewcommand{\cftsecfont} % section titles
- {\usefont{T1}{bch}{b}{n}\selectfont}
- \renewcommand{\cftsubsecfont} % subsection titles
- {\usefont{T1}{bch}{m}{n}\selectfont}
- \renewcommand{\cftsecpagefont} % section page numbers
- {\cftsecfont}
- \renewcommand{\cftsubsecpagefont} % subsection page numbers
- {\cftsubsecfont}
- \setcounter{tocdepth}{2}
- %Font Families -- https://math.ucsd.edu/~msharpe/RcntFnts.pdf
- \usepackage{textcomp}
- \usepackage{charter}
- %\usepackage[sb]{libertine}
- \usepackage[varqu,varl]{zi4}% inconsolata
- \usepackage[charter,vvarbb,scaled=1.05]{newtxmath} % bb from STIX
- %\usepackage[cal=boondoxo]{mathalfa} % mathcal
- %\useosf % osf for text, not math
- %\usepackage[supstfm=libertinesups,%
- %supscaled=1.2,%
- %raised=-.13em]{superiors}
- % Allows fonts to be rescaled arbitrarily without error messages
- \usepackage{type1ec}
- \renewcommand\epsilon{\varepsilon}
- %-----------------------
- % Useful math shorthand
- \newcommand{\N}{\mathbb{N}}
- \newcommand{\Z}{\mathbb{Z}}
- \newcommand{\R}{\mathbb{R}}
- \newcommand{\Q}{\mathbb{Q}}
- \newcommand{\C}{\mathbb{C}}
- \newcommand{\e}{\mathrm{e}}
- \newcommand{\T}{\mathcal{T}}
- \newcommand{\B}{\mathcal{B}}
- \newcommand{\normal}{\trianglelefteq}
- \DeclareMathOperator{\aut}{Aut}
- \DeclareMathOperator{\im}{im}
- \let\ker\relax
- \DeclareMathOperator{\ker}{ker}
- \DeclareMathOperator{\lcm}{lcm}
- \newcommand\blankpage{%
- \null
- \thispagestyle{empty}%
- \addtocounter{page}{-1}%
- \newpage}
- %CODE WILL NOT EXECUTE - OLD ENVIRONMENTS
- \iffalse
- \ExplSyntaxOn
- \NewDocumentEnvironment{definition} { o }
- { \begin{trivlist}
- \item \IfNoValueTF{#1} {{\fontfamily{qhv}\selectfont\textbf{\small Definition.}}\hskip
- \labelsep}{{\fontfamily{qhv}\selectfont\textbf{\small Definition~(#1).}}\hskip
- \labelsep}
- \ignorespaces
- }
- {\end{trivlist}}
- \ExplSyntaxOff
- \newenvironment{definition}[2][Definition]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries (#2).}]}{\end{trivlist}}
- \newenvironment{theorem}[2][Theorem]{\begin{trivlist}
- \item[\hskip \labelsep {{\fontfamily{qhv}\selectfont \small \bfseries #1}}\hskip \labelsep
- {{\fontfamily{qhv}\selectfont \small \bfseries #2.}}]\itshape}{\end{trivlist}}
- \newenvironment{corollary}[2][Corollary]{\begin{trivlist}
- \item[\hskip \labelsep {{\fontfamily{qhv}\selectfont \small \bfseries #1}}\hskip \labelsep
- {{\fontfamily{qhv}\selectfont \small \bfseries #2.}}]\itshape}{\end{trivlist}}
- \newenvironment{lemma}[2][Lemma]{\begin{trivlist}
- \item[\hskip \labelsep {{\fontfamily{qhv}\selectfont \small \bfseries #1}}\hskip \labelsep
- {{\fontfamily{qhv}\selectfont \small \bfseries #2.}}] \itshape}{\end{trivlist}}
- \newenvironment{remark}[1][Remark]{\begin{trivlist}
- \item[\hskip \labelsep {{\fontfamily{qhv}\selectfont \small \itshape #1.}}]}{\end{trivlist}}
- \newenvironment{prop}[2][Proposition]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{exercise}[2][Exercise]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{problem}[2][Problem]{\begin{trivlist}
- \item[\hskip \labelsep {{\fontfamily{qhv}\selectfont\small\bfseries #1}}\hskip \labelsep
- {{\fontfamily{qhv}\selectfont\small\bfseries #2.}}]}{\medskip \end{trivlist}}
- \newenvironment{question}[2][Question]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{solution}[1][Solution.]{\begin{trivlist}
- \item[\hskip \labelsep {\fontfamily{qhv}\selectfont \small {\bfseries #1}}]}{\qed \end{trivlist}}
- \fi
- %%
- \newtheoremstyle{plainqhv}%
- {}% space above
- {}% space below
- {\itshape}% body font
- {}% indent amount
- {\fontfamily{qhv}\bfseries\small}% theorem head font
- {.}% punctuation after theorem head
- {.5em}% space after theorem head
- {\thmname{#1}\thmnumber{ #2}\thmnote{\normalfont\normalsize\ (#3)}}% theorem head spec (can be left empty, meaning 'normal')
- \newtheoremstyle{definitionqhv}%
- {}% space above
- {}% space below
- {}% body font
- {}% indent amount
- {\fontfamily{qhv}\bfseries\small}% theorem head font
- {.}% punctuation after theorem head
- {.5em}% space after theorem head
- {\thmname{#1}\thmnumber{ #2}\thmnote{\normalfont\normalsize\ (#3)}}% theorem head spec (can be left empty, meaning 'normal')
- \newtheoremstyle{remarkqhv}%
- {}% space above
- {}% space below
- {}% body font
- {}% indent amount
- {\itshape}% theorem head font
- {.}% punctuation after theorem head
- {.5em}% space after theorem head
- {\thmname{#1}\thmnumber{ #2}\thmnote{ #3}}% theorem head spec (can be left empty, meaning 'normal')
- \theoremstyle{plainqhv}
- \newtheorem{theorem}{Theorem}[section]
- \newtheorem{lemma}[theorem]{Lemma}
- \newtheorem{corollary}[theorem]{Corollary}
- \newtheorem{proposition}[theorem]{Proposition}
- \theoremstyle{definitionqhv}
- \newtheorem{definition}[theorem]{Definition}
- \newtheorem{problem}{Problem}
- \newtheorem{example}[theorem]{Example}
- \newtheorem*{observation}{Observation}
- \theoremstyle{remarkqhv}
- \newtheorem*{remark}{Remark}
- \newtheorem*{note}{Note}
- \newtheorem*{case}{Case}
- \newtheorem{Claim}{Claim}[problem]
- \newtheorem{ClaimI}{Claim}[Claim]
- \newtheorem{ClaimII}{Claim}[ClaimI]
- \newtheorem{ClaimIII}{Claim}[ClaimII]
- \newcounter{claimlevel}[theorem]
- % nested claims --
- % https://tex.stackexchange.com/questions/306016/theorem-and-subtheorem-hierarchical-numbering
- \ExplSyntaxOn
- \NewDocumentEnvironment{claim}{O{=}}
- {
- \str_case:nn { #1 }
- {
- {=} { }
- {+} { \stepcounter{claimlevel} }
- {-} { \addtocounter{claimlevel}{-1} }
- {--} { \addtocounter{claimlevel}{-2} }
- {---}{ \addtocounter{claimlevel}{-3} }
- }
- \begin{ Claim \int_to_Roman:n { \value{claimlevel} } }
- }
- {
- \end{ Claim \int_to_Roman:n { \value{claimlevel} } }
- }
- \ExplSyntaxOff
- % Sensible theorem numbering according to chapter/section/subsection.
- \renewcommand{\thetheorem}{%
- \ifnum\value{section}=0
- \thechapter% "no section"
- \else
- \ifnum\value{subsection}=0
- \thesection{.}% "no subsection"
- \else
- \thesubsection{.}% "within a subsection"
- \fi
- \fi%
- \arabic{theorem}}
- %Define solution and proof environments.
- \makeatletter
- \newenvironment{solution}{\par
- \pushQED{\qed}%
- \normalfont \topsep6\p@\@plus6\p@\relax
- \trivlist
- \item\relax
- {\fontfamily{qhv}\small\textbf
- {Solution}\@addpunct{.}}\hspace\labelsep\ignorespaces
- }{%
- \popQED\endtrivlist\@endpefalse
- }
- \renewenvironment{proof}[1][\proofname]{\par
- \renewcommand\qedsymbol{$\blacksquare$}
- \pushQED{\qed}%
- \normalfont \topsep6\p@\@plus6\p@\relax
- \trivlist
- \item\relax
- {\itshape
- #1\@addpunct{.}}\hspace\labelsep\ignorespaces
- }{%
- \popQED\endtrivlist\@endpefalse
- }
- \makeatother
- % Giles Castel Inkscape Figure Manager
- % https://castel.dev/post/lecture-notes-2/
- \usepackage{import}
- \usepackage{pdfpages}
- \usepackage{transparent}
- \usepackage{xcolor}
- \usepackage{xifthen}
- \newcommand{\incfig}[1]{%
- \def\svgwidth{\columnwidth}
- \import{./figures/}{#1.pdf_tex}
- }
- \pdfsuppresswarningpagegroup=1
- \newcommand{\homework}[3]{%
- \author{Kogasa}
- \date{#2}
- \title{\vspace{-3em}#3\\Homework #1}
- \lhead{#3}
- \chead{Homework #1}
- \rhead{\theauthor}
- \pagestyle{fancy}
- }
- \usepackage{xifthen}
- \def\testdateparts#1{\dateparts#1\relax}
- \def\dateparts#1 #2 #3 #4 #5\relax{
- \marginpar{\small\textsf{\mbox{#1 #2 #3 #5}}}
- }
- \def\@lecture{}%
- \newcommand{\lecture}[3]{
- \ifthenelse{\isempty{#3}}{%
- \def\@lecture{Lecture #1}%
- }{%
- \def\@lecture{Lecture #1: #3}%
- }%
- \subsection*{\@lecture}
- \marginpar{\small\textsf{\mbox{#2}}}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement