| 1 |
\documentclass[english,parskip=half-,paper=a4]{scrartcl} |
| 2 |
\usepackage[margin=1.5cm,includeheadfoot]{geometry} |
| 3 |
\RequirePackage[default]{lato} |
| 4 |
\RequirePackage[math-style=french,bold-style=ISO]{lete-sans-math} |
| 5 |
\setsansfont{Fira Sans}[Scale=MatchLowercase] |
| 6 |
\setmonofont{CascadiaMono}[Scale=MatchLowercase] |
| 7 |
|
| 8 |
\usepackage{tkz-interval} |
| 9 |
|
| 10 |
\usepackage{babel} |
| 11 |
\usepackage{enumitem} |
| 12 |
|
| 13 |
\usepackage{minted-code} |
| 14 |
\usepackage{fancyvrb} |
| 15 |
\usepackage{xcolor,url} |
| 16 |
\usepackage[colorlinks]{hyperref} |
| 17 |
\setlength\parindent{0pt} |
| 18 |
|
| 19 |
\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}} |
| 20 |
\def\Largb#1{\texttt{\{}\textit{#1}\texttt{\}}} |
| 21 |
\def\Lpack#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Package!#1@\texttt{#1}}} |
| 22 |
\def\Loption#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Option!#1@\texttt{#1}}} |
| 23 |
|
| 24 |
\title{Interval brackets, with Ti\textit{k}Z (1.0b)} |
| 25 |
\date{October 17, 2025} |
| 26 |
\author{Cédric Pierquet\thanks{\protect\url{[email protected]}}} |
| 27 |
\raggedbottom |
| 28 |
|
| 29 |
\def\IntervtestA{-4 ; \dfrac{1}{7}} |
| 30 |
\def\IntervtestB{\dfrac{1}{2} ; \sqrt{7}} |
| 31 |
|
| 32 |
\begin{document} |
| 33 |
|
| 34 |
\maketitle |
| 35 |
|
| 36 |
\tableofcontents |
| 37 |
|
| 38 |
\section{Introduction} |
| 39 |
|
| 40 |
\subsection{Loading} |
| 41 |
|
| 42 |
To use \Lpack{tkz-interval}, simply use: |
| 43 |
|
| 44 |
\begin{codeblockA}[title=Loading] |
| 45 |
\usepackage{tkz-interval} |
| 46 |
\end{codeblockA} |
| 47 |
|
| 48 |
Used packages are \Lpack{tikz} and \Lpack{simplekv}. |
| 49 |
|
| 50 |
\subsection{Idea(s)} |
| 51 |
|
| 52 |
The idea behind this package is to provide a command for representing an interval with brackets created using Ti\textit{k}Z, with automatic size management and customization of thickness and depth, for examples. |
| 53 |
|
| 54 |
\smallskip |
| 55 |
|
| 56 |
It's also possible to specify around spaces and optional \textit{overlap} for open bracket. |
| 57 |
|
| 58 |
\smallskip |
| 59 |
|
| 60 |
This documentation was created using the \Lpack{minted-code} package. |
| 61 |
|
| 62 |
\subsection{Limitations} |
| 63 |
|
| 64 |
Spaces around and inside seems to be fine, but not perfect and not exactly like \textit{normal} version\ldots |
| 65 |
|
| 66 |
\subsection{First example(s)} |
| 67 |
|
| 68 |
\begin{codeblockA}[title=Samples intervals] |
| 69 |
\def\IntervtestA{ -4 ; \dfrac{1}{7} } |
| 70 |
\def\IntervtestB{ \dfrac{1}{2} ; \sqrt{7} } |
| 71 |
\end{codeblockA} |
| 72 |
|
| 73 |
\begin{exampleM}{} |
| 74 |
%'normal' version |
| 75 |
$x \in \left[ \IntervtestA \right] \cup \left[ \IntervtestB \right[$.\\ |
| 76 |
$x \in \left] \IntervtestA \right[ \cup \left[ \IntervtestB \right[$.\\ |
| 77 |
$x \in \left[ \IntervtestA \right[ \cup \left[ \IntervtestB \right[$.\\ |
| 78 |
$x \in \left] \IntervtestA \right] \cup \left[ \IntervtestB \right[$.\\ |
| 79 |
\end{exampleM} |
| 80 |
|
| 81 |
\begin{exampleM}{} |
| 82 |
%with tkz-interval package |
| 83 |
\setKVdefault[tkzinterv]{left color=teal,right color=red} |
| 84 |
$x \in \tkzinterval{\IntervtestA} \cup \tkzinterval[open]{\IntervtestB}$.\\ |
| 85 |
$x \in \tkzinterval[open]{\IntervtestA} \cup \tkzinterval[open]{\IntervtestB}$.\\ |
| 86 |
$x \in \tkzinterval[open right]{\IntervtestA} \cup \tkzinterval[open]{\IntervtestB}$.\\ |
| 87 |
$x \in \tkzinterval[open left]{\IntervtestA} \cup \tkzinterval[open]{\IntervtestB}$. |
| 88 |
\end{exampleM} |
| 89 |
|
| 90 |
\subsection{History} |
| 91 |
|
| 92 |
\texttt{1.0b}: Improvements with latex3 (tks to Valentin Dao) |
| 93 |
|
| 94 |
\texttt{1.0a}: Initial version |
| 95 |
|
| 96 |
\pagebreak |
| 97 |
|
| 98 |
\section{Usage} |
| 99 |
|
| 100 |
\subsection{Global lengths, local keys} |
| 101 |
|
| 102 |
\begin{codeblockA}[title=Global lengths] |
| 103 |
\setlength\tkzintervhoriz{length} %brackets width (5pt) |
| 104 |
\setlength\tkzintervwidth{length} %brackets thickness (0.7pt) |
| 105 |
\end{codeblockA} |
| 106 |
|
| 107 |
\begin{codeblockA}[title=Local keys] |
| 108 |
\setKVdefault[tkzinterv]{key1 = new default value,...} |
| 109 |
\end{codeblockA} |
| 110 |
|
| 111 |
\subsection{Main macro} |
| 112 |
|
| 113 |
\begin{codeblockA}[title=Macro (english usage)] |
| 114 |
\tkzinterval[type,keys]{lower limit ; upper limit} |
| 115 |
%type can be open / open left / open right (closed by default) |
| 116 |
\end{codeblockA} |
| 117 |
|
| 118 |
\begin{codeblockA}[title=Macro (french usage)] |
| 119 |
\tkzintervalle[type,clés]{borne inf ; borne sup} |
| 120 |
%le type peut-être FF (défaut) / OO / OF / FO |
| 121 |
\end{codeblockA} |
| 122 |
|
| 123 |
\subsection{Keys} |
| 124 |
|
| 125 |
\begin{itemize}[noitemsep] |
| 126 |
\item \texttt{vsep}: vertical space (in \textit{unit}) between box and brackets \hfill(\texttt{0.1em}) |
| 127 |
\item \texttt{overlap}: 'overlap 'effect' (\texttt{lr-l-r-none}) for open bracket \hfill(\texttt{lr}) |
| 128 |
\item \texttt{overlap factor}: overlap factor(s) (\texttt{lr-l/r}) for open brackets \hfill(\texttt{0.5}) |
| 129 |
\item \texttt{hsep}: horizontal margin, as a percentage of the width of the brackets\hfill(\texttt{0.75}) |
| 130 |
\item \texttt{space before}: space before interval \hfill(\texttt{\textbackslash,}) |
| 131 |
\item \texttt{space after}: space after interval \hfill(\texttt{\textbackslash,}) |
| 132 |
\item \texttt{nobeforeafter}: suppress space around interval \hfill(\texttt{false}) |
| 133 |
\end{itemize} |
| 134 |
|
| 135 |
\section{Influence of some parameters} |
| 136 |
|
| 137 |
\subsection{Default values} |
| 138 |
|
| 139 |
\begin{codeblockA}[title=Default values] |
| 140 |
\setlength\tkzintervhoriz{5pt} |
| 141 |
\setlength\tkzintervwidth{0.7pt} |
| 142 |
\setKVdefault[tkzinterv]{hsep=0.75} |
| 143 |
\end{codeblockA} |
| 144 |
|
| 145 |
\setlength\tkzintervhoriz{5pt} |
| 146 |
\setlength\tkzintervwidth{0.7pt} |
| 147 |
\setKVdefault[tkzinterv]{hsep=0.75} |
| 148 |
|
| 149 |
\begin{exampleM}{} |
| 150 |
Let's consider the interval $I=\tkzinterval[open,overlap=lr]{\IntervtestA}$.\par |
| 151 |
Let's consider the interval $I=\tkzinterval[open,overlap=l]{\IntervtestA}$.\par |
| 152 |
Let's consider the interval $I=\tkzinterval[open,overlap=r]{\IntervtestA}$.\par |
| 153 |
Let's consider the interval $I=\tkzinterval[open,overlap=none]{\IntervtestA}$. |
| 154 |
\end{exampleM} |
| 155 |
|
| 156 |
\begin{exampleM}{} |
| 157 |
Let's consider the interval $I=\tkzinterval{ \IntervtestA }$.\\ |
| 158 |
Let's consider the interval $I=\left[ \IntervtestA \right]$. |
| 159 |
\end{exampleM} |
| 160 |
|
| 161 |
\begin{exampleM}{} |
| 162 |
{\huge Let's consider the interval $\mathcolor{red}{I=\tkzinterval{\IntervtestA}}$.} |
| 163 |
\end{exampleM} |
| 164 |
|
| 165 |
\begin{exampleM}{} |
| 166 |
Let's consider the interval $I=\tkzinterval[open left,overlap=l]{\IntervtestA}$.\par |
| 167 |
Let's consider the interval $I=\tkzinterval[open left,overlap=none]{\IntervtestA}$. |
| 168 |
\end{exampleM} |
| 169 |
|
| 170 |
\begin{exampleM}{} |
| 171 |
Let's consider the interval $I=\tkzinterval[open right,overlap=r]{\IntervtestA}$.\par |
| 172 |
Let's consider the interval $I=\tkzinterval[open right,overlap=none]{\IntervtestA}$. |
| 173 |
\end{exampleM} |
| 174 |
|
| 175 |
\subsection{Custom values (v1)} |
| 176 |
|
| 177 |
\begin{codeblockA}[title=Custom values] |
| 178 |
\setlength\tkzintervhoriz{6pt} |
| 179 |
\setlength\tkzintervwidth{0.95pt} |
| 180 |
\setKVdefault[tkzinterv]{hsep=0.5,vsep=1mm} |
| 181 |
\end{codeblockA} |
| 182 |
|
| 183 |
\setlength\tkzintervhoriz{6pt} |
| 184 |
\setlength\tkzintervwidth{0.95pt} |
| 185 |
\setKVdefault[tkzinterv]{hsep=0.5,vsep=1mm} |
| 186 |
|
| 187 |
\begin{exampleM}{} |
| 188 |
Let's consider the interval $I=\tkzinterval[open,overlap=lr]{\IntervtestA}$.\par |
| 189 |
Let's consider the interval $I=\tkzinterval[open,overlap=l]{\IntervtestA}$.\par |
| 190 |
Let's consider the interval $I=\tkzinterval[open,overlap=r]{\IntervtestA}$.\par |
| 191 |
Let's consider the interval $I=\tkzinterval[open,overlap=none]{\IntervtestA}$. |
| 192 |
\end{exampleM} |
| 193 |
|
| 194 |
\begin{exampleM}{} |
| 195 |
Let's consider the interval $I=\tkzinterval{ \IntervtestA }$.\\ |
| 196 |
Let's consider the interval $I=\left[ \IntervtestA \right]$. |
| 197 |
\end{exampleM} |
| 198 |
|
| 199 |
\begin{exampleM}{} |
| 200 |
{\huge Let's consider the interval $\mathcolor{red}{I=\tkzinterval{\IntervtestA}}$.} |
| 201 |
\end{exampleM} |
| 202 |
|
| 203 |
\begin{exampleM}{} |
| 204 |
Let's consider the interval $I=\tkzinterval[open left,overlap=l]{\IntervtestA}$.\par |
| 205 |
Let's consider the interval $I=\tkzinterval[open left,overlap=none]{\IntervtestA}$. |
| 206 |
\end{exampleM} |
| 207 |
|
| 208 |
\begin{exampleM}{} |
| 209 |
Let's consider the interval $I=\tkzinterval[open right,overlap=r]{\IntervtestA}$.\par |
| 210 |
Let's consider the interval $I=\tkzinterval[open right,overlap=none]{\IntervtestA}$. |
| 211 |
\end{exampleM} |
| 212 |
|
| 213 |
\subsection{Custom values (v2)} |
| 214 |
|
| 215 |
\begin{codeblockA}[title=Custom values] |
| 216 |
\setlength\tkzintervhoriz{1.75mm} |
| 217 |
\setlength\tkzintervwidth{0.65mm} |
| 218 |
\setKVdefault[tkzinterv]{hsep=1,vsep=0.125em} |
| 219 |
\end{codeblockA} |
| 220 |
|
| 221 |
\setlength\tkzintervhoriz{1.75mm} |
| 222 |
\setlength\tkzintervwidth{0.65mm} |
| 223 |
\setKVdefault[tkzinterv]{hsep=1,vsep=0.125em} |
| 224 |
|
| 225 |
\begin{exampleM}{} |
| 226 |
Let's consider the interval $I=\tkzinterval[open,overlap=lr]{\IntervtestA}$.\par |
| 227 |
Let's consider the interval $I=\tkzinterval[open,overlap=l]{\IntervtestA}$.\par |
| 228 |
Let's consider the interval $I=\tkzinterval[open,overlap=r]{\IntervtestA}$.\par |
| 229 |
Let's consider the interval $I=\tkzinterval[open,overlap=none]{\IntervtestA}$. |
| 230 |
\end{exampleM} |
| 231 |
|
| 232 |
\begin{exampleM}{} |
| 233 |
Let's consider the interval $I=\tkzinterval{ \IntervtestA }$.\\ |
| 234 |
Let's consider the interval $I=\left[ \IntervtestA \right]$. |
| 235 |
\end{exampleM} |
| 236 |
|
| 237 |
\begin{exampleM}{} |
| 238 |
{\huge Let's consider the interval $\mathcolor{red}{I=\tkzinterval{\IntervtestA}}$.} |
| 239 |
\end{exampleM} |
| 240 |
|
| 241 |
\begin{exampleM}{} |
| 242 |
Let's consider the interval $I=\tkzinterval[open left,overlap=l]{\IntervtestA}$.\par |
| 243 |
Let's consider the interval $I=\tkzinterval[open left,overlap=none]{\IntervtestA}$. |
| 244 |
\end{exampleM} |
| 245 |
|
| 246 |
\begin{exampleM}{} |
| 247 |
Let's consider the interval $I=\tkzinterval[open right,overlap=r]{\IntervtestA}$.\par |
| 248 |
Let's consider the interval $I=\tkzinterval[open right,overlap=none]{\IntervtestA}$. |
| 249 |
\end{exampleM} |
| 250 |
|
| 251 |
\subsection{Overlap factor} |
| 252 |
|
| 253 |
\begin{codeblockA}[title=Custom values] |
| 254 |
\setlength\tkzintervhoriz{5pt} |
| 255 |
\setlength\tkzintervwidth{0.9pt} |
| 256 |
\end{codeblockA} |
| 257 |
|
| 258 |
\setlength\tkzintervhoriz{5pt} |
| 259 |
\setlength\tkzintervwidth{0.9pt} |
| 260 |
|
| 261 |
\begin{exampleM}{} |
| 262 |
\setlength\fboxsep{0.5pt} |
| 263 |
.\fbox{$\tkzinterval[open,overlap factor=0.25] {\dfrac{1}{2};\sqrt{7}}$}.\\ |
| 264 |
.\fbox{$\tkzinterval[open,overlap factor=0.5] {\dfrac{1}{2};\sqrt{7}}$}.\\ |
| 265 |
.\fbox{$\tkzinterval[open,overlap factor=0.75] {\dfrac{1}{2};\sqrt{7}}$}.\\ |
| 266 |
.\fbox{$\tkzinterval[open,overlap factor=1] {\dfrac{1}{2};\sqrt{7}}$}.\\ |
| 267 |
.\fbox{$\tkzinterval[open,overlap factor=0/1] {\dfrac{1}{2};\sqrt{7}}$}. |
| 268 |
\end{exampleM} |
| 269 |
|
| 270 |
\subsection{Samples (v2)} |
| 271 |
|
| 272 |
\begin{codeblockA}[title=Custom values] |
| 273 |
\setlength\tkzintervhoriz{5pt} |
| 274 |
\setlength\tkzintervwidth{0.9pt} |
| 275 |
\setKVdefault[tkzinterv]{hsep=0.75,left color=teal,right color=red} |
| 276 |
\end{codeblockA} |
| 277 |
|
| 278 |
\setlength\tkzintervhoriz{5pt} |
| 279 |
\setlength\tkzintervwidth{0.9pt} |
| 280 |
\setKVdefault[tkzinterv]{hsep=0.75,left color=teal,right color=red} |
| 281 |
|
| 282 |
\begin{exampleM}{} |
| 283 |
\setKVdefault[tkzinterv]{hsep=0.75,left color=teal,right color=red} |
| 284 |
$x \in \tkzinterval[]{4;\dfrac{100}{7}} \cup \tkzinterval[open]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 285 |
$x \in \tkzinterval[open]{4;\dfrac{100}{7}} \cup \tkzinterval[open]{\dfrac{1}{2};\sqrt{7}}$.\hfill\null |
| 286 |
|
| 287 |
\hfill$x \in \tkzinterval[open right]{4;\dfrac{100}{7}} \cup \tkzinterval[open]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 288 |
$x \in \tkzinterval[open left]{4;\dfrac{100}{7}} \cup \tkzinterval[open]{\dfrac{1}{2};\sqrt{7}}$. |
| 289 |
\end{exampleM} |
| 290 |
|
| 291 |
\begin{exampleM}{} |
| 292 |
$x \in \tkzinterval[]{4;\dfrac{100}{7}} \cup \tkzinterval[]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 293 |
$x \in \tkzinterval[open]{4;\dfrac{100}{7}} \cup \tkzinterval[]{\dfrac{1}{2};\sqrt{7}}$.\hfill\null |
| 294 |
|
| 295 |
\hfill$x \in \tkzinterval[open right]{4;\dfrac{100}{7}} \cup \tkzinterval[]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 296 |
$x \in \tkzinterval[open left]{4;\dfrac{100}{7}} \cup \tkzinterval[]{\dfrac{1}{2};\sqrt{7}}$. |
| 297 |
\end{exampleM} |
| 298 |
|
| 299 |
\begin{exampleM}{} |
| 300 |
$x \in \tkzinterval[]{4;\dfrac{100}{7}} \cup \tkzinterval[open left]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 301 |
$x \in \tkzinterval[open]{4;\dfrac{100}{7}} \cup \tkzinterval[open left]{\dfrac{1}{2};\sqrt{7}}$.\hfill\null |
| 302 |
|
| 303 |
\hfill$x \in \tkzinterval[open right]{4;\dfrac{100}{7}} \cup \tkzinterval[open left]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 304 |
$x \in \tkzinterval[open left]{4;\dfrac{100}{7}} \cup \tkzinterval[open left]{\dfrac{1}{2};\sqrt{7}}$. |
| 305 |
\end{exampleM} |
| 306 |
|
| 307 |
\begin{exampleM}{} |
| 308 |
$x \in \tkzinterval[]{4;\dfrac{100}{7}} \cup \tkzinterval[open right]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 309 |
$x \in \tkzinterval[open]{4;\dfrac{100}{7}} \cup \tkzinterval[open right]{\dfrac{1}{2};\sqrt{7}}$.\hfill\null |
| 310 |
|
| 311 |
\hfill$x \in \tkzinterval[open right]{4;\dfrac{100}{7}} \cup \tkzinterval[open right]{\dfrac{1}{2};\sqrt{7}}$.\hfill |
| 312 |
$x \in \tkzinterval[open left]{4;\dfrac{100}{7}} \cup \tkzinterval[open right]{\dfrac{1}{2};\sqrt{7}}$. |
| 313 |
\end{exampleM} |
| 314 |
|
| 315 |
\end{document} |
| 316 |
|