diff options
author | Karl Berry <karl@freefriends.org> | 2016-11-28 23:47:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-11-28 23:47:23 +0000 |
commit | 17096b7bd77fd18fc0e73e628b1ce5ab1dddca60 (patch) | |
tree | eef794f90eadcfc3590d18ab3f1667b2844ce143 /Master/texmf-dist/tex | |
parent | a72a9a25915c097248b4bca41e6154830c926a69 (diff) |
awesomebox (28nov16)
git-svn-id: svn://tug.org/texlive/trunk@42597 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/awesomebox/awesomebox.sty | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/awesomebox/awesomebox.sty b/Master/texmf-dist/tex/latex/awesomebox/awesomebox.sty new file mode 100644 index 00000000000..11854161966 --- /dev/null +++ b/Master/texmf-dist/tex/latex/awesomebox/awesomebox.sty @@ -0,0 +1,98 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{awesomebox}[2016/11/22 v0.1] + +% Awesome Box has been written by Étienne Deparis and is released under +% the WTFPL (http://www.wtfpl.net/txt/copying/). +% A copy of this license is distributed in this package. + + +\RequirePackage{ifxetex,ifluatex} +\newif\ifawesomebox@notxetex\awesomebox@notxetextrue +\ifxetex + \awesomebox@notxetexfalse +\else + \ifluatex + \awesomebox@notxetexfalse + \fi +\fi + +\ifawesomebox@notxetex +\PackageError{awesomebox}{% + You are trying to use awesomebox\MessageBreak + with something else than xelatex or luatex +}{% + Please abort now with <ctrl+d> +} +\fi + +% This package heavily uses the work of Honza Ustohal, known under the +% name FontAwesome bindings for (Xe)LaTeX: +% https://gist.github.com/sway/3101743 +% +% Translation of FontAwesome's private range characters into XeTeX +% symbols. All icons are camel-cased and prefixed with 'abIcon', i.e. what +% was .icon-align-center the CSS version of FontAwesome becomes +% \abIconAlignCenter +% +% New icons code could be retrieve from this page +% http://fontawesome.io/cheatsheet/ + +\def\abIconCheck{\symbol{"F00C}} +\def\abIconInfoCircle{\symbol{"F05A}} +\def\abIconFire{\symbol{"F06D}} +\def\abIconExclamationCircle{\symbol{"F06A}} +\def\abIconExclamationTriangle{\symbol{"F071}} +\def\abIconCogs{\symbol{"F085}} +\def\abIconThumbsUp{\symbol{"F087}} +\def\abIconThumbsDown{\symbol{"F088}} +\def\abIconCertificate{\symbol{"F0A3}} +\def\abIconLightBulb{\symbol{"F0EB}} +\def\abIconTwitter{\symbol{"F099}} +\def\abIconGithub{\symbol{"F09B}} + +\RequirePackage{xltxtra} +\newfontfamily{\ABFamily}{FontAwesome} + +% Some basic colors +\RequirePackage{xcolor} +\definecolor{abnote}{RGB}{25,64,122} +\definecolor{abcaution}{RGB}{188,50,0} +\definecolor{abwarning}{RGB}{188,103,0} +\definecolor{abimportant}{RGB}{188,0,0} + +\newlength{\aweboxleftmargin} +\setlength{\aweboxleftmargin}{9mm} +\newlength{\aweboxvskip} +\setlength{\aweboxvskip}{5mm} +\newlength{\aweboxsignraise} +\setlength{\aweboxsignraise}{-5mm} +\newlength{\aweboxrulewidth} +\setlength{\aweboxrulewidth}{2pt} + +\RequirePackage{tabularx} + +% \awesomebox{icon}{rulewidth}{color}{content} +\newcommand{\awesomebox}[4]{% + \vspace{\aweboxvskip} + \noindent + \begin{tabularx}{\textwidth}{% + m{\aweboxleftmargin}!{\color{#3}\vrule width #2}X} + \raisebox{\aweboxsignraise}{\textcolor{#3}{\Huge\ABFamily#1}} & #4 \\ + \end{tabularx} + \vspace{\aweboxvskip}} + +\newcommand{\notebox}[1]{% + \awesomebox{\abIconInfoCircle}{\aweboxrulewidth}{abnote}{#1}} + +\newcommand{\tipbox}[1]{% + \awesomebox{\abIconLightBulb}{\aweboxrulewidth}{black}{#1}} + +\newcommand{\warningbox}[1]{% + \awesomebox{\abIconExclamationTriangle}{\aweboxrulewidth}{abwarning}{#1}} + +\newcommand{\cautionbox}[1]{% + \awesomebox{\abIconFire}{\aweboxrulewidth}{abcaution}{#1}} + +\newcommand{\importantbox}[1]{% + \awesomebox{\abIconExclamationCircle}{\aweboxrulewidth}{abimportant}{#1}} +\endinput |