Skip to content

Instantly share code, notes, and snippets.

@neoblizz
Created July 2, 2023 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neoblizz/8ef5dc71293ee2571a14c0e10f14314f to your computer and use it in GitHub Desktop.
Save neoblizz/8ef5dc71293ee2571a14c0e10f14314f to your computer and use it in GitHub Desktop.
Colored Alert Boxes in LaTeX
% Pick a nice color
\usepackage{xcolor}
\definecolor{pastelpurple}{RGB}{221,199,255}
% For Alert Boxes
% \usepackage{awesomebox}
\usepackage[most]{tcolorbox}
% textmarker style from colorbox doc
\tcbset{textmarker/.style={%
enhanced,
parbox=false,boxrule=0mm,boxsep=0mm,arc=0mm,
outer arc=0mm,left=4mm,right=3mm,top=7pt,bottom=7pt,
toptitle=1mm,bottomtitle=1mm,oversize}}
% define new colorboxes
\newtcolorbox{definition_box}{textmarker,
borderline west={6pt}{0pt}{pastelpurple},
colback=pastelpurple!10!white,text width=\columnwidth}
% Wrap it around a new command
\newcommand{\definition}[1]{
\begin{definition_box} \textbf{Definition\quad}\newline
#1
\end{definition_box}
}
% Example usage:
\definition{Assign a fixed, constant number of work tiles to each thread. Resultant work items from each work tile are processed sequentially within the thread.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment