1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
% \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}
%</driver>
% \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,
}
%</package>
% \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}
%</colors>
% \fi
|