| 1 |
\DocumentMetadata{ |
| 2 |
pdfversion=1.7, |
| 3 |
lang=en |
| 4 |
} |
| 5 |
% \documentclass{article} |
| 6 |
% \documentclass{report} |
| 7 |
% \documentclass{book} |
| 8 |
\documentclass{scrartcl} |
| 9 |
% \documentclass{scrreprt} |
| 10 |
% \documentclass{scrbook} |
| 11 |
|
| 12 |
\ifdefined \KOMAClassName |
| 13 |
\KOMAoptions{parskip=half} |
| 14 |
\fi |
| 15 |
|
| 16 |
\usepackage{tgtermes} |
| 17 |
\usepackage{inconsolata} |
| 18 |
\usepackage[semibold,scale=0.907]{cabin} |
| 19 |
|
| 20 |
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue]{hyperref} |
| 21 |
\usepackage[english]{babel} |
| 22 |
|
| 23 |
\usepackage[dvipsnames]{xcolor} |
| 24 |
\usepackage[titles]{lucide-admonitions} |
| 25 |
% \usepackage[titles,breakable]{lucide-admonitions} |
| 26 |
% \usepackage[breakable]{lucide-admonitions} |
| 27 |
% \usepackage{lucide-admonitions} |
| 28 |
|
| 29 |
\title{Lucide Admonitions} |
| 30 |
\subtitle{version 0.1} |
| 31 |
\author{Priit Mustasaar} |
| 32 |
|
| 33 |
\makeatletter |
| 34 |
\hypersetup{ |
| 35 |
pdftitle={\@title}, |
| 36 |
pdfauthor={\@author} |
| 37 |
} |
| 38 |
\makeatother |
| 39 |
|
| 40 |
% define new environment for demonstration |
| 41 |
\newenvironment{AdmonitionRemark} |
| 42 |
{\begin{AdmonitionBase}{\lucideicon{pen}}{Plum}{Remark}} |
| 43 |
{\end{AdmonitionBase}} |
| 44 |
|
| 45 |
|
| 46 |
\begin{document} |
| 47 |
|
| 48 |
\maketitle |
| 49 |
|
| 50 |
\begin{abstract} |
| 51 |
Provides environments for rendering admonition boxes in multiple languages. |
| 52 |
\end{abstract} |
| 53 |
|
| 54 |
\begin{AdmonitionNote} |
| 55 |
The source code and documentation are available at GitHub repository% |
| 56 |
\footnote{\url{https://github.com/priiduonu/lucide-admonitions}}. |
| 57 |
\end{AdmonitionNote} |
| 58 |
|
| 59 |
|
| 60 |
\section{Installation} |
| 61 |
|
| 62 |
The package can be installed via CTAN or manually. |
| 63 |
|
| 64 |
If your \TeX{} distribution provides \texttt{lucide-admonitions}, install it |
| 65 |
using your package manager (e.g.\ \texttt{tlmgr} for \TeX~Live or the MiK\TeX{} |
| 66 |
console). |
| 67 |
|
| 68 |
Alternatively, download the package files from the repository and place them |
| 69 |
in a directory where \LaTeX{} can find them, for example: |
| 70 |
|
| 71 |
\begin{itemize} |
| 72 |
\item in the same directory as your document, or |
| 73 |
\item in a local or user \texttt{texmf} tree |
| 74 |
\end{itemize} |
| 75 |
|
| 76 |
After installation, update the filename database if necessary (e.g.\ by |
| 77 |
running \texttt{texhash} or \texttt{mktexlsr}). |
| 78 |
|
| 79 |
|
| 80 |
\section{Dependencies} |
| 81 |
|
| 82 |
The \texttt{tcolorbox} (with \texttt{skins} and \texttt{breakable} libraries), |
| 83 |
\texttt{xcolor}, \texttt{translations}, \texttt{lucide-icons} packages are |
| 84 |
required and loaded by the package. |
| 85 |
|
| 86 |
|
| 87 |
\section{Usage} |
| 88 |
|
| 89 |
Load the package in the document preamble: |
| 90 |
|
| 91 |
\begin{verbatim} |
| 92 |
\usepackage[<options>]{lucide-admonitions} |
| 93 |
\end{verbatim} |
| 94 |
|
| 95 |
Use any of the predefined admonition environments |
| 96 |
(see Section~\ref{sec:admonition_types}) in the document body: |
| 97 |
|
| 98 |
\begin{verbatim} |
| 99 |
\begin{AdmonitionNote} |
| 100 |
... |
| 101 |
\end{AdmonitionNote} |
| 102 |
\end{verbatim} |
| 103 |
|
| 104 |
|
| 105 |
\section{Package options}\label{sec:options} |
| 106 |
|
| 107 |
One or more of the following options may be specified, separated by commas: |
| 108 |
|
| 109 |
\begin{itemize} |
| 110 |
\item \texttt{breakable} -- allow admonition boxes to break across pages (default: \texttt{false}). |
| 111 |
\item \texttt{titles} -- display the box type as a title next to the icon (default: \texttt{false}). |
| 112 |
\end{itemize} |
| 113 |
|
| 114 |
If the \texttt{titles} option is set, the admonition boxes include the default |
| 115 |
title: |
| 116 |
|
| 117 |
\begin{AdmonitionExample}[Example] |
| 118 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod |
| 119 |
tempor incididunt ut labore et dolore magna aliqua. |
| 120 |
|
| 121 |
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut |
| 122 |
aliquip ex ea commodo consequat. |
| 123 |
\end{AdmonitionExample} |
| 124 |
|
| 125 |
Without the \texttt{titles} option, the default title is not displayed: |
| 126 |
|
| 127 |
\begin{AdmonitionExample}[] |
| 128 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod |
| 129 |
tempor incididunt ut labore et dolore magna aliqua. |
| 130 |
|
| 131 |
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut |
| 132 |
aliquip ex ea commodo consequat. |
| 133 |
\end{AdmonitionExample} |
| 134 |
|
| 135 |
|
| 136 |
\section{Admonition types}\label{sec:admonition_types} |
| 137 |
|
| 138 |
The following types are defined, combining those available in MkDocs and |
| 139 |
Zensical: |
| 140 |
|
| 141 |
\begin{AdmonitionNote} |
| 142 |
This is Note |
| 143 |
\end{AdmonitionNote} |
| 144 |
|
| 145 |
\begin{AdmonitionAttention} |
| 146 |
This is Attention |
| 147 |
\end{AdmonitionAttention} |
| 148 |
|
| 149 |
\begin{AdmonitionCaution} |
| 150 |
This is Caution |
| 151 |
\end{AdmonitionCaution} |
| 152 |
|
| 153 |
\begin{AdmonitionWarning} |
| 154 |
This is Warning |
| 155 |
\end{AdmonitionWarning} |
| 156 |
|
| 157 |
\begin{AdmonitionDanger} |
| 158 |
This is Danger |
| 159 |
\end{AdmonitionDanger} |
| 160 |
|
| 161 |
\begin{AdmonitionError} |
| 162 |
This is Error |
| 163 |
\end{AdmonitionError} |
| 164 |
|
| 165 |
\begin{AdmonitionHint} |
| 166 |
This is Hint |
| 167 |
\end{AdmonitionHint} |
| 168 |
|
| 169 |
\begin{AdmonitionImportant} |
| 170 |
This is Important |
| 171 |
\end{AdmonitionImportant} |
| 172 |
|
| 173 |
\begin{AdmonitionTip} |
| 174 |
This is Tip |
| 175 |
\end{AdmonitionTip} |
| 176 |
|
| 177 |
\begin{AdmonitionAbstract} |
| 178 |
This is Abstract |
| 179 |
\end{AdmonitionAbstract} |
| 180 |
|
| 181 |
\begin{AdmonitionInfo} |
| 182 |
This is Info |
| 183 |
\end{AdmonitionInfo} |
| 184 |
|
| 185 |
\begin{AdmonitionSuccess} |
| 186 |
This is Success |
| 187 |
\end{AdmonitionSuccess} |
| 188 |
|
| 189 |
\begin{AdmonitionQuestion} |
| 190 |
This is Question |
| 191 |
\end{AdmonitionQuestion} |
| 192 |
|
| 193 |
\begin{AdmonitionFailure} |
| 194 |
This is Failure |
| 195 |
\end{AdmonitionFailure} |
| 196 |
|
| 197 |
\begin{AdmonitionBug} |
| 198 |
This is Bug |
| 199 |
\end{AdmonitionBug} |
| 200 |
|
| 201 |
\begin{AdmonitionExample} |
| 202 |
This is Example |
| 203 |
\end{AdmonitionExample} |
| 204 |
|
| 205 |
\begin{AdmonitionQuote} |
| 206 |
This is Quote |
| 207 |
\end{AdmonitionQuote} |
| 208 |
|
| 209 |
|
| 210 |
\section{Custom titles} |
| 211 |
|
| 212 |
You may add a custom title as an optional parameter to the environment: |
| 213 |
|
| 214 |
\begin{verbatim} |
| 215 |
\begin{AdmonitionNote}[Custom title] |
| 216 |
... |
| 217 |
\end{AdmonitionNote} |
| 218 |
\end{verbatim} |
| 219 |
|
| 220 |
The custom title will override the default title when provided, and will |
| 221 |
appear even if the \texttt{titles} option is not set. |
| 222 |
|
| 223 |
\begin{AdmonitionTip}[Tip] |
| 224 |
You can use an empty custom title to prevent the title from appearing even if |
| 225 |
the \texttt{titles} option is set. |
| 226 |
\end{AdmonitionTip} |
| 227 |
|
| 228 |
\begin{AdmonitionCaution}[] |
| 229 |
This box has an empty custom title |
| 230 |
\end{AdmonitionCaution} |
| 231 |
|
| 232 |
|
| 233 |
\section{Changing existing types} |
| 234 |
|
| 235 |
Existing admonition boxes can be redefined using the \verb|\renewenvironment| |
| 236 |
command. |
| 237 |
|
| 238 |
\underline{Example:} |
| 239 |
|
| 240 |
\begin{verbatim} |
| 241 |
\renewenvironment{AdmonitionNote} |
| 242 |
{\begin{AdmonitionBase}{\lucideicon{pen}}{blueColor}{Idea}} |
| 243 |
{\end{AdmonitionBase}} |
| 244 |
\end{verbatim} |
| 245 |
|
| 246 |
You can change the icon, color and default title as needed. |
| 247 |
|
| 248 |
|
| 249 |
\section{Adding new types} |
| 250 |
|
| 251 |
You can define new types of admonition boxes using the \verb|\newenvironment| |
| 252 |
command: |
| 253 |
|
| 254 |
\begin{verbatim} |
| 255 |
\newenvironment{<AdmonitionType>} |
| 256 |
{\begin{AdmonitionBase}{\lucideicon{<icon>}}{<color>}{<title>}} |
| 257 |
{\end{AdmonitionBase}} |
| 258 |
\end{verbatim} |
| 259 |
|
| 260 |
\underline{Example:} |
| 261 |
|
| 262 |
\begin{verbatim} |
| 263 |
\newenvironment{AdmonitionRemark} |
| 264 |
{\begin{AdmonitionBase}{\lucideicon{pen}}{Plum}{Remark}} |
| 265 |
{\end{AdmonitionBase}} |
| 266 |
\end{verbatim} |
| 267 |
|
| 268 |
This results in: |
| 269 |
|
| 270 |
\begin{AdmonitionRemark} |
| 271 |
This is remark |
| 272 |
\end{AdmonitionRemark} |
| 273 |
|
| 274 |
\begin{AdmonitionTip} |
| 275 |
If extended color names are required (e.g.\ \texttt{dvipsnames}, |
| 276 |
\texttt{svgnames}), load \texttt{xcolor} with the desired options before |
| 277 |
this package. |
| 278 |
\end{AdmonitionTip} |
| 279 |
|
| 280 |
|
| 281 |
\section{Styling} |
| 282 |
|
| 283 |
Although Zensical provides slightly different colors for each type, |
| 284 |
\texttt{lucide-admonitions} has reduced the palette to six colors. This does |
| 285 |
not prevent you from adding new types or redefining existing ones with your |
| 286 |
own colors. |
| 287 |
|
| 288 |
It also replaces some icons used by Zensical to achieve a more consistent |
| 289 |
visual style. |
| 290 |
|
| 291 |
The boxes honor the \verb|\parindent| and \verb|\parskip| values specified by |
| 292 |
the \verb|\documentclass|, with the exception of the first paragraph, which |
| 293 |
is always unindented (as in standard \LaTeX{} \verb|\section|). |
| 294 |
|
| 295 |
If a box has a title, the left and right margins inside the box are equal. |
| 296 |
Boxes without a title have a wider left margin so that the text aligns with |
| 297 |
the position where the title would normally appear. |
| 298 |
See Section~\ref{sec:options} for comparison. |
| 299 |
|
| 300 |
\begin{AdmonitionSuccess}[] |
| 301 |
The package has been tested with both standard \LaTeX{} and KOMA-Script |
| 302 |
classes. |
| 303 |
\end{AdmonitionSuccess} |
| 304 |
|
| 305 |
|
| 306 |
\section{Multilingual support} |
| 307 |
|
| 308 |
This package requires the \texttt{translations} package for multilingual |
| 309 |
support. |
| 310 |
|
| 311 |
When using \texttt{babel} or \texttt{polyglossia}, the default box titles are |
| 312 |
automatically translated according to the currently active language. |
| 313 |
|
| 314 |
If no translation is available for the selected language, the titles default |
| 315 |
to English. |
| 316 |
|
| 317 |
Examples for the "Abstract" admonition box: |
| 318 |
|
| 319 |
\selectlanguage{english} |
| 320 |
|
| 321 |
\begin{AdmonitionAbstract} |
| 322 |
English |
| 323 |
\end{AdmonitionAbstract} |
| 324 |
|
| 325 |
\selectlanguage{estonian} |
| 326 |
|
| 327 |
\begin{AdmonitionAbstract} |
| 328 |
Estonian |
| 329 |
\end{AdmonitionAbstract} |
| 330 |
|
| 331 |
\selectlanguage{french} |
| 332 |
|
| 333 |
\begin{AdmonitionAbstract} |
| 334 |
French |
| 335 |
\end{AdmonitionAbstract} |
| 336 |
|
| 337 |
\selectlanguage{german} |
| 338 |
|
| 339 |
\begin{AdmonitionAbstract} |
| 340 |
German |
| 341 |
\end{AdmonitionAbstract} |
| 342 |
|
| 343 |
\selectlanguage{english} |
| 344 |
|
| 345 |
The package provides the following translations: |
| 346 |
|
| 347 |
\begin{itemize} |
| 348 |
\item English |
| 349 |
\item Estonian |
| 350 |
\item French |
| 351 |
\item German |
| 352 |
\end{itemize} |
| 353 |
|
| 354 |
You are welcome to add support for additional languages by submitting a pull |
| 355 |
request to the package GitHub repository. |
| 356 |
|
| 357 |
\clearpage |
| 358 |
|
| 359 |
|
| 360 |
\section{Acknowledgements} |
| 361 |
|
| 362 |
This package was inspired by the look of Zensical admonitions% |
| 363 |
\footnote{\url{https://zensical.org/docs/authoring/admonitions/}}. |
| 364 |
|
| 365 |
It uses the Lucide icon set\footnote{\url{https://lucide.dev}}, which has been |
| 366 |
packaged for \LaTeX{} in the \texttt{lucide-icons} package% |
| 367 |
\footnote{\url{https://ctan.org/pkg/lucide-icons}} by Cédric Pierquet. |
| 368 |
|
| 369 |
The box environments are built using the \texttt{tcolorbox} package% |
| 370 |
\footnote{\url{https://ctan.org/pkg/tcolorbox}} by Thomas F.\ Sturm. |
| 371 |
|
| 372 |
The box titles are automatically translated using the \texttt{translations} package% |
| 373 |
\footnote{\url{https://ctan.org/pkg/translations}} by Clemens Niederberger. |
| 374 |
|
| 375 |
The box colors are defined using the \texttt{xcolor} package% |
| 376 |
\footnote{\url{https://www.ctan.org/pkg/xcolor}} by Dr.\ Uwe Kern. |
| 377 |
|
| 378 |
|
| 379 |
\end{document} |