Skip to content

Instantly share code, notes, and snippets.

@willwm
Created January 23, 2022 08:00
Show Gist options
  • Save willwm/eca76d3bf3b6e3f0da0924464d109eaa to your computer and use it in GitHub Desktop.
Save willwm/eca76d3bf3b6e3f0da0924464d109eaa to your computer and use it in GitHub Desktop.
Selected tcolorbox styles from NotesTeX (https://github.com/Adhumunt/NotesTeX)
%% mycolorboxes.sty:
%% Selected tcolorbox styles from NotesTeX
%% (https://github.com/Adhumunt/NotesTeX)
\ProvidesPackage{mycolorboxes}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[many]{tcolorbox}
\usepackage{thmtools}
% ----------------------------------------------------------------------
% User Created Environments
% ----------------------------------------------------------------------
%% Theorem
\newlength{\spacelength}
\settowidth{\spacelength}{\normalfont\ }
\declaretheoremstyle[
headfont={\bfseries\sffamily\footnotesize},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},%\newline,
headformat={%
\makebox[0pt][r]{\NAME\ \NUMBER\hspace{\marginparsep}}\hskip-\spacelength{\normalsize\NOTE}},
]{theorem}
\tcolorboxenvironment{theorem}{
boxrule=0pt,
boxsep=0pt,
colback={White!90!Dandelion},
enhanced jigsaw,
borderline west={1pt}{0pt}{Dandelion},
sharp corners,
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
\declaretheorem[style=theorem]{theorem}
\let\proof\relax
\let\endproof\relax
%% Proof
\declaretheoremstyle[
headfont={\small\scshape},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},
headformat={%
\makebox[0pt][r]{\NAME\hspace{\marginparsep}}\hskip-\spacelength{\NOTE}},
]{proof}
\tcolorboxenvironment{proof}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{NavyBlue!80!white},
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
\declaretheorem[
style=proof,
qed=\qedsymbol]{proof}
%% Claim
\declaretheoremstyle[
headfont={\footnotesize\itshape},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},
headformat={%
\makebox[0pt][r]{\NAME\hspace{\marginparsep}}\hskip-\spacelength{\NOTE}},
]{claim}
%% Question
\theoremstyle{theorem}
\newtheorem{ques}{Question}
%% Definition
\theoremstyle{theorem}
\newtheorem{definition}{Definition}
\tcolorboxenvironment{definition}{
boxrule=0pt,
boxsep=0pt,
colback={White!90!Cerulean},
enhanced jigsaw,
borderline west={1pt}{0pt}{Cerulean},
sharp corners,
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
%% Lemma
\theoremstyle{theorem}
\newtheorem{lemma}{Lemma}
\tcolorboxenvironment{lemma}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{Red},
before skip=10pt,
after skip=10pt,
sharp corners,
left=5pt,
right=5pt,
breakable,
}
%% Intuition
\declaretheorem[style=claim]{Intuition}
\theoremstyle{claim}
\newtheorem{intu}{Intuition}
%% Solution
\theoremstyle{claim}
\newtheorem{solu}{Solution}
%% Remark
\theoremstyle{claim}
\newtheorem{remark}{Remark}
%% Example
\theoremstyle{claim}
\newtheorem{example}{Example}
\tcolorboxenvironment{example}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{Black},
sharp corners,
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment