% \iffalse % callouts-box.dtx % -------------------------------------- % Documented LaTeX source for the callouts-box package % -------------------------------------- %<*driver> \documentclass{ltxdoc} \usepackage{makeidx} \makeindex \begin{document} \title{The \texttt{callouts-box} Package\\ \smallskip \small Version 1.0\\ \small Date: 2025/02/14} \author{julinux60} \date{14/02/2025} \maketitle \tableofcontents \section{Introduction} The \texttt{callouts-box} package provides a collection of visually appealing, structured callout boxes for \LaTeX{} documents. These boxes are useful for highlighting important information such as warnings, errors, notes, and success messages. The package is built on top of \texttt{tcolorbox} for highly customizable, breakable callout boxes and \texttt{xcolor} for predefined color schemes. \section{Installation} To install the \texttt{callouts-box} package, place the following files in your \LaTeX{} directory: \begin{itemize} \item \texttt{callouts-box.sty} (Core functionality and environment definitions) \item \texttt{callouts-box-colors.sty} (Predefined color definitions for callouts) \end{itemize} Then, include the package in your document preamble: \begin{verbatim} \usepackage{callouts-box} \end{verbatim} \section{Usage} The package provides four predefined callout box environments: \DescribeEnv{warningbox} \DescribeEnv{errorbox} \DescribeEnv{notebox} \DescribeEnv{successbox} Each environment takes an optional argument for the box title. If no title is provided, a default title is used. \subsection{Basic Examples} Here are some examples of how to use the predefined callout boxes: \begin{verbatim} \begin{warningbox}[Custom Warning Title] This is a warning message. \end{warningbox} \begin{errorbox} This is an error message. \end{errorbox} \begin{notebox}[Important Note] This is a note. \end{notebox} \begin{successbox} This is a success message. \end{successbox} \end{verbatim} \subsection{Advanced Examples} You can nest callout boxes inside each other: \begin{verbatim} \begin{warningbox}[Outer Warning] This is an outer warning message. \begin{notebox}[Nested Note] This is a nested note inside a warning. \end{notebox} \end{warningbox} \end{verbatim} You can add equations, lists, or images inside callout boxes: \begin{verbatim} \begin{successbox}[Success with Equation] The famous Pythagorean theorem: \[ a^2 + b^2 = c^2 \] \end{successbox} \end{verbatim} \begin{verbatim} \begin{notebox}[Note with List] Key points to remember: \begin{itemize} \item Callout boxes can contain lists. \item They can also include images. \end{itemize} \end{notebox} \end{verbatim} \subsection{Customization} Users can modify the visual appearance of callout boxes by editing \texttt{callouts-box-colors.sty} or overriding the \texttt{tcbset} settings in their document. \DescribeMacro{\tcbset} To adjust layout settings, use the \texttt{tcbset} command: \begin{verbatim} \tcbset{ boxsettings/.style={ boxrule=2pt, rounded corners=10pt, arc=10pt, left=10pt, right=10pt, top=10pt, bottom=10pt, boxsep=10pt, before skip=15pt, after skip=15pt, breakable, before upper={\ignorespaces}, } } \end{verbatim} \section{Defining Custom Boxes} You can define your own callout box styles using \texttt{NewTColorBox}. Example: \begin{verbatim} \definecolor{custom-border}{HTML}{FFA500} \definecolor{custom-content}{HTML}{FFF3E0} \definecolor{custom-text}{HTML}{FF6D00} \NewTColorBox{custombox}{ O{Custom Box} o }{ colframe=custom-border, colback=custom-content, coltitle=custom-text, fonttitle=\bfseries, coltext=custom-text, title={#1}, } \end{verbatim} To use the custom box: \begin{verbatim} \begin{custombox}[My Custom Box] This is a custom box. \end{custombox} \end{verbatim} \section{Complete Example} Here is a complete document using the \texttt{callouts-box} package: \begin{verbatim} \documentclass{article} \usepackage{callouts-box} \begin{document} \begin{warningbox}[Warning] This is a warning message. \end{warningbox} \begin{successbox}[Success] This is a success message. \end{successbox} \begin{notebox}[Math Example] \[ E = mc^2 \] \end{notebox} \end{document} \end{verbatim} \section{License} This package is distributed under the \LaTeX{} Project Public License (LPPL), version 1.3 or later. For more details, see the \texttt{LICENSE} file. \PrintIndex \end{document} % % \fi % -------------------------------------- % Package Code % -------------------------------------- % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{callouts-box}[2025/02/14 v1.0 Styled callout boxes] \RequirePackage{xcolor} \RequirePackage{tcolorbox} \tcbuselibrary{breakable} \RequirePackage{callouts-box-colors} \tcbset{ boxsettings/.style={ boxrule=1pt, rounded corners=all, arc=5pt, left=5pt, right=5pt, top=5pt, bottom=5pt, boxsep=5pt, before skip=10pt, after skip=10pt, breakable, before upper={\ignorespaces}, } } % Define callout box environments \NewTColorBox{warningbox}{ O{Warning} }{ colframe=warning-border, colback=warning-content, coltitle=warning-text, fonttitle=\bfseries, coltext=warning-text, title={#1}, boxsettings, } \NewTColorBox{errorbox}{ O{Error} }{ colframe=error-border, colback=error-content, coltitle=error-text, fonttitle=\bfseries, coltext=error-text, title={#1}, boxsettings, } \NewTColorBox{notebox}{ O{Note} }{ colframe=note-border, colback=note-content, coltitle=note-text, fonttitle=\bfseries, coltext=note-text, title={#1}, boxsettings, } \NewTColorBox{successbox}{ O{Success} }{ colframe=success-border, colback=success-content, coltitle=success-text, fonttitle=\bfseries, coltext=success-text, title={#1}, boxsettings, } % % \fi % -------------------------------------- % Colors Package Code % -------------------------------------- % \iffalse %<*colors> \ProvidesPackage{callouts-box-colors}[2025/02/14 v1.0 Predefined colors for callouts-box] \RequirePackage{xcolor} % Define colors for callout boxes \definecolor{warning-title}{HTML}{FAE2A0} \definecolor{warning-content}{HTML}{FFFCF4} \definecolor{warning-text}{HTML}{5C4813} \definecolor{warning-border}{HTML}{FAE2A0} \definecolor{error-title}{HTML}{FAA0A0} \definecolor{error-content}{HTML}{FFF4F4} \definecolor{error-text}{HTML}{5C1313} \definecolor{error-border}{HTML}{FAA0A0} \definecolor{note-title}{HTML}{A3A0FA} \definecolor{note-content}{HTML}{F4F6FF} \definecolor{note-text}{HTML}{1E135C} \definecolor{note-border}{HTML}{A3A0FA} \definecolor{success-title}{HTML}{91DF96} \definecolor{success-content}{HTML}{F7FFF4} \definecolor{success-text}{HTML}{104F20} \definecolor{success-border}{HTML}{91DF96} % % \fi