summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/alertmessage
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/alertmessage
Initial commit
Diffstat (limited to 'macros/latex/contrib/alertmessage')
-rw-r--r--macros/latex/contrib/alertmessage/README.md59
-rw-r--r--macros/latex/contrib/alertmessage/alertmessage.dtx141
-rw-r--r--macros/latex/contrib/alertmessage/alertmessage.ins61
-rw-r--r--macros/latex/contrib/alertmessage/alertmessage.pdfbin0 -> 106952 bytes
-rw-r--r--macros/latex/contrib/alertmessage/img/alertmessage-error.pngbin0 -> 1415 bytes
-rw-r--r--macros/latex/contrib/alertmessage/img/alertmessage-info.pngbin0 -> 1561 bytes
-rw-r--r--macros/latex/contrib/alertmessage/img/alertmessage-success.pngbin0 -> 1202 bytes
-rw-r--r--macros/latex/contrib/alertmessage/img/alertmessage-warning.pngbin0 -> 1418 bytes
8 files changed, 261 insertions, 0 deletions
diff --git a/macros/latex/contrib/alertmessage/README.md b/macros/latex/contrib/alertmessage/README.md
new file mode 100644
index 0000000000..1303346268
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/README.md
@@ -0,0 +1,59 @@
+# latex-alert-message - available on [CTAN](http://www.ctan.org/pkg/alertmessage)
+Alert messages for LaTeX - Inspired by [Bootstrap alerts](http://www.w3schools.com/bootstrap/bootstrap_alerts.asp)
+
+
+[![ - Example rendering](https://raw.githubusercontent.com/pidupuis/latex-alert-message/master/panels.png)](https://raw.githubusercontent.com/pidupuis/latex-alert-message/master/panels.png)
+
+## Installation
+
+#### Clean installation
+
+To install the package properly, download the [TDS archive](https://github.com/pidupuis/latex-alert-message/blob/master/alertmessage.tds.zip?raw=true). Then extract the archive into the texmf folder and install the package as following:
+
+```bash
+sudo unzip alertmessage.tds.zip -d "$(kpsewhich -var-value TEXMFLOCAL)"
+sudo texhash
+```
+
+The package will be available from anywhere on your computer.
+
+#### Use the package without installation
+
+You can use the package without installation by putting the [package file](https://raw.githubusercontent.com/pidupuis/latex-alert-message/master/alertmessage.sty) and the [images](https://github.com/pidupuis/latex-alert-message/tree/master/img) in the root directory of your LaTeX project.
+
+Download the [latest release](https://github.com/pidupuis/latex-alert-message/releases/tag/v1.0) as a full example project or look at the [example.tex](https://github.com/pidupuis/latex-alert-message/blob/master/example.tex).
+
+## Documentation
+
+Include the package in the header of your TeX file:
+```tex
+\usepackage{alertmessage}
+```
+
+And simply call the methods you need. There are four panels availables for `information`, `warnings`, `errors` or `success` messages.
+
+```tex
+\alertinfo{Lorem ipsum dolor sit amet.}
+\alertsuccess{Lorem ipsum dolor sit amet.}
+\alertwarning{Lorem ipsum dolor sit amet.}
+\alerterror{Lorem ipsum dolor sit amet.}
+```
+
+The panel will adapt its size according to the length of the text (as you can see in the example).
+
+## Contributing
+
+Feel free to open [issues](https://github.com/pidupuis/latex-alert-message/issues) or create [pull requests](https://github.com/pidupuis/latex-alert-message/pulls).
+
+If you want to modify the package for personal use, you can manually edit the [package file](https://github.com/pidupuis/latex-alert-message/blob/master/alertmessage.sty).
+
+If you want to create a TDS archive to share your modifications with your friends, use the [TDS generation script](https://github.com/pidupuis/latex-alert-message/blob/master/generate_tds.sh).
+
+If you want to deploy your modifications on the CTAN by yourself, please take a different package name.
+
+## Releases
+
+* [v1.1](https://github.com/pidupuis/latex-alert-message/releases/tag/v1.1) [2015-08-04]: Provides TDS archive to facilitate the installation process.
+* [v1.0](https://github.com/pidupuis/latex-alert-message/releases/tag/v1.0) [2015-08-02]: Provides macros for `information`, `warnings`, `errors` or `success` alerts.
+
+
diff --git a/macros/latex/contrib/alertmessage/alertmessage.dtx b/macros/latex/contrib/alertmessage/alertmessage.dtx
new file mode 100644
index 0000000000..2e0dc2b163
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/alertmessage.dtx
@@ -0,0 +1,141 @@
+% \iffalse meta-comment
+%
+% alertmessage.dtx
+% Copyright (C) 2015 by Pierre Dupuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is M. Pierre Dupuis
+%
+% This work consists of the files alertmessage.dtx and alertmessage.ins
+% and the derived file alertmessage.sty.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}[2003/12/01]
+%<package>\ProvidesPackage{alertmessage}
+%<package> [2005/08/04 v1.1 Alert messages]
+%<package> % Required packages
+%<package> \RequirePackage{picture}%
+%<package> \RequirePackage{xcolor}%
+%<package> \RequirePackage{ifthen}%
+%<package> \RequirePackage{calc}%
+%<package> \RequirePackage{graphicx}%
+%<package> \RequirePackage{tikz}%
+%<package>
+%<package> % Options
+%<package> \DeclareOption*{}%
+%<package> \ProcessOptions%
+%<package>
+%<package> % ALERT PANEL
+%<package> \newlength{\alertmessage@textlength}%
+%<package> \newcommand*\alertmessage@panel[3]{%
+%<package> \begin{center} %
+%<package> \noindent % No indentation
+%<package> \begin{tikzpicture} %
+%<package> \node[draw=#1!80, fill=#1!20, rounded corners=5pt, inner sep=11pt]{ % Add a little bit of transparency
+%<package> $\begin{array}{l} % One-cell table
+%<package> \includegraphics[scale=0.5]{{#2}} % Alert icon
+%<package> \end{array}$ %
+%<package> \settowidth{\alertmessage@textlength}{{#3}} %
+%<package> \ifthenelse{\lengthtest{\alertmessage@textlength > 400pt}}{ % If text is more than 400pt
+%<package> \parbox{340pt}{{#3}} % Box which handles paragraphs, limited to 10cm
+%<package> }{ % Else
+%<package> \makebox{}{{#3}} % Box which adapts itself to the text length
+%<package> } %
+%<package> }; %
+%<package> \end{tikzpicture} %
+%<package> \end{center} %
+%<package> \par % Get back the indentation
+%<package> }%
+%<package>
+%<package> % ERROR ALERT
+%<package> \newcommand*\alerterror[1]{%
+%<package> \alertmessage@panel{red}{img/alertmessage-error.png}{#1}%
+%<package> }%
+%<package>
+%<package> % ERROR WARNING
+%<package> \newcommand*\alertwarning[1]{%
+%<package> \alertmessage@panel{orange}{img/alertmessage-warning.png}{#1}%
+%<package> }%
+%<package>
+%<package> % ERROR SUCCESS
+%<package> \newcommand*\alertsuccess[1]{%
+%<package> \alertmessage@panel{green}{img/alertmessage-success.png}{#1}%
+%<package> }%
+%<package>
+%<package> % ERROR INFO
+%<package> \newcommand*\alertinfo[1]{%
+%<package> \alertmessage@panel{blue}{img/alertmessage-info.png}{#1}%
+%<package> }%
+%<package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{alertmessage}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+\DocInput{alertmessage.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \changes{v1.1}{2005/08/04}{First version}
+%
+% \GetFileInfo{alertmessage.sty}
+%
+%
+% \title{The \textsf{alertmessage} package\thanks{This document
+% corresponds to \textsf{alertmessage}~\fileversion,
+% dated ~\filedate.}}
+% \author{Pierre Dupuis}
+%
+% \maketitle
+% \section{Introduction}
+%
+% This package provides beautiful boxes to display alert messages. The alerts are inspired by the Bootstrap framework.
+% \alertinfo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
+%
+% The size of the box increases according to the text length until a certain limit to guarantee the responsiveness of the alert.
+%
+% \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.}
+%
+% There are four alerts available for information, warning, error and success messages. Each one has its own color and icon.
+% \newpage
+%
+%
+% \section{Usage}
+%
+% \DescribeMacro{\alertinfo}
+% This macro displays a blue alert indicating an information message.
+% \alertinfo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
+%
+% \DescribeMacro{\alertsuccess}
+% This macro displays a green alert indicating a successful message.
+% \alertsuccess{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
+%
+% \DescribeMacro{\alertwarning}
+% This macro displays an orange alert indicating a warning message.
+% \alertwarning{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
+%
+% \DescribeMacro{\alerterror}
+% This macro displays a red alert indicating an error message.
+% \alerterror{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
+%
+%
+% \Finale
+\endinput
+
diff --git a/macros/latex/contrib/alertmessage/alertmessage.ins b/macros/latex/contrib/alertmessage/alertmessage.ins
new file mode 100644
index 0000000000..07c228b5ad
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/alertmessage.ins
@@ -0,0 +1,61 @@
+% alertmessage.ins
+% Copyright (C) 2015 by Pierre Dupuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is M. Pierre Dupuis
+%
+% This work consists of the files alertmessage.dtx and alertmessage.ins
+% and the derived file alertmessage.sty.
+
+\input docstrip.tex
+
+\keepsilent
+\askforoverwritefalse
+\usedir{tex/latex/alertmessage}
+
+\preamble
+
+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.
+
+\endpreamble
+
+\generate{\file{alertmessage.sty}{\from{alertmessage.dtx}{package}}}
+
+\obeyspaces
+\Msg{**************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* alertmessage.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file alertmessage.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{**************************************************************}
+
+\endbatchfile
+
diff --git a/macros/latex/contrib/alertmessage/alertmessage.pdf b/macros/latex/contrib/alertmessage/alertmessage.pdf
new file mode 100644
index 0000000000..2b9aed59e2
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/alertmessage.pdf
Binary files differ
diff --git a/macros/latex/contrib/alertmessage/img/alertmessage-error.png b/macros/latex/contrib/alertmessage/img/alertmessage-error.png
new file mode 100644
index 0000000000..50b604fb9e
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/img/alertmessage-error.png
Binary files differ
diff --git a/macros/latex/contrib/alertmessage/img/alertmessage-info.png b/macros/latex/contrib/alertmessage/img/alertmessage-info.png
new file mode 100644
index 0000000000..3e841c9e72
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/img/alertmessage-info.png
Binary files differ
diff --git a/macros/latex/contrib/alertmessage/img/alertmessage-success.png b/macros/latex/contrib/alertmessage/img/alertmessage-success.png
new file mode 100644
index 0000000000..0a2b4f3258
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/img/alertmessage-success.png
Binary files differ
diff --git a/macros/latex/contrib/alertmessage/img/alertmessage-warning.png b/macros/latex/contrib/alertmessage/img/alertmessage-warning.png
new file mode 100644
index 0000000000..01ad7d0384
--- /dev/null
+++ b/macros/latex/contrib/alertmessage/img/alertmessage-warning.png
Binary files differ