| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass[11pt,a4paper]{ltxdoc} |
| 6 |
\usepackage{thematicpuzzle} |
| 7 |
\usepackage{fancyvrb} |
| 8 |
\usepackage{fancyhdr} |
| 9 |
\usepackage{hyperref} |
| 10 |
\usepackage{tcolorbox} |
| 11 |
\tcbuselibrary{listings,listingsutf8} |
| 12 |
\fancyhf{} |
| 13 |
\renewcommand{\headrulewidth}{0pt} |
| 14 |
\lfoot{\sffamily\small [thematicpuzzle]} |
| 15 |
\rfoot{\sffamily\small - \thepage{} -} |
| 16 |
\usepackage{hologo} |
| 17 |
\usepackage{xspace} |
| 18 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 19 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 20 |
\providecommand\PSTricks{\textsf{PSTricks}\xspace} |
| 21 |
\let\pstricks\PSTricks |
| 22 |
\let\TikZ\tikzlogo |
| 23 |
|
| 24 |
\urlstyle{same} |
| 25 |
\hypersetup{pdfborder=0 0 0} |
| 26 |
\usepackage[margin=2cm]{geometry} |
| 27 |
\setlength{\parindent}{0pt} |
| 28 |
\def\TPversion{0.1.3} |
| 29 |
\def\TPdate{04/08/2025} |
| 30 |
\usepackage{soul} |
| 31 |
\usepackage{codehigh} |
| 32 |
\usepackage{tabularray} |
| 33 |
\sethlcolor{lightgray!25} |
| 34 |
\NewDocumentCommand\MontreCode{ m }{% |
| 35 |
\hl{\vphantom{\texttt{pf}}\texttt{#1}}% |
| 36 |
} |
| 37 |
\usepackage[english]{babel} |
| 38 |
|
| 39 |
\begin{document} |
| 40 |
|
| 41 |
\pagestyle{fancy} |
| 42 |
|
| 43 |
\thispagestyle{empty} |
| 44 |
|
| 45 |
\begin{center} |
| 46 |
\begin{minipage}{0.88\linewidth} |
| 47 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 48 |
\begin{center} |
| 49 |
\begin{tabular}{c} |
| 50 |
{\Huge \texttt{thematicpuzzle [en]}}\\ |
| 51 |
\\ |
| 52 |
{\LARGE Present a horizontal 'puzzle',} \\ |
| 53 |
{\LARGE with different themes.} \\ |
| 54 |
\\ |
| 55 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 56 |
\end{tabular} |
| 57 |
\end{center} |
| 58 |
\end{tcolorbox} |
| 59 |
\end{minipage} |
| 60 |
\end{center} |
| 61 |
|
| 62 |
\begin{center} |
| 63 |
\begin{tabular}{c} |
| 64 |
\texttt{Cédric Pierquet}\\ |
| 65 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 66 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/thematicpuzzle}} \\ |
| 67 |
\end{tabular} |
| 68 |
\end{center} |
| 69 |
|
| 70 |
\hrule |
| 71 |
|
| 72 |
\vfill |
| 73 |
|
| 74 |
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center] |
| 75 |
\ThematicPuzzle[BgColors={yellow!50,purple!50}]{A,B,C,D,E,F,G,H} |
| 76 |
\end{tcolorbox} |
| 77 |
|
| 78 |
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center] |
| 79 |
\ThematicPuzzle[Thickness=1.25pt,Scale=2.75,BgColors={yellow!10,orange!10,green!10,teal!10,purple!10},Labels={Angry,Python,Cool,Apple,Battery},BorderColor=darkgray,IconsColor=teal!50!black]{\faAngry,\faPython,\faAngellist,\faApple*,\faBatteryHalf} |
| 80 |
\end{tcolorbox} |
| 81 |
|
| 82 |
\vfill |
| 83 |
|
| 84 |
\hfill{\footnotesize\itshape Tks to quark67 for his feedbacks.} |
| 85 |
|
| 86 |
\pagebreak |
| 87 |
|
| 88 |
\phantomsection |
| 89 |
|
| 90 |
\hypertarget{matoc}{} |
| 91 |
|
| 92 |
\tableofcontents |
| 93 |
|
| 94 |
\vspace*{5mm} |
| 95 |
|
| 96 |
\hrule |
| 97 |
|
| 98 |
\vspace*{5mm} |
| 99 |
|
| 100 |
\section{Introduction} |
| 101 |
|
| 102 |
\subsection{Description} |
| 103 |
|
| 104 |
With this package, it is possible to create a \textit{horizontal banner}, in the form of a puzzle, with different themes. |
| 105 |
|
| 106 |
The styles are \textit{globally} fixed, but it is possible to configure: |
| 107 |
|
| 108 |
\begin{itemize} |
| 109 |
\item colors; |
| 110 |
\item icons; |
| 111 |
\item labels. |
| 112 |
\end{itemize} |
| 113 |
|
| 114 |
The interior \textit{borders} are randomly oriented to the left or to the right, and the code takes care of coloring (if applicable) the parts satisfactorily. |
| 115 |
|
| 116 |
\subsection{Decorations} |
| 117 |
|
| 118 |
For the moment, the \textit{decorations} of the parts must be declared as characters, for example with icons from the \MontreCode{fontawesome5} package (loaded by the package). |
| 119 |
|
| 120 |
\smallskip |
| 121 |
|
| 122 |
Ultimately, it may be possible to insert images or \TikZ\ codes, this is one of the areas for improvement. |
| 123 |
|
| 124 |
\subsection{Loading} |
| 125 |
|
| 126 |
To load the package, simply add in the preamble: |
| 127 |
|
| 128 |
\begin{quote} |
| 129 |
\begin{verbatim} |
| 130 |
\usepackage{thematicpuzzle} %with fa5, default |
| 131 |
\usepackage[fa6]{thematicpuzzle} %with fa6 (test) |
| 132 |
\usepackage[fa7]{thematicpuzzle} %with fa7 (test) |
| 133 |
\usepackage[nofa]{thematicpuzzle} %w/o fa (test), manually loading |
| 134 |
\end{verbatim} |
| 135 |
\end{quote} |
| 136 |
|
| 137 |
The useful and loaded packages are: |
| 138 |
|
| 139 |
\begin{itemize} |
| 140 |
\item \MontreCode{tikz}, \MontreCode{fontawesome5} et \MontreCode{xintexpr}; |
| 141 |
\item \MontreCode{simplekv}, \MontreCode{listofitems} et \MontreCode{xstring}. |
| 142 |
\end{itemize} |
| 143 |
|
| 144 |
\vfill |
| 145 |
|
| 146 |
\subsection{History} |
| 147 |
|
| 148 |
\begin{quote} |
| 149 |
\begin{verbatim} |
| 150 |
0.1.3: Bugfix + pre-compatibility with fa5/6/7 |
| 151 |
0.1.2: Bugfix + pre-compatibility with fa5/6 |
| 152 |
0.1.1: Enhancements for colors |
| 153 |
0.1.0: Initial release |
| 154 |
\end{verbatim} |
| 155 |
\end{quote} |
| 156 |
|
| 157 |
\pagebreak |
| 158 |
|
| 159 |
\section{The macro} |
| 160 |
|
| 161 |
\subsection{General usage, keys and options} |
| 162 |
|
| 163 |
In order to create a \textit{theme puzzle}, the command is: |
| 164 |
|
| 165 |
\begin{quote} |
| 166 |
\begin{verbatim} |
| 167 |
%----thematic puzzle |
| 168 |
\ThematicPuzzle[keys]<tikz options>{decoration list} |
| 169 |
\end{verbatim} |
| 170 |
\end{quote} |
| 171 |
|
| 172 |
The \textsf{keys}, optional and between \MontreCode{[...]}, are: |
| 173 |
|
| 174 |
\begin{itemize} |
| 175 |
\item \MontreCode{Thickness}:= thickness of the lines (\MontreCode{1pt} by default); |
| 176 |
\item \MontreCode{Scale}:= global scale of the figure (\MontreCode{1} by default); |
| 177 |
\item \MontreCode{BgColors}:= background color(s) (see paragraph on colors); |
| 178 |
\item \MontreCode{BorderColor}:= color(s) of the borders (\MontreCode{black} by default); |
| 179 |
\item \MontreCode{Labels}:= (optional) labels of the themes (\MontreCode{\{\}} by default); |
| 180 |
\item \MontreCode{ScaleLabels}:= label scale (\MontreCode{1.15} by default); |
| 181 |
\item \MontreCode{FontLabels}:= label font (\MontreCode{\textbackslash tiny\textbackslash sffamily} by default); |
| 182 |
\item \MontreCode{IconsColor}:= color of icons and labels (\MontreCode{black} by default). |
| 183 |
\end{itemize} |
| 184 |
|
| 185 |
\medskip |
| 186 |
|
| 187 |
The optional argument, between \MontreCode{<...>}, corresponds to specific options (in \TikZ\ language) to pass to the created environment. |
| 188 |
|
| 189 |
\smallskip |
| 190 |
|
| 191 |
The obligatory argument, between \MontreCode{\{...\}}, corresponds to the list of decorations (in the form of \textit{characters}) of the different puzzle pieces, within form \MontreCode{\{deco<1>,deco<2>,...,deco<n>\}} |
| 192 |
|
| 193 |
\subsection{The colors of the boxes} |
| 194 |
|
| 195 |
Concerning the color of the boxes, it's the key \MontreCode{BgColors} which is in charge. |
| 196 |
|
| 197 |
It can work in several ways: |
| 198 |
|
| 199 |
\begin{itemize} |
| 200 |
\item by default it is empty, which does not color the boxes; |
| 201 |
\item it can be given in a single form, via \MontreCode{BgColors=mycolor}, in which case all the boxes are of the same color; |
| 202 |
\item we can give it in the form of a list \MontreCode{BgColors=\{mycolorA,mycolorB,...\}} and: |
| 203 |
\begin{itemize} |
| 204 |
\item in the case where the number of colors is sufficient, they are used one after the other; |
| 205 |
\item otherwise, the code takes care of \textit{repeating} the pattern of the proposed colors. |
| 206 |
\end{itemize} |
| 207 |
\end{itemize} |
| 208 |
|
| 209 |
\pagebreak |
| 210 |
|
| 211 |
\subsection{Examples} |
| 212 |
|
| 213 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} |
| 214 |
\ThematicPuzzle{\faAngry,\faArchway,\faAtlas,\faAtom} |
| 215 |
\end{tcblisting} |
| 216 |
|
| 217 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} |
| 218 |
\ThematicPuzzle[Labels={Maths,History,Geo,Chemistry},BgColors={yellow!25,red!25}]% |
| 219 |
{\faAngry,\faArchway,\faAtlas,\faAtom} |
| 220 |
\end{tcblisting} |
| 221 |
|
| 222 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} |
| 223 |
\ThematicPuzzle% |
| 224 |
[Scale=2,BgColors=yellow!25,Labels={Maths,History,Geo,Chemistry}]% |
| 225 |
{\faAngry,\faArchway,\faAtlas,\faAtom} |
| 226 |
\end{tcblisting} |
| 227 |
|
| 228 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} |
| 229 |
\ThematicPuzzle% |
| 230 |
[Scale=3,BgColors={yellow!10,orange!10,red!10,teal!10}, |
| 231 |
Labels={Maths,History,Geo,Chemistry}]% |
| 232 |
{\faAngry,\faArchway,\faAtlas,\faAtom} |
| 233 |
\end{tcblisting} |
| 234 |
|
| 235 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} |
| 236 |
\ThematicPuzzle% |
| 237 |
[Thickness=2pt,Scale=1.25, |
| 238 |
BgColors={yellow!10,orange!10,red!10,teal!10,purple!10,gray!10}, |
| 239 |
IconsColor=teal!50!black]% |
| 240 |
{P,Y,T,H,O,N} |
| 241 |
\end{tcblisting} |
| 242 |
|
| 243 |
\end{document} |