Debian Codegraph @

texmf-dist/source/latex/alertmessage/alertmessage.dtx

raw
1 % \iffalse meta-comment
2 %
3 % alertmessage.dtx
4 % Copyright (C) 2015 by Pierre Dupuis
5 %
6 % This work may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3 or later is part of all distributions of LaTeX
12 % version 2005/12/01 or later.
13 %
14 % This work has the LPPL maintenance status `maintained'.
15 %
16 % The Current Maintainer of this work is M. Pierre Dupuis
17 %
18 % This work consists of the files alertmessage.dtx and alertmessage.ins
19 % and the derived file alertmessage.sty.
20 %
21 % \fi
22 %
23 % \iffalse
24 %<package>\NeedsTeXFormat{LaTeX2e}[2003/12/01]
25 %<package>\ProvidesPackage{alertmessage}
26 %<package> [2005/08/04 v1.1 Alert messages]
27 %<package> % Required packages
28 %<package> \RequirePackage{picture}%
29 %<package> \RequirePackage{xcolor}%
30 %<package> \RequirePackage{ifthen}%
31 %<package> \RequirePackage{calc}%
32 %<package> \RequirePackage{graphicx}%
33 %<package> \RequirePackage{tikz}%
34 %<package>
35 %<package> % Options
36 %<package> \DeclareOption*{}%
37 %<package> \ProcessOptions%
38 %<package>
39 %<package> % ALERT PANEL
40 %<package> \newlength{\alertmessage@textlength}%
41 %<package> \newcommand*\alertmessage@panel[3]{%
42 %<package> \begin{center} %
43 %<package> \noindent % No indentation
44 %<package> \begin{tikzpicture} %
45 %<package> \node[draw=#1!80, fill=#1!20, rounded corners=5pt, inner sep=11pt]{ % Add a little bit of transparency
46 %<package> $\begin{array}{l} % One-cell table
47 %<package> \includegraphics[scale=0.5]{{#2}} % Alert icon
48 %<package> \end{array}$ %
49 %<package> \settowidth{\alertmessage@textlength}{{#3}} %
50 %<package> \ifthenelse{\lengthtest{\alertmessage@textlength > 400pt}}{ % If text is more than 400pt
51 %<package> \parbox{340pt}{{#3}} % Box which handles paragraphs, limited to 10cm
52 %<package> }{ % Else
53 %<package> \makebox{}{{#3}} % Box which adapts itself to the text length
54 %<package> } %
55 %<package> }; %
56 %<package> \end{tikzpicture} %
57 %<package> \end{center} %
58 %<package> \par % Get back the indentation
59 %<package> }%
60 %<package>
61 %<package> % ERROR ALERT
62 %<package> \newcommand*\alerterror[1]{%
63 %<package> \alertmessage@panel{red}{img/alertmessage-error.png}{#1}%
64 %<package> }%
65 %<package>
66 %<package> % ERROR WARNING
67 %<package> \newcommand*\alertwarning[1]{%
68 %<package> \alertmessage@panel{orange}{img/alertmessage-warning.png}{#1}%
69 %<package> }%
70 %<package>
71 %<package> % ERROR SUCCESS
72 %<package> \newcommand*\alertsuccess[1]{%
73 %<package> \alertmessage@panel{green}{img/alertmessage-success.png}{#1}%
74 %<package> }%
75 %<package>
76 %<package> % ERROR INFO
77 %<package> \newcommand*\alertinfo[1]{%
78 %<package> \alertmessage@panel{blue}{img/alertmessage-info.png}{#1}%
79 %<package> }%
80 %<package>
81 %
82 %<*driver>
83 \documentclass{ltxdoc}
84 \usepackage{alertmessage}
85 \EnableCrossrefs
86 \CodelineIndex
87 \RecordChanges
88 \begin{document}
89 \DocInput{alertmessage.dtx}
90 \end{document}
91 %</driver>
92 % \fi
93 %
94 % \CheckSum{0}
95 %
96 % \changes{v1.1}{2005/08/04}{First version}
97 %
98 % \GetFileInfo{alertmessage.sty}
99 %
100 %
101 % \title{The \textsf{alertmessage} package\thanks{This document
102 % corresponds to \textsf{alertmessage}~\fileversion,
103 % dated ~\filedate.}}
104 % \author{Pierre Dupuis}
105 %
106 % \maketitle
107 % \section{Introduction}
108 %
109 % This package provides beautiful boxes to display alert messages. The alerts are inspired by the Bootstrap framework.
110 % \alertinfo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
111 %
112 % The size of the box increases according to the text length until a certain limit to guarantee the responsiveness of the alert.
113 %
114 % \alertinfo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.}
115 %
116 % There are four alerts available for information, warning, error and success messages. Each one has its own color and icon.
117 % \newpage
118 %
119 %
120 % \section{Usage}
121 %
122 % \DescribeMacro{\alertinfo}
123 % This macro displays a blue alert indicating an information message.
124 % \alertinfo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
125 %
126 % \DescribeMacro{\alertsuccess}
127 % This macro displays a green alert indicating a successful message.
128 % \alertsuccess{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
129 %
130 % \DescribeMacro{\alertwarning}
131 % This macro displays an orange alert indicating a warning message.
132 % \alertwarning{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
133 %
134 % \DescribeMacro{\alerterror}
135 % This macro displays a red alert indicating an error message.
136 % \alerterror{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
137 %
138 %
139 % \Finale
140 \endinput
141