% \iffalse
% callouts-box.dtx
% --------------------------------------
% Documented LaTeX source for the callouts-box package
% --------------------------------------
%<*driver>
\documentclass{ltxdoc}
\usepackage{makeidx}
\usepackage{callouts-box}
\makeindex
\begin{document}

\title{The \texttt{callouts-box} Package\\
\smallskip
\small Version 1.1\\
\small Date: 2025/03/14}
\author{Julien Dujardin}
\date{14/03/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.

\begin{notebox}[Note]
This package simplifies the creation of callout boxes in \LaTeX{} documents, making them more readable and visually structured.
\end{notebox}

\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.

\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{Basic Examples}
Here are some examples of how to use the predefined callout boxes:

\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}

\subsection{Advanced Examples}
You can nest callout boxes inside each other:
\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}

You can add equations, lists, or images inside callout boxes:
\begin{successbox}[Success with Equation]
  The famous Pythagorean theorem:
  \[
    a^2 + b^2 = c^2
  \]
\end{successbox}

\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}

\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.
More documentation can be found at : https://ctan.org/pkg/tcolorbox.

\subsubsection{Code exemle}

To adjust layout settings, use the \texttt{tcbset} command:
\begin{verbatim}
{
\tcbset{
  boxsettings/.style={
    boxrule=2pt, arc=20pt,
    left=10pt, right=10pt, top=10pt, bottom=10pt,
    boxsep=10pt, before skip=15pt, after skip=15pt,
    breakable, before upper={\ignorespaces},
    boxrule=2pt, arc=8pt,
    colframe=black, colback=yellow!10,
  }
}

\begin{notebox}[Style Note]
  Style Note
\end{notebox}
}
\end{verbatim}

\subsubsection{Result}

{
\tcbset{
  boxsettings/.style={
    boxrule=2pt, arc=20pt,
    left=10pt, right=10pt, top=10pt, bottom=10pt,
    boxsep=10pt, before skip=15pt, after skip=15pt,
    breakable, before upper={\ignorespaces},
    boxrule=2pt, arc=8pt,
    colframe=black!10, colback=yellow!10,
  }
}

\begin{notebox}[Test Note]
  Note with custom style
\end{notebox}
}


\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}
%</driver>
% \fi

% --------------------------------------
% Package Code
% --------------------------------------
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{callouts-box}[2025/03/14 v1.1 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,
}
%</package>
% \fi

% --------------------------------------
% Colors Package Code
% --------------------------------------
% \iffalse
%<*colors>
\ProvidesPackage{callouts-box-colors}[2025/03/14 v1.1 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}
%</colors>
% \fi