From 17096b7bd77fd18fc0e73e628b1ce5ab1dddca60 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 28 Nov 2016 23:47:23 +0000 Subject: awesomebox (28nov16) git-svn-id: svn://tug.org/texlive/trunk@42597 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/awesomebox/LICENSE | 14 ++ Master/texmf-dist/doc/latex/awesomebox/README | 47 ++++ .../texmf-dist/doc/latex/awesomebox/awesomebox.pdf | Bin 0 -> 51046 bytes .../texmf-dist/doc/latex/awesomebox/awesomebox.tex | 274 +++++++++++++++++++++ .../texmf-dist/tex/latex/awesomebox/awesomebox.sty | 98 ++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 1 + Master/tlpkg/tlpsrc/awesomebox.tlpsrc | 0 Master/tlpkg/tlpsrc/collection-xetex.tlpsrc | 1 + 8 files changed, 435 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/awesomebox/LICENSE create mode 100644 Master/texmf-dist/doc/latex/awesomebox/README create mode 100644 Master/texmf-dist/doc/latex/awesomebox/awesomebox.pdf create mode 100644 Master/texmf-dist/doc/latex/awesomebox/awesomebox.tex create mode 100644 Master/texmf-dist/tex/latex/awesomebox/awesomebox.sty create mode 100644 Master/tlpkg/tlpsrc/awesomebox.tlpsrc diff --git a/Master/texmf-dist/doc/latex/awesomebox/LICENSE b/Master/texmf-dist/doc/latex/awesomebox/LICENSE new file mode 100644 index 00000000000..5a8e332545f --- /dev/null +++ b/Master/texmf-dist/doc/latex/awesomebox/LICENSE @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/Master/texmf-dist/doc/latex/awesomebox/README b/Master/texmf-dist/doc/latex/awesomebox/README new file mode 100644 index 00000000000..a27913d846d --- /dev/null +++ b/Master/texmf-dist/doc/latex/awesomebox/README @@ -0,0 +1,47 @@ +Awesome Boxes is all about drawing admonition blocks around text to +inform or alert your readers about something particular. The specific +aim of this package is to use FontAwesome¹ icons to ease the +illustration of these blocks. + +This means all the magic of this package only exists if you previously +installed FontAwesome on your system and made it available for use with +XeTeX. Yes, this package requires you to use XeLaTeX too. + +The idea of admonition blocks comes from the ones you can easily do with +AsciiDoc². + +We use the previous work of Honza Ustohal on fontawesome.sty³ to build +this package. However, we made two important modifications: + + 1. we rename the internal commands of fontawesome.sty from \fa to + \abIcon and the \FA font switch to \ABFamily to avoid collision if + you want to use both of them; + 2. we remove most of the provided icons to only kept the one we really + use in this package. + +For more details, please refer to the awesomebox.pdf document. + +¹ http://fontawesome.io/icons/ +² http://asciidoctor.org/docs/user-manual/#admonition +³ https://gist.github.com/sway/3101743 +⁴ https://github.com/milouse/latex-awesomebox/blob/master/awesomebox.pdf + +* Requirements + + - a working XeLaTeX environment + - the ifxetex, ifluatex, xltxtra, xcolor and tabularx LaTeX packages + - FontAwesome (http://fontawesome.io/icons/) + +* Installation + +Download the awesomebox.sty file and put it in the same folder of the +document your are composing. + +For system wide installation, please refer to the documentation of your +XeLaTeX distribution. + +* License + +Awesome Box is released under the WTFPL +(http://www.wtfpl.net/txt/copying/). A copy of this license is +distributed in this package. diff --git a/Master/texmf-dist/doc/latex/awesomebox/awesomebox.pdf b/Master/texmf-dist/doc/latex/awesomebox/awesomebox.pdf new file mode 100644 index 00000000000..8cce7b01432 Binary files /dev/null and b/Master/texmf-dist/doc/latex/awesomebox/awesomebox.pdf differ diff --git a/Master/texmf-dist/doc/latex/awesomebox/awesomebox.tex b/Master/texmf-dist/doc/latex/awesomebox/awesomebox.tex new file mode 100644 index 00000000000..9c99aed0ad8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/awesomebox/awesomebox.tex @@ -0,0 +1,274 @@ +\documentclass[a4paper,12pt]{article} + +\usepackage{awesomebox} +\setlength{\aweboxvskip}{0pt} + +\defaultfontfeatures{Scale=MatchLowercase} +\setmonofont[Mapping=tex-text,Scale=0.9]{Inconsolata} +\setromanfont[Mapping=tex-text]{Linux Libertine O} +\setsansfont[Mapping=tex-text]{Linux Biolinum O} + +\usepackage{polyglossia} +\setdefaultlanguage{english} + +\usepackage[vmargin=2cm,hmargin=3cm,includeheadfoot=true]{geometry} +\linespread{1.2} + +\def\abIconRocket{\symbol{"F135}} +\def\abIconHeart{\symbol{"F004}} + +\newcommand{\cf}[1]{(\emph{cf.} section \ref{#1}, % + <<\,\nameref{#1}\,>>, p. \pageref{#1})} + +\usepackage{datetime} +\newcommand{\colophon}{ + ~\vfill + \begin{center} + \scriptsize Prepared with {\ABFamily\abIconHeart} from Nantes, + France\\ + Awesome Box is released under the + \hrefcolor{http://www.wtfpl.net/txt/copying/}{WTFPL}. A copy of this + license is distributed in this package.\\ + \tiny version of the \today{} --- \currenttime + \end{center} +} + +% configuration de la transformation en PDF +\usepackage[pdfusetitle]{hyperref} +\hypersetup{ + colorlinks=false, + pdfborder=0 0 0, + breaklinks=true, + bookmarksopen=true, + pdfcreator=XeLaTeX, + pdfproducer=XeLaTeX} + +\newcommand\hrefcolor[2]{\textcolor{magenta}{\href{#1}{#2}}} + +\title{Awesome Boxes} +\author{Étienne Deparis} +\date{\today} + +\begin{document} + +\maketitle + +\section{Introduction} + +Awesome Boxes is all about drawing admonition blocks around text to +inform or alert your readers about something particular. The specific +aim of this package is to use +\hrefcolor{http://fontawesome.io/icons/}{FontAwesome} icons to ease the +illustration of these boxes. + +This means all the magic of this package only exists if you previously +installed FontAwesome on your system and made it available for use with +\XeTeX. Yes, this package require you to use \XeLaTeX\ too. + +The idea of admonition blocks comes from the ones you can easily do with +\hrefcolor{http://asciidoctor.org/docs/user-manual/\#admonition}{AsciiDoc}. + +We use the previous work of Honza Ustohal on +\hrefcolor{https://gist.github.com/sway/3101743}{fontawesome.sty} to +build this package. However, we made two important modifications: + +\begin{enumerate} +\item we rename the internal commands of \texttt{fontawesome.sty} from + \texttt{\textbackslash{}fa} to \texttt{\textbackslash{}abIcon} and the + \texttt{\textbackslash{}FA} font switch to + \texttt{\textbackslash{}ABFamily} to avoid collision if you want to + use both of them; +\item we remove most of the provided icons to only kept the one we + really use in this package. We'll see later how to add back some of + them \cf{sec:new-icons}. +\end{enumerate} + +Therefore, the only symbols we kept are the following: + +\begin{description} + \item[{\ABFamily\abIconCheck}] \verb!\ABFamily\abIconCheck! + \item[{\ABFamily\abIconInfoCircle}] \verb!\ABFamily\abIconInfoCircle! + \item[{\ABFamily\abIconFire}] \verb!\ABFamily\abIconFire! + \item[{\ABFamily\abIconExclamationCircle}] \verb!\ABFamily\abIconExclamationCircle! + \item[{\ABFamily\abIconExclamationTriangle}] \verb!\ABFamily\abIconTriangle! + \item[{\ABFamily\abIconCogs}] \verb!\ABFamily\abIconCogs! + \item[{\ABFamily\abIconThumbsUp}] \verb!\ABFamily\abIconThumbsUp! + \item[{\ABFamily\abIconThumbsDown}] \verb!\ABFamily\abIconThumbsDown! + \item[{\ABFamily\abIconCertificate}] \verb!\ABFamily\abIconCertificate! + \item[{\ABFamily\abIconLightBulb}] \verb!\ABFamily\abIconLightBulb! + \item[{\ABFamily\abIconTwitter}] \verb!\ABFamily\abIconTwitter! + \item[{\ABFamily\abIconGithub}] \verb!\ABFamily\abIconGithub! +\end{description} + +\section{How to use it?} + +Just download this package and call it at the beginning of your +document: + +\begin{center} +\verb!\usepackage{awesomebox}! +\end{center} + +\section{Provided boxes} + +The provided boxes follow the name convention of the +\hrefcolor{http://asciidoctor.org/docs/user-manual/\#admonition}{admonition + blocks} from \hrefcolor{http://asciidoctor.org}{AsciiDoc}. + +\begin{center} +\verb!\notebox{Lorem ipsum…}! +\end{center} + +\notebox{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam + aliquet libero quis lectus elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\begin{center} +\verb!\tipbox{Lorem ipsum…}! +\end{center} + +\tipbox{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam + aliquet libero quis lectus elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\clearpage + +\begin{center} +\verb!\warningbox{Lorem ipsum…}! +\end{center} + +\warningbox{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam + aliquet libero quis lectus elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\begin{center} +\verb!\cautionbox{Lorem ipsum…}! +\end{center} + +\cautionbox{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam + aliquet libero quis lectus elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\begin{center} +\verb!\importantbox{Lorem ipsum…}! +\end{center} + +\importantbox{Lorem ipsum dolor sit amet, consectetur adipiscing + elit. Nam aliquet libero quis lectus elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\section{How to add new icons?} +\label{sec:new-icons} + +If you look at the \texttt{awesomebox.sty} source code, you'll see that +the current icons are declared using the following command: +\verb!\def\abIconFire{\symbol{"F06D}}!. + +As you can see, adding a new icon is as simple as creating a new +\verb!\def! command with the right hexadecimal code. These codes can be +found on the \hrefcolor{http://fontawesome.io/cheatsheet/}{FontAwesome + cheatsheet}. All you have to do is to convert the provided html-entity +to the \TeX\ compatible code. + +For example, if you want to add the \emph{rocket} icon +({\ABFamily\abIconRocket}), you have to translate \verb![]! to +\texttt{"F135}. And that's it: +\verb!\def\abIconRocket{\symbol{"F135}}!. + +You can put this new \verb!\def! command at the beginning of your +document, just before the \verb!\begin{document}! for exemple. + +\section{How to create your own box?} + +To create your own box, with your own colour, your own icon or your own +rule width, you can use our meta command: + +\begin{center} +\verb!\awesomebox{icon}{rulewidth}{color}{your text content}! +\end{center} + +\clearpage + +\begin{center} +\verb!\awesomebox{\abIconCertificate}{5pt}{magenta}{Lorem ipsum…}! +\end{center} + +\awesomebox{\abIconCertificate}{5pt}{magenta}{Lorem ipsum dolor sit + amet, consectetur adipiscing elit. Nam aliquet libero quis lectus + elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\begin{center} +\verb!\awesomebox{\abIconCogs}{0pt}{black}{Lorem ipsum…}! +\end{center} + +\awesomebox{\abIconCogs}{0pt}{black}{Lorem ipsum dolor sit amet, + consectetur adipiscing elit. Nam aliquet libero quis lectus elementum + fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\begin{center} +\verb!\awesomebox{\abIconRocket}{2pt}{violet}{Lorem ipsum…}! +\end{center} + +\awesomebox{\abIconRocket}{2pt}{violet}{Lorem ipsum dolor sit + amet, consectetur adipiscing elit. Nam aliquet libero quis lectus + elementum fermentum. + + Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at + dictum felis. Pellentesque tortor lacus, semper et neque vitae, + egestas commodo nisl.} + +\section{Other options} + +Finally, you can also modify some internal options in order to modify +globally your awesome boxes (either the default ones or your new ones). + +\subsection{Left margin} + +The left margin is the space left before the vertical rule to display +the icon. You can change it with the following command (9mm is the +default one): \\ \verb!\setlength{\aweboxleftmargin}{9mm}!. + +\subsection{Vertical skip} + +This space is used before and after the awesome box. You can change it +with (5mm is the default): \verb!\setlength{\aweboxvskip}{5mm}!. + +\subsection{Sign raise} + +This length is used to raise (or lower) the left icon. Its default value +is −5mm and you can change it with: +\verb!\setlength{\aweboxsignraise}{-5mm}!. + +\subsection{Rule width} + +This width is used for the vertical rule of our four default boxes. Its +default value is 2pt and you can change it with: +\verb!\setlength{\aweboxrulewidth}{2pt}!. + + +\colophon + +\end{document} 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 +} +\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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 988ead57276..4d3d0aaa647 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -52,6 +52,7 @@ my @TLP_working = qw( aucklandthesis augie auncial-new aurical aurl autobreak autopdf authoraftertitle authorindex auto-pst-pdf autoaligne autoarea automata autonum autosp avantgar avremu + awesomebox b1encoding babel babel-albanian babel-bahasa babel-basque babel-belarusian babel-bosnian babel-breton diff --git a/Master/tlpkg/tlpsrc/awesomebox.tlpsrc b/Master/tlpkg/tlpsrc/awesomebox.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc index bac24101465..340b8f41abb 100644 --- a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc @@ -6,6 +6,7 @@ longdesc http://tug.org/xetex. depend collection-basic # depend arabxetex +depend awesomebox depend bidi-atbegshi depend bidicontour depend bidipagegrid -- cgit v1.2.3