| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass{article} |
| 6 |
\usepackage[utf8]{inputenc} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{amsmath,amssymb} |
| 9 |
\usepackage{PixelArtTikz} |
| 10 |
\usepackage{couleurs-fr} |
| 11 |
\usepackage{fontawesome5} |
| 12 |
\usepackage{enumitem} |
| 13 |
\usepackage{tabularray} |
| 14 |
\usepackage{multicol} |
| 15 |
\usepackage{fancyvrb} |
| 16 |
\usepackage{fancyhdr} |
| 17 |
\fancyhf{} |
| 18 |
\renewcommand{\headrulewidth}{0pt} |
| 19 |
\lfoot{\sffamily\small [PixelArtTikz]} |
| 20 |
\cfoot{\sffamily\small - \thepage{} -} |
| 21 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 22 |
|
| 23 |
%\usepackage{hvlogos} |
| 24 |
\usepackage{hologo} |
| 25 |
\usepackage{xspace} |
| 26 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 27 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 28 |
\providecommand\PSTricks{\textsf{PSTricks}\xspace} |
| 29 |
\let\pstricks\PSTricks |
| 30 |
\let\TikZ\tikzlogo |
| 31 |
\newcommand\TableauDocumentation{% |
| 32 |
\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} |
| 33 |
{\huge \LaTeX} & & & & &\\ |
| 34 |
& {\huge \hologo{pdfLaTeX}} & & & & \\ |
| 35 |
& & {\huge \hologo{LuaLaTeX}} & & & \\ |
| 36 |
& & & {\huge \TikZ} & & \\ |
| 37 |
& & & & {\huge \TeXLive} & \\ |
| 38 |
& & & & & {\huge \hologo{MiKTeX}} \\ |
| 39 |
\end{tblr} |
| 40 |
} |
| 41 |
|
| 42 |
\usepackage{hyperref} |
| 43 |
\urlstyle{same} |
| 44 |
\hypersetup{pdfborder=0 0 0} |
| 45 |
\usepackage[margin=1.5cm]{geometry} |
| 46 |
\setlength{\parindent}{0pt} |
| 47 |
|
| 48 |
\def\TPversion{0.20a} |
| 49 |
\def\TPdate{07/12/2025} |
| 50 |
\usepackage{minted2} |
| 51 |
\usepackage[most]{tcolorbox} |
| 52 |
\tcbuselibrary{minted} |
| 53 |
\NewTCBListing{PresentationCode}{ O{blue} m }{% |
| 54 |
sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,% |
| 55 |
colback=#1!1!white,colframe=#1!75!black,colbacklower=white,% |
| 56 |
attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,% |
| 57 |
boxed title style={% |
| 58 |
colframe=#1!75!black,colback=#1!15!white,% |
| 59 |
,sharp corners=downhill,arc=12pt,% |
| 60 |
},% |
| 61 |
fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,% |
| 62 |
listing engine=minted,minted style=colorful, |
| 63 |
minted language=tex,minted options={tabsize=4,fontsize=\footnotesize,autogobble}, |
| 64 |
#2 |
| 65 |
} |
| 66 |
\usepackage[english]{babel} |
| 67 |
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} |
| 68 |
|
| 69 |
\begin{document} |
| 70 |
|
| 71 |
\pagestyle{fancy} |
| 72 |
|
| 73 |
\thispagestyle{empty} |
| 74 |
|
| 75 |
\vspace{2cm} |
| 76 |
|
| 77 |
\begin{center} |
| 78 |
\begin{minipage}{0.75\linewidth} |
| 79 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 80 |
\begin{center} |
| 81 |
\begin{tabular}{c} |
| 82 |
{\Huge \texttt{PixelArtTikz [en]}}\\ |
| 83 |
\\ |
| 84 |
{\LARGE PixelArts, with Ti\textit{k}Z}, \\ |
| 85 |
\\ |
| 86 |
{\LARGE with solution and colors.} \\ |
| 87 |
\end{tabular} |
| 88 |
|
| 89 |
\medskip |
| 90 |
|
| 91 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 92 |
\end{center} |
| 93 |
\end{tcolorbox} |
| 94 |
\end{minipage} |
| 95 |
\end{center} |
| 96 |
|
| 97 |
\vspace{0.5cm} |
| 98 |
|
| 99 |
\begin{center} |
| 100 |
\begin{tabular}{c} |
| 101 |
\texttt{Cédric Pierquet}\\ |
| 102 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 103 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/pixelarttikz}} |
| 104 |
\end{tabular} |
| 105 |
\end{center} |
| 106 |
|
| 107 |
\vspace{0.25cm} |
| 108 |
|
| 109 |
{$\blacktriangleright$~~Commands to display PixelArts.} |
| 110 |
|
| 111 |
\smallskip |
| 112 |
|
| 113 |
{$\blacktriangleright$~~Environment to complete the PixelArt.} |
| 114 |
|
| 115 |
\smallskip |
| 116 |
|
| 117 |
\vspace{1cm} |
| 118 |
|
| 119 |
\begin{center} |
| 120 |
\begin{filecontents*}[overwrite]{test1.csv} |
| 121 |
-,-,-,-,-,-,4,4,4,4,-,-,-,-,-,- |
| 122 |
-,-,-,-,4,4,1,1,1,1,4,4,-,-,-,- |
| 123 |
-,-,-,4,1,1,1,1,1,1,1,1,4,-,-,- |
| 124 |
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,- |
| 125 |
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,- |
| 126 |
-,4,1,9,9,1,1,1,1,1,1,9,9,1,4,- |
| 127 |
-,4,9,9,9,9,4,4,4,4,9,9,9,9,4,- |
| 128 |
-,4,9,4,9,9,4,4,4,4,9,4,9,9,4,- |
| 129 |
-,4,1,9,9,9,4,4,4,4,9,9,9,1,4,- |
| 130 |
-,-,4,1,1,9,4,4,4,4,9,1,1,4,-,- |
| 131 |
-,-,4,1,1,1,4,4,4,4,1,1,1,4,-,- |
| 132 |
-,-,-,4,1,1,1,4,4,1,1,1,4,-,-,- |
| 133 |
-,-,4,3,1,1,1,1,1,1,1,1,3,4,-,- |
| 134 |
-,4,6,3,1,1,1,1,1,1,1,1,3,6,4,- |
| 135 |
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,- |
| 136 |
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,- |
| 137 |
-,4,6,4,1,1,1,4,4,1,1,1,4,6,4,- |
| 138 |
2,2,4,2,4,4,4,2,2,4,4,4,2,4,2,2 |
| 139 |
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 |
| 140 |
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 |
| 141 |
-,-,-,-,-,4,1,1,1,1,4,-,-,-,-,- |
| 142 |
-,-,-,-,-,-,4,1,1,4,-,-,-,-,-,- |
| 143 |
-,-,-,-,-,-,-,4,4,-,-,-,-,-,-,- |
| 144 |
\end{filecontents*} |
| 145 |
|
| 146 |
\PixlArtTikz[Codes=123469,Style=\ttfamily,Unit=0.35]{test1.csv} |
| 147 |
~~ |
| 148 |
\PixlArtTikz[Codes=123469,Symbols={A,B,C,D,E,F},Symb,Style=\ttfamily,Unit=0.35]{test1.csv} |
| 149 |
~~ |
| 150 |
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35]{test1.csv} |
| 151 |
\end{center} |
| 152 |
|
| 153 |
\vspace{0.5cm} |
| 154 |
|
| 155 |
%\hfill{}\textit{Merci aux membres du groupe \faFacebook{} du \og Coin \LaTeX{} \fg{} pour leur aide et leurs idées !} |
| 156 |
|
| 157 |
%\hfill{}\textit{Merci à Denis Bitouzé et à Patrick Bideault pour leurs retours et idées !} |
| 158 |
|
| 159 |
\vfill |
| 160 |
|
| 161 |
\hrule |
| 162 |
|
| 163 |
\medskip |
| 164 |
|
| 165 |
\TableauDocumentation |
| 166 |
|
| 167 |
\medskip |
| 168 |
|
| 169 |
\hrule |
| 170 |
|
| 171 |
\medskip |
| 172 |
|
| 173 |
\newpage |
| 174 |
|
| 175 |
\phantomsection |
| 176 |
\hypertarget{matoc}{} |
| 177 |
|
| 178 |
\tableofcontents |
| 179 |
|
| 180 |
\newpage |
| 181 |
|
| 182 |
\part{Introduction} |
| 183 |
|
| 184 |
\section{The package PixelArtTikz} |
| 185 |
|
| 186 |
\subsection{Introduction} |
| 187 |
|
| 188 |
The idea is to \textit{propose}, within a Ti\textit{k}Z environment, a macro to generate PixelArt. |
| 189 |
|
| 190 |
The data is \textit{read} from a \textsf{csv} file, already existing in the folder of the \textsf{tex} file, or created on-the-fly by \textsf{filecontents}. |
| 191 |
|
| 192 |
\medskip |
| 193 |
|
| 194 |
Some advices about the \textsf{cvs} file: |
| 195 |
|
| 196 |
\begin{itemize} |
| 197 |
\item the \textsf{csv} file must use "," as separator; |
| 198 |
\item empty cells are coded by "\texttt{-}". |
| 199 |
\end{itemize} |
| 200 |
|
| 201 |
\begin{PresentationCode}{listing only} |
| 202 |
\begin{filecontents*}{filename.csv} |
| 203 |
A,B,C,D |
| 204 |
A,B,D,C |
| 205 |
B,A,C,D |
| 206 |
B,A,D,C |
| 207 |
\end{filecontents*} |
| 208 |
\end{PresentationCode} |
| 209 |
|
| 210 |
While compiling, the file \textsf{filename.csv} will be created, and the option \Cle{[overwrite]} will propagate the modifications! |
| 211 |
|
| 212 |
\subsection{Loading of the package, and option} |
| 213 |
|
| 214 |
The package \textsf{csvsimple} is necessary in order to read the \textsf{csv} file. |
| 215 |
|
| 216 |
The package is available in two versions, one written in \hologo{LaTeX2e} and the other in \hologo{LaTeX3}. By default, \textsf{PixelArtTikz} loads the \hologo{LaTeX3} version, but an \textit{option} is available to work with the \hologo{LaTeX2e} version. |
| 217 |
|
| 218 |
\smallskip |
| 219 |
|
| 220 |
The option \Cle{[csvii]} forces the usage of the \hologo{LaTeX2e} version. |
| 221 |
|
| 222 |
\begin{PresentationCode}{listing only} |
| 223 |
\usepackage{PixelArtTikz} %package latex3 |
| 224 |
%which loads |
| 225 |
%\RequirePackage{expl3} |
| 226 |
%\RequirePackage[l3]{csvsimple} |
| 227 |
|
| 228 |
\usepackage[csvii]{PixelArtTikz} %package latex2 |
| 229 |
%which loads |
| 230 |
%\RequirePackage[legacy]{csvsimple} |
| 231 |
\end{PresentationCode} |
| 232 |
|
| 233 |
\subsection{Used packages} |
| 234 |
|
| 235 |
It's fully compatible with usual \hologo{LaTeX} engines, such as \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex}. |
| 236 |
|
| 237 |
\medskip |
| 238 |
|
| 239 |
It loads the following packages and libraries: |
| 240 |
|
| 241 |
\begin{itemize} |
| 242 |
\item \texttt{tikz}, \texttt{xintexpr} et \texttt{xinttools}; |
| 243 |
\item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} and \texttt{listofitems}. |
| 244 |
\end{itemize} |
| 245 |
|
| 246 |
\pagebreak |
| 247 |
|
| 248 |
\subsection{Macros and environment} |
| 249 |
|
| 250 |
There are two ways to create PixelArt: |
| 251 |
|
| 252 |
\begin{itemize} |
| 253 |
\item with an independent macro; |
| 254 |
\item with a Ti\textit{k}Z environment in order to add code afterwards. |
| 255 |
\end{itemize} |
| 256 |
|
| 257 |
\begin{PresentationCode}{listing only} |
| 258 |
%Independent macro |
| 259 |
\PixlArtTikz[keys]<options tikz>{file.csv} |
| 260 |
|
| 261 |
%Semi-independent macro, in a tiks environment |
| 262 |
\PixlArtTikz*[keys]{file.csv} |
| 263 |
|
| 264 |
%environment |
| 265 |
\begin{EnvPixlArtTikz}[keys]<options tikz>{file.csv} |
| 266 |
%tikz code |
| 267 |
\end{EnvPixlArtTikz} |
| 268 |
\end{PresentationCode} |
| 269 |
|
| 270 |
\section{Colors} |
| 271 |
|
| 272 |
Concerning colors: the user can use all colors provided by loaded packages! |
| 273 |
|
| 274 |
\smallskip |
| 275 |
|
| 276 |
Without extra packages, the available colors are: |
| 277 |
|
| 278 |
\smallskip |
| 279 |
|
| 280 |
\begin{tblr}{width=\linewidth,colspec={*{10}{X[m,c]}},cells={font=\small\ttfamily}} |
| 281 |
\SetCell{bg=magenta} magenta & |
| 282 |
\SetCell{bg=cyan} cyan & |
| 283 |
\SetCell{bg=blue,fg=white} blue & |
| 284 |
\SetCell{bg=green} green & |
| 285 |
\SetCell{bg=red} red & |
| 286 |
\SetCell{bg=darkgray,fg=white} darkgray & |
| 287 |
\SetCell{bg=olive,fg=white} olive & |
| 288 |
\SetCell{bg=lime} lime & |
| 289 |
\SetCell{bg=brown} brown & |
| 290 |
\SetCell{bg=lightgray} lightgray \\ |
| 291 |
\SetCell{bg=white} white & |
| 292 |
\SetCell{bg=gray,fg=white} gray & |
| 293 |
\SetCell{bg=black,fg=white} black & |
| 294 |
\SetCell{bg=yellow} yellow & |
| 295 |
\SetCell{bg=violet,fg=white} violet & |
| 296 |
\SetCell{bg=teal,fg=white} teal & |
| 297 |
\SetCell{bg=purple,fg=white} purple & |
| 298 |
\SetCell{bg=pink} pink & |
| 299 |
\SetCell{bg=orange} orange & \\ |
| 300 |
\end{tblr} |
| 301 |
|
| 302 |
\pagebreak |
| 303 |
|
| 304 |
\part{Macros and environment} |
| 305 |
|
| 306 |
\section{Main macro} |
| 307 |
|
| 308 |
\subsection{Example} |
| 309 |
|
| 310 |
The macro \texttt{\textbackslash PixlArtTikz} needs: |
| 311 |
|
| 312 |
\begin{itemize} |
| 313 |
\item the file \textsf{csv}; |
| 314 |
\item the list (by a string) of codes used in the file \textsf{csv} (e.g.\ \texttt{234679} or \texttt{ABCDJK}\ldots); |
| 315 |
\item the list of symbols (if needed) to print in the cells, e.g.\ \texttt{25,44,12} or \texttt{AA,AB,AC}; |
| 316 |
\item the list of colors (for the correction), same order as the codes. |
| 317 |
\end{itemize} |
| 318 |
|
| 319 |
We can begin by creating the file \textsf{csv}, directly within the \textsf{tex} code, or with a external file. |
| 320 |
|
| 321 |
\begin{PresentationCode}{} |
| 322 |
%creation of the csv |
| 323 |
\begin{filecontents*}[overwrite]{base.csv} |
| 324 |
A,B,C,D |
| 325 |
A,B,D,C |
| 326 |
B,A,D,C |
| 327 |
C,A,B,D |
| 328 |
\end{filecontents*} |
| 329 |
\end{PresentationCode} |
| 330 |
|
| 331 |
\begin{PresentationCode}{} |
| 332 |
%instructions and pixelarts |
| 333 |
\begin{center} |
| 334 |
\begin{tblr}{colspec={*{4}{Q[1.25cm,c,m]}},hlines,vlines,rows={1.15em}} |
| 335 |
\SetCell[c=4]{c} Instructions & & & \\ |
| 336 |
A & B & C & D \\ |
| 337 |
45 & 22 & 1 & 7 \\ |
| 338 |
Black & Green & Yellow & Red \\ |
| 339 |
\end{tblr} |
| 340 |
\end{center} |
| 341 |
|
| 342 |
\PixlArtTikz[Codes=ABCD,Style=\large\sffamily,Unit=0.85]{base.csv} |
| 343 |
~~ |
| 344 |
\PixlArtTikz[Codes=ABCD,Symbols={45,22,1,7},Symb,Style=\large\sffamily,Unit=0.85]{base.csv} |
| 345 |
~~ |
| 346 |
\PixlArtTikz[Codes=ABCD,Colors={black,green,yellow,red},Correction,Unit=0.85]{base.csv} |
| 347 |
~~ |
| 348 |
\PixlArtTikz[Codes=ABCD,Colors={black,green,yellow,red},Correction,Border=false,Unit=0.85]{base.csv} |
| 349 |
\end{PresentationCode} |
| 350 |
|
| 351 |
\pagebreak |
| 352 |
|
| 353 |
\subsection{Options and keys} |
| 354 |
|
| 355 |
\begin{PresentationCode}{listing only} |
| 356 |
\PixlArtTikz[keys]<options tikz>{file.csv} |
| 357 |
\end{PresentationCode} |
| 358 |
|
| 359 |
The first argument, \textit{optional} and between \texttt{[...]} proposes the \textsf{keys}: |
| 360 |
|
| 361 |
\begin{itemize} |
| 362 |
\item the key \Cle{Codes} with the \textit{string} of \textit{simple} codes of the \textsf{csv} file; |
| 363 |
\item the key \Cle{Colors} with the \textit{list} of colors; |
| 364 |
\item the key \Cle{Symbols} with the \textit{optional list} of alt.\ symbols for the cells; |
| 365 |
\item the boolean \Cle{Correction} to color the PixelArt;\hfill{}default \textsf{false} |
| 366 |
\item the boolean \Cle{Symb} to print the symbols;\hfill{}default \textsf{false} |
| 367 |
\item the boolean \Cle{Border} to print borders of the cells;\hfill{}default \textsf{true} |
| 368 |
\item the key \Cle{Style} to specifythe style of the text. \hfill{}default \textsf{\textbackslash scriptsize} |
| 369 |
\end{itemize} |
| 370 |
|
| 371 |
The second argument, \textit{optional} and between \texttt{<...>}, are Ti\textit{k}Z options to pass on to the environment which creates the PixelArt. |
| 372 |
|
| 373 |
\medskip |
| 374 |
|
| 375 |
The third argument, \textit{mandatory}, is the filename of the \textsf{csv}. |
| 376 |
|
| 377 |
|
| 378 |
\begin{PresentationCode}{} |
| 379 |
%creation of the csv |
| 380 |
\begin{filecontents*}[overwrite]{test1.csv} |
| 381 |
-,-,-,-,-,-,4,4,4,4,-,-,-,-,-,- |
| 382 |
-,-,-,-,4,4,1,1,1,1,4,4,-,-,-,- |
| 383 |
-,-,-,4,1,1,1,1,1,1,1,1,4,-,-,- |
| 384 |
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,- |
| 385 |
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,- |
| 386 |
-,4,1,9,9,1,1,1,1,1,1,9,9,1,4,- |
| 387 |
-,4,9,9,9,9,4,4,4,4,9,9,9,9,4,- |
| 388 |
-,4,9,4,9,9,4,4,4,4,9,4,9,9,4,- |
| 389 |
-,4,1,9,9,9,4,4,4,4,9,9,9,1,4,- |
| 390 |
-,-,4,1,1,9,4,4,4,4,9,1,1,4,-,- |
| 391 |
-,-,4,1,1,1,4,4,4,4,1,1,1,4,-,- |
| 392 |
-,-,-,4,1,1,1,4,4,1,1,1,4,-,-,- |
| 393 |
-,-,4,3,1,1,1,1,1,1,1,1,3,4,-,- |
| 394 |
-,4,6,3,1,1,1,1,1,1,1,1,3,6,4,- |
| 395 |
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,- |
| 396 |
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,- |
| 397 |
-,4,6,4,1,1,1,4,4,1,1,1,4,6,4,- |
| 398 |
2,2,4,2,4,4,4,2,2,4,4,4,2,4,2,2 |
| 399 |
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 |
| 400 |
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 |
| 401 |
-,-,-,-,-,4,1,1,1,1,4,-,-,-,-,- |
| 402 |
-,-,-,-,-,-,4,1,1,4,-,-,-,-,-,- |
| 403 |
-,-,-,-,-,-,-,4,4,-,-,-,-,-,-,- |
| 404 |
\end{filecontents*} |
| 405 |
\end{PresentationCode} |
| 406 |
|
| 407 |
\begin{PresentationCode}{} |
| 408 |
%simple codes |
| 409 |
%empty case with - |
| 410 |
\PixlArtTikz[Codes=123469,Style=\ttfamily,Unit=0.35]{test1.csv} |
| 411 |
~~ |
| 412 |
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35]{test1.csv} |
| 413 |
~~ |
| 414 |
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35,Border=false]{test1.csv} |
| 415 |
\end{PresentationCode} |
| 416 |
|
| 417 |
\pagebreak |
| 418 |
|
| 419 |
In the following example, the \textit{symbols} to print can't be used for the \textit{codes}, so we can use the keys \Cle{Symbols} and \Cle{Symb} to bypass this limitation. |
| 420 |
|
| 421 |
\begin{PresentationCode}{} |
| 422 |
%symbols associated to codes |
| 423 |
|
| 424 |
\begin{filecontents*}[overwrite]{cap.csv} |
| 425 |
-,-,-,-,-,-,-,-,D,-,D,-,D,-,-,-,-,-,-,-,-,- |
| 426 |
-,D,D,-,-,-,-,D,D,D,D,D,D,-,-,D,D,D,D,-,-,- |
| 427 |
D,-,-,D,-,D,D,F,F,F,F,F,F,D,D,-,-,-,-,D,-,- |
| 428 |
-,D,-,-,D,F,F,F,-,-,F,F,F,F,F,D,-,D,D,-,-,- |
| 429 |
-,-,D,D,F,F,F,-,F,F,-,F,F,F,F,F,D,D,-,-,-,- |
| 430 |
-,-,-,D,F,F,F,F,F,F,F,F,F,F,F,F,D,-,-,-,-,- |
| 431 |
-,-,-,D,F,J,J,J,J,J,J,J,F,F,F,F,D,-,-,-,-,- |
| 432 |
-,-,-,D,J,-,-,-,J,-,-,-,J,J,F,F,D,-,-,-,-,- |
| 433 |
-,-,-,D,J,-,D,-,J,-,D,-,J,J,B,B,D,-,-,-,-,- |
| 434 |
-,-,-,D,J,-,-,-,J,-,-,-,J,J,B,B,D,-,-,-,-,- |
| 435 |
-,-,-,D,C,J,J,J,J,J,J,J,J,C,C,C,D,-,-,-,-,- |
| 436 |
-,-,-,D,C,C,C,C,C,C,C,C,C,C,C,D,D,D,-,-,-,- |
| 437 |
-,-,-,D,C,C,C,D,D,D,D,D,D,C,D,A,A,A,D,-,-,- |
| 438 |
-,-,-,D,F,C,C,C,C,C,C,C,C,D,A,-,-,-,A,D,-,- |
| 439 |
-,-,-,D,F,C,F,C,C,C,C,F,D,A,-,A,A,A,-,A,D,- |
| 440 |
-,-,D,C,F,F,F,F,C,C,F,D,A,-,A,F,F,F,A,-,A,D |
| 441 |
-,-,D,C,F,F,F,F,F,F,F,D,A,-,A,F,-,F,A,-,A,D |
| 442 |
-,-,D,A,D,-,A,-,A,-,A,D,A,-,A,F,F,F,A,-,A,D |
| 443 |
-,-,-,D,D,-,A,-,A,-,A,-,D,A,-,A,A,A,-,A,D,- |
| 444 |
-,-,-,-,-,D,D,F,D,D,D,D,F,D,A,-,-,-,A,D,-,- |
| 445 |
-,-,-,-,-,-,D,A,D,-,-,D,-,-,D,A,A,A,D,-,-,- |
| 446 |
-,-,-,-,-,-,D,D,D,-,-,D,D,D,D,D,D,D,-,-,-,- |
| 447 |
\end{filecontents*} |
| 448 |
|
| 449 |
\PixlArtTikz[Codes=ABCDFJ,Symbols={1,2,3,4,6,10},Symb,Style=\tiny\sffamily,Unit=0.35]{cap.csv} |
| 450 |
~~ |
| 451 |
\PixlArtTikz[Codes=ABCDFJ,Colors={red,brown,yellow,black,blue,gray},Correction,Unit=0.35]{cap.csv} |
| 452 |
\end{PresentationCode} |
| 453 |
|
| 454 |
\pagebreak |
| 455 |
|
| 456 |
\subsection{Symbols within list(s)} |
| 457 |
|
| 458 |
List of symbols can be given within list(s), picked randomly. |
| 459 |
|
| 460 |
\begin{PresentationCode}{} |
| 461 |
\begin{filecontents*}[overwrite]{testlist.csv} |
| 462 |
A,B,C,A |
| 463 |
A,B,B,C |
| 464 |
B,A,C,B |
| 465 |
C,A,B,C |
| 466 |
\end{filecontents*} |
| 467 |
|
| 468 |
\textbf{Notice:} |
| 469 |
|
| 470 |
Multiples of 5 : red\\ |
| 471 |
Multiples of 3 : green\\ |
| 472 |
Multiples of 2 : blue |
| 473 |
|
| 474 |
\PixlArtTikz[Codes=ABC,Symbols={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unit=0.85]{testlist.csv} |
| 475 |
\hspace{5mm} |
| 476 |
\PixlArtTikz[Codes=ABC,Symbols={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unit=0.85]{testlist.csv} |
| 477 |
\hspace{5mm} |
| 478 |
\PixlArtTikz[Codes=ABC,Colors={red,green,blue},Correction,Style=\large\sffamily,Unit=0.85]{testlist.csv} |
| 479 |
\end{PresentationCode} |
| 480 |
|
| 481 |
\pagebreak |
| 482 |
|
| 483 |
\subsection{Starred macro} |
| 484 |
|
| 485 |
The starred macro \texttt{\textbackslash PixlArtTikz*} is to be used within an already created environment. It can be useful for adding code after the PixelArt. |
| 486 |
|
| 487 |
\smallskip |
| 488 |
|
| 489 |
In this case: |
| 490 |
|
| 491 |
\begin{itemize} |
| 492 |
\item the \textit{optional} argument between \texttt{<...>} is discarded; |
| 493 |
\item the key \Cle{Unit} is discarded too (units can be configured in the environment!) |
| 494 |
\end{itemize} |
| 495 |
|
| 496 |
\begin{PresentationCode}{} |
| 497 |
\begin{center} |
| 498 |
\begin{tikzpicture}[scale=0.5] |
| 499 |
%grid to show positionning |
| 500 |
\draw[very thin,gray,xstep=1,ystep=1] (0,0) grid (17,-24) ; |
| 501 |
\foreach \x in {0,1,...,17} \draw[very thin,gray] (\x,-3pt)--(\x,3pt)% |
| 502 |
node[above,font=\scriptsize\sffamily] {\x} ; |
| 503 |
\foreach \y in {0,-1,...,-24} \draw[very thin,gray] (3pt,\y)--(-3pt,\y)% |
| 504 |
node[left,font=\scriptsize\sffamily] {\y} ; |
| 505 |
%le PixelArt |
| 506 |
\PixlArtTikz*[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction]{test1.csv} |
| 507 |
%added code |
| 508 |
\filldraw[blue] (14,-1) circle[radius=1] ; |
| 509 |
\filldraw[yellow] (14,-1) circle[radius=0.8] ; |
| 510 |
\draw[green,very thick,<-,>=latex] (15,-1) to[bend left=30] (18,-2)% |
| 511 |
node[right,font=\scriptsize\sffamily] {Code Ti\textit{k}Z} ; |
| 512 |
\end{tikzpicture} |
| 513 |
\end{center} |
| 514 |
\end{PresentationCode} |
| 515 |
|
| 516 |
\pagebreak |
| 517 |
|
| 518 |
\section{PixelArt environment} |
| 519 |
|
| 520 |
\subsection{Usage} |
| 521 |
|
| 522 |
The package \textsf{PixelArtTikz} provides an environment to create a PixelArt and add code afterwards. |
| 523 |
|
| 524 |
\begin{itemize} |
| 525 |
\item The environment is created within Ti\textit{k}Z and additional code is passed on to the Ti\textit{k}Z environment! |
| 526 |
\item The additional code will be printed on top of the PixelArt! |
| 527 |
\end{itemize} |
| 528 |
|
| 529 |
\begin{PresentationCode}{listing only} |
| 530 |
\begin{EnvPixlArtTikz}[keys]<options tikz>{filename.csv} |
| 531 |
%tikz code(s) |
| 532 |
\end{EnvPixlArtTikz} |
| 533 |
\end{PresentationCode} |
| 534 |
|
| 535 |
The first argument, \textit{optional} and between \texttt{[...]}, proposes the \textsf{keys}: |
| 536 |
|
| 537 |
\begin{itemize} |
| 538 |
\item the key \Cle{Codes} with the \textit{string} of \textit{simple} codes of the \textsf{csv} file; |
| 539 |
\item the key \Cle{Colors} with the \textit{list} of colors; |
| 540 |
\item the key \Cle{Symbols} with the \textit{optional list} of alt.\ symbols for the cells; |
| 541 |
\item the boolean \Cle{Correction} to color the PixelArt;\hfill{}default \textsf{false} |
| 542 |
\item the boolean \Cle{Symb} to print the symbols;\hfill{}default \textsf{false} |
| 543 |
\item the boolean \Cle{Border} to print borders of the cells;\hfill{}default \textsf{true} |
| 544 |
\item the key \Cle{Style} to specifythe style of the text. \hfill{}default \textsf{\textbackslash scriptsize} |
| 545 |
\end{itemize} |
| 546 |
|
| 547 |
The second argument, \textit{optional} and between \texttt{<...>}, is for Ti\textit{k}Z options to be passed on to the environment which creates the PixelArt. |
| 548 |
|
| 549 |
\medskip |
| 550 |
|
| 551 |
The third argument, \textit{mandatory}, is the filename of the \textsf{csv}. |
| 552 |
|
| 553 |
\subsection{Example} |
| 554 |
|
| 555 |
The symbols are at the nodes $(c\,;\,-l)$ where $l$ and $c$ are the row and column of the data in the \textsf{csv} file. |
| 556 |
|
| 557 |
\begin{PresentationCode}{} |
| 558 |
\begin{center} |
| 559 |
\begin{EnvPixlArtTikz}% |
| 560 |
[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.25] |
| 561 |
{test1.csv} |
| 562 |
\filldraw[blue] (14,-1) circle[radius=1] ; |
| 563 |
\filldraw[yellow] (14,-1) circle[radius=0.8] ; |
| 564 |
\draw[green,very thick,<-,>=latex] (15,-1) to[bend left=30] (18,-2)% |
| 565 |
node[right,font=\scriptsize\sffamily] {Ti\textit{k}Z code} ; |
| 566 |
\end{EnvPixlArtTikz} |
| 567 |
\end{center} |
| 568 |
\end{PresentationCode} |
| 569 |
|
| 570 |
\newpage |
| 571 |
|
| 572 |
\section{Macro for \textit{mini-}PixelArt} |
| 573 |
|
| 574 |
\subsection{Idea} |
| 575 |
|
| 576 |
The idea is tu propose a macro to insert, without \textsf{csv} file, a small PixelArt with small colors list. |
| 577 |
|
| 578 |
\begin{PresentationCode}{listing only} |
| 579 |
\MiniPixlArt[keys]{list of colors} |
| 580 |
\end{PresentationCode} |
| 581 |
|
| 582 |
The first argument, \textit{optional} and between \texttt{[...]} proposes the \textsf{keys}: |
| 583 |
|
| 584 |
\begin{itemize} |
| 585 |
\item the key \Cle{Unit} for dimension of the cells ;\hfill{}default \textsf{0.25em}, |
| 586 |
\item the boolean \Cle{Border} to print a small border for the cells.\hfill{}default \textsf{false} |
| 587 |
\end{itemize} |
| 588 |
|
| 589 |
The second argument, \textit{mandatory} and between \texttt{\{...\}}, is the colors of the cells : |
| 590 |
|
| 591 |
\begin{itemize} |
| 592 |
\item each color is \textit{coded} by a letter: |
| 593 |
\begin{multicols}{5} |
| 594 |
\begin{itemize} |
| 595 |
\item \texttt{R: \textcolor{red}{red}} |
| 596 |
\item \texttt{G: \textcolor{green}{green}} |
| 597 |
\item \texttt{C: \textcolor{cyan}{blue}} |
| 598 |
\item \texttt{Y: \textcolor{yellow}{yellow}} |
| 599 |
\item \texttt{B: \textcolor{black}{black}} |
| 600 |
\item \texttt{L: \textcolor{lightgray}{gray}} |
| 601 |
\item \texttt{.: \colorbox{lightgray}{\textcolor{white}{white}}} |
| 602 |
\item \texttt{M: \textcolor{brown}{maroon}} |
| 603 |
\item \texttt{O: \textcolor{orange}{orange}} |
| 604 |
\item \texttt{P: \textcolor{violet}{purple}} |
| 605 |
\end{itemize} |
| 606 |
\end{multicols} |
| 607 |
\item each linebreak is done by \texttt{,}; |
| 608 |
\item the thickness of the borders are 10\,\% of the unit. |
| 609 |
\end{itemize} |
| 610 |
|
| 611 |
The last argument, \textit{optional} and between \texttt{<...>}, proposes options for the \textsf{tikz} environment. |
| 612 |
|
| 613 |
\subsection{Examples} |
| 614 |
|
| 615 |
\begin{PresentationCode}{} |
| 616 |
\MiniPixlArt{% |
| 617 |
..RR..RR.., |
| 618 |
.RRRRRRRR., |
| 619 |
RRRRRRRRRR, |
| 620 |
RRRRRRRRRR, |
| 621 |
RRRRRRRRRR, |
| 622 |
.RRRRRRRR., |
| 623 |
..RRRRRR.., |
| 624 |
...RRRR..., |
| 625 |
....RR.... |
| 626 |
} |
| 627 |
\end{PresentationCode} |
| 628 |
|
| 629 |
\begin{PresentationCode}{} |
| 630 |
Inline, we can give \MiniPixlArt[Unit=5mm,Border]{BCGOYG,YLP.BR}<baseline=(current bounding box.center)> |
| 631 |
this miniPA. |
| 632 |
\end{PresentationCode} |
| 633 |
|
| 634 |
\newpage |
| 635 |
|
| 636 |
\section{Macro for cutting PixelArt} |
| 637 |
|
| 638 |
\subsection{Idea} |
| 639 |
|
| 640 |
The idea is to offer commands to create \textit{collaborative} PixelArts, to form a \textit{large} image from several small ones (of the same size). |
| 641 |
|
| 642 |
\smallskip |
| 643 |
|
| 644 |
{\footnotesize\faBomb} For practical reasons (related to the use of \texttt{filecontents}) the file \textsf{csv} must end with an empty line (it is created automatically via \texttt{filecontents}, and the code uses this specificity). |
| 645 |
|
| 646 |
\smallskip |
| 647 |
|
| 648 |
The available \Cle{keys} are exactly the same as those in classic displays. |
| 649 |
|
| 650 |
\subsection{Global usage} |
| 651 |
|
| 652 |
The argument \texttt{cutting} can be given in the form: |
| 653 |
% |
| 654 |
\begin{itemize} |
| 655 |
\item \Cle{<number of block length>x<number of block col>} to specify the size of the blocks; |
| 656 |
\item \Cle{<number of V blocks>+<number of H blocks>} to specify the number of blocks. |
| 657 |
\end{itemize} |
| 658 |
|
| 659 |
\begin{PresentationCode}{listing only} |
| 660 |
\CutPixlArtTikz(*)[keys]<tikz options>{file.csv}{cutting} |
| 661 |
%(*) := change layout formatting (A1 or 1.1) |
| 662 |
%1 := keys |
| 663 |
%2 := tikz options |
| 664 |
%3 := csv file |
| 665 |
%4 := block size (LxC) or block number (L+C) |
| 666 |
|
| 667 |
\HelpGridPixelArtTikz(*)[scale]{file.csv}{cutting} |
| 668 |
%(*) := change layout formatting (A1 or 1.1) |
| 669 |
%1 := scale of notice |
| 670 |
%2 := csv file |
| 671 |
%4 := block size (LxC) or block number (L+C) |
| 672 |
\end{PresentationCode} |
| 673 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A,A,A,A,A |
| 710 |
A,A,H,H,H,A,A,A,I,I,I,B,B,B,D,B,B,B,B,B,B,B,B,B,B,D,B,B,B,I,I,I,A,A,A,A,A,A,H,A |
| 711 |
A,A,H,H,H,A,A,A,A,I,I,I,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,I,I,I,A,A,A,A,A,A,A,H,A |
| 712 |
H,H,A,H,H,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A |
| 713 |
A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A |
| 714 |
A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A |
| 715 |
\end{filecontents*} |
| 716 |
|
| 717 |
\subsection{Example} |
| 718 |
|
| 719 |
\def\listcoulkoala% |
| 720 |
{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} |
| 721 |
|
| 722 |
\begin{PresentationCode}{listing only} |
| 723 |
\def\listcoulkoala% |
| 724 |
{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} |
| 725 |
\end{PresentationCode} |
| 726 |
|
| 727 |
\begin{PresentationCode}{} |
| 728 |
%block with 8x8 size |
| 729 |
\HelpGridPixelArtTikz{PAkoala.csv}{8x8} |
| 730 |
~~ |
| 731 |
\PixlArtTikz[Correction,Unit=0.125,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=8x8]{PAkoala.csv} |
| 732 |
\end{PresentationCode} |
| 733 |
|
| 734 |
\begin{PresentationCode}{} |
| 735 |
%16 blocks (4L 4C) |
| 736 |
\HelpGridPixelArtTikz*[2]{PAkoala.csv}{4+4} |
| 737 |
~~ |
| 738 |
\PixlArtTikz[Correction,Unit=0.2,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=4+4]{PAkoala.csv} |
| 739 |
\end{PresentationCode} |
| 740 |
|
| 741 |
\newpage |
| 742 |
|
| 743 |
\begin{PresentationCode}{} |
| 744 |
%block with 8x8 size |
| 745 |
\CutPixlArtTikz[Unit=0.3,Codes=ABCDEFGHI]{PAkoala.csv}{8x8} |
| 746 |
\end{PresentationCode} |
| 747 |
|
| 748 |
\pagebreak |
| 749 |
|
| 750 |
\begin{PresentationCode}{} |
| 751 |
%16 blocks (4L 4C) |
| 752 |
\CutPixlArtTikz*[Unit=0.3,Codes=ABCDEFGHI,Correction,Colors={\listcoulkoala}]{PAkoala.csv}{4+4} |
| 753 |
\end{PresentationCode} |
| 754 |
|
| 755 |
\pagebreak |
| 756 |
|
| 757 |
\section{Anamorphic cylinder PixelArt} |
| 758 |
|
| 759 |
\subsection{Idea} |
| 760 |
|
| 761 |
The idea is to provide something to create PixelArt with the aim of using a cylindrical anamorphosis. |
| 762 |
|
| 763 |
On \url{https://www.youtube.com/watch?v=PT8KUozBg3I}, there is a video \textit{demonstration}, proposed by Jean-Yves Labouche. |
| 764 |
|
| 765 |
The overall operation is similar to that of the \textit{main} command, however there are some adjustments: |
| 766 |
|
| 767 |
\begin{itemize} |
| 768 |
\item the possibility of giving the file \textsf{csv} in \textit{normal} or \textit{inverted} mode; |
| 769 |
\item the dimensions (width \& middle) must be specified to produce the PixelArt; |
| 770 |
\item the command is standalone (for the moment) so no addition(s) later. |
| 771 |
\end{itemize} |
| 772 |
|
| 773 |
\begin{PresentationCode}{listing only} |
| 774 |
\PixlArtTikzCylindric[keys]{file.csv} |
| 775 |
\end{PresentationCode} |
| 776 |
|
| 777 |
The files illustrating this paragraph are given below. |
| 778 |
|
| 779 |
\begin{PresentationCode}{} |
| 780 |
%version with inverted data |
| 781 |
\begin{filecontents*}[overwrite]{PAyoda.csv} |
| 782 |
E,E,E,A,A,E,A,A,E,D |
| 783 |
E,E,E,F,F,F,F,F,E,D |
| 784 |
E,E,E,F,F,C,F,F,E,D |
| 785 |
E,A,F,F,C,C,C,F,F,A |
| 786 |
E,A,F,F,C,C,C,F,F,A |
| 787 |
E,E,E,A,A,A,A,A,E,E |
| 788 |
E,E,E,A,A,A,A,A,E,E |
| 789 |
E,E,A,E,B,A,B,E,A,E |
| 790 |
E,A,A,A,A,A,A,A,A,A |
| 791 |
E,E,E,A,A,A,A,A,E,E |
| 792 |
\end{filecontents*} |
| 793 |
|
| 794 |
\PixlArtTikz[% |
| 795 |
Codes=ABCDEF, |
| 796 |
Colors={green,black,brown,white,brown!75!black,lightgray}, |
| 797 |
Correction,Unit=0.35]% |
| 798 |
{PAyoda.csv} |
| 799 |
\end{PresentationCode} |
| 800 |
|
| 801 |
\begin{PresentationCode}{} |
| 802 |
%version with normal data |
| 803 |
\begin{filecontents*}{PAsorciere.csv} |
| 804 |
V,V,V,V,N,N,N,V,V,V |
| 805 |
V,V,V,N,N,N,N,N,V,V |
| 806 |
N,N,N,N,N,N,N,N,N,N |
| 807 |
V,V,V,G,G,G,O,O,V,V |
| 808 |
V,V,V,J,J,G,O,O,O,V |
| 809 |
V,V,G,N,J,G,O,O,O,V |
| 810 |
V,G,G,G,G,G,O,O,O,O |
| 811 |
V,V,N,N,N,G,O,O,O,O |
| 812 |
V,V,G,G,G,G,O,O,O,O |
| 813 |
V,V,V,V,N,N,O,O,O,O |
| 814 |
\end{filecontents*} |
| 815 |
|
| 816 |
\PixlArtTikz[% |
| 817 |
Codes=VNGOJ, |
| 818 |
Colors={purple!50,black,green,orange,yellow}, |
| 819 |
Correction,Unit=0.35]% |
| 820 |
{PAsorciere.csv} |
| 821 |
\end{PresentationCode} |
| 822 |
|
| 823 |
\subsection{Keys and options} |
| 824 |
|
| 825 |
The first argument, \textit{optional} and between \texttt{[...]} offers \textsf{Keys} necessary for the command to function properly: |
| 826 |
|
| 827 |
\begin{itemize} |
| 828 |
\item the key \Cle{Width} which defines the width (radius in cm) of the rendering;\hfill{}default \textsf{6} |
| 829 |
\item the key \Cle{Center} which defines the width (radius in cm) of the \textit{middle};\hfill{}default \textsf{1.25} |
| 830 |
\item the key \Cle{Codes} contains the \textit{string} of the \textit{simple} codes of the file \textsf{csv}; |
| 831 |
\item the key \Cle{Colors} which contains the \textit{list} of associated colors; |
| 832 |
\item the key \Cle{Symbols} which contains the \textit{possible list} of alternative characters to display in the boxes; |
| 833 |
\item the key \Cle{Style} which allows you to specify the style of characters. \hfill{}default \textsf{normalsize} |
| 834 |
\item the Boolean key \Cle{Correction} which allows you to color the PixelArt;\hfill{}default \textsf{false} |
| 835 |
\item the Boolean key \Cle{Symb} which allows you to display the \textit{alternative} characters;\hfill{}default \textsf{false} |
| 836 |
\item the Boolean key \Cle{Solution} which displays the solution (with \textit{mirror} effect);\hfill{}default \textsf{false} |
| 837 |
\item the Boolean key \Cle{Legend} (idea from François Delannoy) ;\hfill{}défaut \textsf{false} |
| 838 |
\item the Boolean key \Cle{Swap} which allows you to specify the data type (\Cle{true} := normal; \Cle{false} := inverted). |
| 839 |
|
| 840 |
\hfill{}default \textsf{false} |
| 841 |
\end{itemize} |
| 842 |
|
| 843 |
The second argument, \textit{mandatory}, is the name of the \textsf{csv} file to use. |
| 844 |
|
| 845 |
\pagebreak |
| 846 |
|
| 847 |
\subsection{Example with inverted data (Yoda)} |
| 848 |
|
| 849 |
In this paragraph, we use the data \texttt{PAyoda}, which corresponds to the \textit{inverted} layout, so the key \Cle{Swap} is not necessary. |
| 850 |
|
| 851 |
\begin{PresentationCode}{} |
| 852 |
%classic version |
| 853 |
\PixlArtTikzCylindric[Codes=ABCDEF,Style=\small\ttfamily,Legend]{PAyoda.csv} |
| 854 |
|
| 855 |
\medskip |
| 856 |
|
| 857 |
%version with 'symbols' |
| 858 |
\PixlArtTikzCylindric[Codes=ABCDEF,Symbols={1,2,3,4,5,6},Symb,Style=\small\ttfamily]{PAyoda.csv} |
| 859 |
\end{PresentationCode} |
| 860 |
|
| 861 |
\begin{PresentationCode}{} |
| 862 |
%Fix and solution |
| 863 |
\begin{tabular}{c} |
| 864 |
\PixlArtTikzCylindric[% |
| 865 |
Codes=ABCDEF, |
| 866 |
Colors={green,black,brown,white,brown!75!black,lightgray}, |
| 867 |
Solution]% |
| 868 |
{PAyoda.csv} |
| 869 |
\\ |
| 870 |
\PixlArtTikzCylindric[% |
| 871 |
Codes=ABCDEF, |
| 872 |
Colors={green,black,brown,white,brown!75!black,lightgray}, |
| 873 |
Correction]% |
| 874 |
{PAyoda.csv} |
| 875 |
\end{tabular} |
| 876 |
\end{PresentationCode} |
| 877 |
|
| 878 |
\pagebreak |
| 879 |
|
| 880 |
\subsection{Example with classic data (Witch)} |
| 881 |
|
| 882 |
In this paragraph, we use the data \texttt{PAsorciere}, which corresponds to the \textit{normal} layout, so the key \Cle{Swap} is necessary. |
| 883 |
|
| 884 |
\begin{PresentationCode}{} |
| 885 |
%classic version |
| 886 |
\PixlArtTikzCylindric[% |
| 887 |
Width=4,Center=1,Codes=VNGOJ, |
| 888 |
Colors={purple!50,black,green,orange,yellow}, |
| 889 |
Swap,Style=\ttfamily\scriptsize]% |
| 890 |
{PAsorciere.csv} |
| 891 |
\end{PresentationCode} |
| 892 |
|
| 893 |
\begin{PresentationCode}{} |
| 894 |
%Correction and solution |
| 895 |
\begin{tabular}{c} |
| 896 |
\PixlArtTikzCylindric[% |
| 897 |
Width=4,Center=0.75,Codes=VNGOJ, |
| 898 |
Colors={purple!50,black,green,orange,yellow}, |
| 899 |
Swap,Solution]% |
| 900 |
{PAsorciere.csv} |
| 901 |
\\ |
| 902 |
\PixlArtTikzCylindric[% |
| 903 |
Width=4,Center=0.75,Codes=VNGOJ, |
| 904 |
Colors={purple!50,black,green,orange,yellow}, |
| 905 |
Swap,Correction]% |
| 906 |
{PAsorciere.csv} |
| 907 |
\end{tabular} |
| 908 |
\end{PresentationCode} |
| 909 |
|
| 910 |
\pagebreak |
| 911 |
|
| 912 |
\section{With datatool} |
| 913 |
|
| 914 |
\subsection{Macros} |
| 915 |
|
| 916 |
\begin{PresentationCode}{listing only} |
| 917 |
%reading of csv |
| 918 |
\readdtcsv{file.csv}{readname} |
| 919 |
|
| 920 |
%full pixelart (french keys for the moment...) |
| 921 |
\dtpixlarttikz[keys]{readname} |
| 922 |
|
| 923 |
%cut pixelart (french keys for the moment...) |
| 924 |
\dtpixlarttikzblock[clés]{readname}{LxC or L+C}{numblock} |
| 925 |
\end{PresentationCode} |
| 926 |
|
| 927 |
\begin{PresentationCode}{} |
| 928 |
%reading of csv (koala) |
| 929 |
\readdtcsv{PAkoala.csv}{DTkoala} |
| 930 |
|
| 931 |
%full pixelart |
| 932 |
\dtpixlarttikz[Correction,Unite=0.125,Codes=ABCDEFGHI,Couleurs={\listcoulkoala},Decoupage=8x8]{DTkoala} |
| 933 |
|
| 934 |
%cut pixelart (french keys for the moment...) |
| 935 |
\dtpixlarttikzblock[Unite=0.125,Correction,Codes=ABCDEFGHI,Couleurs={\listcoulkoala}]% |
| 936 |
{DTkoala}{8x8}{1/1} |
| 937 |
\end{PresentationCode} |
| 938 |
|
| 939 |
\newpage |
| 940 |
|
| 941 |
\part{History} |
| 942 |
|
| 943 |
\verb|v0.20a|:~~~~Key \textsf{[Legend]} pour \textit{Anamorphic} |
| 944 |
|
| 945 |
\verb|v0.1.9|:~~~~\hologo{LaTeX3} version of the package (\textsf{pixelarttikz-l3}) |
| 946 |
|
| 947 |
\verb|v0.1.8|:~~~~Bugfix |
| 948 |
|
| 949 |
\verb|v0.1.7|:~~~~Bugfix with 'cut' |
| 950 |
|
| 951 |
\verb|v0.1.6|:~~~~Styles for lines + \textsf{datatool} for alternative version |
| 952 |
|
| 953 |
\verb|v0.1.5|:~~~~Symbols can be given with list(s) + Enhancements of internal code |
| 954 |
|
| 955 |
\verb|v0.1.4|:~~~~Anamorphic cylinder PixelArts |
| 956 |
|
| 957 |
\verb|v0.1.3|:~~~~Cut PixelArts within several PixelArts |
| 958 |
|
| 959 |
\verb|v0.1.2|:~~~~\textit{mini-}PixelArts |
| 960 |
|
| 961 |
\verb|v0.1.1|:~~~~Bugfix with color |
| 962 |
|
| 963 |
\verb|v0.1.0|:~~~~Initial version |
| 964 |
|
| 965 |
\end{document} |