summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/alertmessage
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-08-03 22:04:15 +0000
committerKarl Berry <karl@freefriends.org>2015-08-03 22:04:15 +0000
commit8861879f68d110b9c3cbb9b4153c28e5e3799b9d (patch)
tree8e752c737bc3f1ab9397caecd532324dd72dbdfe /Master/texmf-dist/tex/latex/alertmessage
parent0ae7a590ae93af9b84a61f599507ec81ae1b61cf (diff)
alertmessage (3aug15)
git-svn-id: svn://tug.org/texlive/trunk@38034 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/alertmessage')
-rw-r--r--Master/texmf-dist/tex/latex/alertmessage/alertmessage.sty82
1 files changed, 82 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/alertmessage/alertmessage.sty b/Master/texmf-dist/tex/latex/alertmessage/alertmessage.sty
new file mode 100644
index 00000000000..39965419359
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/alertmessage/alertmessage.sty
@@ -0,0 +1,82 @@
+%%
+%% This is file `alertmessage.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% alertmessage.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2015 by Pierre Dupuis
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2006/05/20 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}[2003/12/01]
+\ProvidesPackage{alertmessage}
+ [2005/08/02 v1.0 Alert messages]
+ % Required packages
+ \RequirePackage{picture}%
+ \RequirePackage{xcolor}%
+ \RequirePackage{ifthen}%
+ \RequirePackage{calc}%
+ \RequirePackage{graphicx}%
+ \RequirePackage{tikz}%
+
+ % Options
+ \DeclareOption*{}%
+ \ProcessOptions%
+
+ % ALERT PANEL
+ \newlength{\alertmessage@textlength}%
+ \newcommand*\alertmessage@panel[3]{%
+ \begin{center} %
+ \noindent % No indentation
+ \begin{tikzpicture} %
+ \node[draw=#1!80, fill=#1!20, rounded corners=5pt, inner sep=11pt]{ % Add a little bit of transparency
+ $\begin{array}{l} % One-cell table
+ \includegraphics[scale=0.5]{{#2}} % Alert icon
+ \end{array}$ %
+ \settowidth{\alertmessage@textlength}{{#3}} %
+ \ifthenelse{\lengthtest{\alertmessage@textlength > 400pt}}{ % If text is more than 400pt
+ \parbox{340pt}{{#3}} % Box which handles paragraphs, limited to 10cm
+ }{ % Else
+ \makebox{}{{#3}} % Box which adapts itself to the text length
+ } %
+ }; %
+ \end{tikzpicture} %
+ \end{center} %
+ \par % Get back the indentation
+ }%
+
+ % ERROR ALERT
+ \newcommand*\alerterror[1]{%
+ \alertmessage@panel{red}{img/alertmessage-error.png}{#1}%
+ }%
+
+ % ERROR WARNING
+ \newcommand*\alertwarning[1]{%
+ \alertmessage@panel{orange}{img/alertmessage-warning.png}{#1}%
+ }%
+
+ % ERROR SUCCESS
+ \newcommand*\alertsuccess[1]{%
+ \alertmessage@panel{green}{img/alertmessage-success.png}{#1}%
+ }%
+
+ % ERROR INFO
+ \newcommand*\alertinfo[1]{%
+ \alertmessage@panel{blue}{img/alertmessage-info.png}{#1}%
+ }%
+
+\endinput
+%%
+%% End of file `alertmessage.sty'.