summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pixelarttikz/PixelArtTikz-doc-en.tex
blob: ae34054bba9095d0b9b4465807dc04ce8abd8330 (plain)
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{PixelArtTikz}
\usepackage{couleurs-fr}
\usepackage{fontawesome5}
\usepackage{enumitem}
\usepackage{tabularray}
\usepackage{multicol}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [PixelArtTikz]}
\cfoot{\sffamily\small - \thepage{} -}
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}

%\usepackage{hvlogos}
\usepackage{hologo}
\usepackage{xspace}
\providecommand\tikzlogo{Ti\textit{k}Z}
\providecommand\TeXLive{\TeX{}Live\xspace}
\providecommand\PSTricks{\textsf{PSTricks}\xspace}
\let\pstricks\PSTricks
\let\TikZ\tikzlogo
\newcommand\TableauDocumentation{%
	\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}}
		{\huge \LaTeX} & & & & &\\
		& {\huge \hologo{pdfLaTeX}} & & & & \\
		& & {\huge \hologo{LuaLaTeX}} & & & \\
		& & & {\huge \TikZ} & & \\
		& & & & {\huge \TeXLive} & \\
		& & & & & {\huge \hologo{MiKTeX}} \\
	\end{tblr}
}

\usepackage{hyperref}
\urlstyle{same}
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}

\def\TPversion{0.1.4}
\def\TPdate{16/04/2024}

\usepackage[most]{tcolorbox}
\tcbuselibrary{minted}
\NewTCBListing{PresentationCode}{ O{blue} m }{%
	sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,%
	colback=#1!1!white,colframe=#1!75!black,colbacklower=white,%
	attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,%
	boxed title style={%
		colframe=#1!75!black,colback=#1!15!white,%
		,sharp corners=downhill,arc=12pt,%
	},%
	fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,%
	listing engine=minted,minted style=colorful,
	minted language=tex,minted options={tabsize=4,fontsize=\footnotesize,autogobble},
	#2
}
\usepackage[english]{babel}
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}}

\begin{document}

\pagestyle{fancy}

\thispagestyle{empty}

\vspace{2cm}

\begin{center}
	\begin{minipage}{0.75\linewidth}
	\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
		\begin{center}
			\begin{tabular}{c}
				{\Huge \texttt{PixelArtTikz [en]}}\\
				\\
				{\LARGE PixelArts, with Ti\textit{k}Z}, \\
				\\
				{\LARGE with solution and colors.} \\
			\end{tabular}
			
			\medskip
			
			{\small \texttt{Version \TPversion{} -- \TPdate}}
		\end{center}
	\end{tcolorbox}
\end{minipage}
\end{center}

\vspace{0.5cm}

\begin{center}
	\begin{tabular}{c}
	\texttt{Cédric Pierquet}\\
	{\ttfamily c pierquet -- at -- outlook . fr}\\
	\texttt{\url{https://github.com/cpierquet/PixelArtTikz}}
\end{tabular}
\end{center}

\vspace{0.25cm}

{$\blacktriangleright$~~Commands to display PixelArts.}

\smallskip

{$\blacktriangleright$~~Environment to complete the PixelArt.}

\smallskip

\vspace{1cm}

\begin{center}
\begin{filecontents*}[overwrite]{test1.csv}
-,-,-,-,-,-,4,4,4,4,-,-,-,-,-,-
-,-,-,-,4,4,1,1,1,1,4,4,-,-,-,-
-,-,-,4,1,1,1,1,1,1,1,1,4,-,-,-
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,-
-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,-
-,4,1,9,9,1,1,1,1,1,1,9,9,1,4,-
-,4,9,9,9,9,4,4,4,4,9,9,9,9,4,-
-,4,9,4,9,9,4,4,4,4,9,4,9,9,4,-
-,4,1,9,9,9,4,4,4,4,9,9,9,1,4,-
-,-,4,1,1,9,4,4,4,4,9,1,1,4,-,-
-,-,4,1,1,1,4,4,4,4,1,1,1,4,-,-
-,-,-,4,1,1,1,4,4,1,1,1,4,-,-,-
-,-,4,3,1,1,1,1,1,1,1,1,3,4,-,-
-,4,6,3,1,1,1,1,1,1,1,1,3,6,4,-
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,-
-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,-
-,4,6,4,1,1,1,4,4,1,1,1,4,6,4,-
2,2,4,2,4,4,4,2,2,4,4,4,2,4,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
-,-,-,-,-,4,1,1,1,1,4,-,-,-,-,-
-,-,-,-,-,-,4,1,1,4,-,-,-,-,-,-
-,-,-,-,-,-,-,4,4,-,-,-,-,-,-,-
\end{filecontents*}

\PixlArtTikz[Codes=123469,Style=\ttfamily,Unit=0.35]{test1.csv}
~~
\PixlArtTikz[Codes=123469,Symbols={A,B,C,D,E,F},Symb,Style=\ttfamily,Unit=0.35]{test1.csv}
~~
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35]{test1.csv}
\end{center}

\vspace{0.5cm}

%\hfill{}\textit{Merci aux membres du groupe \faFacebook{} du \og Coin \LaTeX{} \fg{} pour leur aide et leurs idées !}

%\hfill{}\textit{Merci à Denis Bitouzé et à Patrick Bideault pour leurs retours et idées !}

\vfill

\hrule

\medskip

\TableauDocumentation

\medskip

\hrule

\medskip

\newpage

\phantomsection
\hypertarget{matoc}{}

\tableofcontents

\newpage

\part{Introduction}

\section{The package PixelArtTikz}

\subsection{Introduction}

The idea is to \textit{propose}, within a Ti\textit{k}Z environment, a macro to generate PixelArt.

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

\medskip

Some advices about the \textsf{cvs} file :

\begin{itemize}
	\item the \textsf{csv} file must use "," as separator;
	\item empty cells are coded by "\texttt{-}".
\end{itemize}

\begin{PresentationCode}{listing only}
\begin{filecontents*}{filename.csv}
	A,B,C,D
	A,B,D,C
	B,A,C,D
	B,A,D,C
\end{filecontents*}
\end{PresentationCode}

While compiling, the file \textsf{filename.csv} will be created, and the option \Cle{[overwrite]} will propagate the modifications!

\subsection{Loading of the package, and option}

The package \textsf{csvsimple} is necessary in order to read the \textsf{csv} file.

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.

\smallskip

The option \Cle{[csvii]} forces the usage of the \hologo{LaTeX2e} version.

\begin{PresentationCode}{listing only}
\usepackage{PixelArtTikz}                     %package latex3
%which loads
%\RequirePackage{expl3}
%\RequirePackage[l3]{csvsimple}

\usepackage[csvii]{PixelArtTikz}              %package latex2
%which loads
%\RequirePackage[legacy]{csvsimple}
\end{PresentationCode}

\subsection{Used packages}

It's fully compatible with usual \hologo{LaTeX} engines, such as \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex}.

\medskip

It loads the following packages and libraries:

\begin{itemize}
	\item \texttt{tikz}, \texttt{xintexpr} et \texttt{xinttools};
	\item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} and \texttt{listofitems}.
\end{itemize}

\pagebreak

\subsection{Macros and environment}

There are two ways to create PixelArt:

\begin{itemize}
	\item with an independent macro;
	\item with a Ti\textit{k}Z environment in order to add code afterwards.
\end{itemize}

\begin{PresentationCode}{listing only}
%Independent macro
\PixlArtTikz[keys]<options tikz>{file.csv}

%Semi-independent macro, in a tiks environment
\PixlArtTikz*[keys]{file.csv}

%environment
\begin{EnvPixlArtTikz}[keys]<options tikz>{file.csv}
	%tikz code
\end{EnvPixlArtTikz}
\end{PresentationCode}

\section{Colors}

Concerning colors: the user can use all colors provided by loaded packages!

\smallskip

Without extra packages, the available colors are:

\smallskip

\begin{tblr}{width=\linewidth,colspec={*{10}{X[m,c]}},cells={font=\small\ttfamily}}
	\SetCell{bg=magenta} magenta &
	\SetCell{bg=cyan} cyan &
	\SetCell{bg=blue,fg=white} blue &
	\SetCell{bg=green} green &
	\SetCell{bg=red} red &
	\SetCell{bg=darkgray,fg=white} darkgray &
	\SetCell{bg=olive,fg=white} olive &
	\SetCell{bg=lime} lime &
	\SetCell{bg=brown} brown &
	\SetCell{bg=lightgray} lightgray \\
	\SetCell{bg=white} white &
	\SetCell{bg=gray,fg=white} gray &
	\SetCell{bg=black,fg=white} black &
	\SetCell{bg=yellow} yellow &
	\SetCell{bg=violet,fg=white} violet &
	\SetCell{bg=teal,fg=white} teal &
	\SetCell{bg=purple,fg=white} purple &
	\SetCell{bg=pink} pink &
	\SetCell{bg=orange} orange & \\
\end{tblr}

\pagebreak

\part{Macros and environment}

\section{Main macro}

\subsection{Example}

The macro \texttt{\textbackslash PixlArtTikz} needs :

\begin{itemize}
	\item the file \textsf{csv};
	\item the list (by a string) of codes used in the file \textsf{csv} (e.g.\ \texttt{234679} or \texttt{ABCDJK}\ldots);
	\item the list of symbols (if needed) to print in the cells, e.g.\ \texttt{25,44,12} or \texttt{AA,AB,AC};
	\item the list of colors (for the correction), same order as the codes.
\end{itemize}

We can begin by creating the file \textsf{csv}, directly within the \textsf{tex} code, or with a external file.

\begin{PresentationCode}{}
%creation of the csv
\begin{filecontents*}[overwrite]{base.csv}
	A,B,C,D
	A,B,D,C
	B,A,D,C
	C,A,B,D
\end{filecontents*}
\end{PresentationCode}

\begin{PresentationCode}{}
%instructions and pixelarts
\begin{center}
	\begin{tblr}{colspec={*{4}{Q[1.25cm,c,m]}},hlines,vlines,rows={1.15em}}
		\SetCell[c=4]{c} Instructions & & & \\
		A & B & C & D \\
		45 & 22 & 1 & 7 \\
		Black & Green & Yellow & Red \\
	\end{tblr}
\end{center}

\PixlArtTikz[Codes=ABCD,Style=\large\sffamily,Unit=0.85]{base.csv}
~~
\PixlArtTikz[Codes=ABCD,Symbols={45,22,1,7},Symb,Style=\large\sffamily,Unit=0.85]{base.csv}
~~
\PixlArtTikz[Codes=ABCD,Colors={black,green,yellow,red},Correction,Unit=0.85]{base.csv}
~~
\PixlArtTikz[Codes=ABCD,Colors={black,green,yellow,red},Correction,Border=false,Unit=0.85]{base.csv}
\end{PresentationCode}

\pagebreak

\subsection{Options and keys}

\begin{PresentationCode}{listing only}
\PixlArtTikz[keys]<options tikz>{file.csv}
\end{PresentationCode}

The first argument, \textit{optional} and between \texttt{[...]} proposes the \textsf{keys}:

\begin{itemize}
	\item the key \Cle{Codes} with the \textit{string} of \textit{simple} codes of the \textsf{csv} file;
	\item the key \Cle{Colors} with the \textit{list} of colors;
	\item the key \Cle{Symbols} with the \textit{optional list} of alt.\ symbols for the cells;
	\item the boolean \Cle{Correction} to color the PixelArt;\hfill{}default \textsf{false}
	\item the boolean \Cle{Symb} to print the symbols;\hfill{}default \textsf{false}
	\item the boolean \Cle{Border} to print borders of the cells;\hfill{}default \textsf{true}
	\item the key \Cle{Style} to specifythe style of the text. \hfill{}default \textsf{\textbackslash scriptsize}
\end{itemize}

The second argument, \textit{optional} and between \texttt{<...>}, are Ti\textit{k}Z options to pass on to the environment which creates the PixelArt.

\medskip

The third argument, \textit{mandatory}, is the filename of the \textsf{csv}.


\begin{PresentationCode}{}
%creation of the csv
\begin{filecontents*}[overwrite]{test1.csv}
	-,-,-,-,-,-,4,4,4,4,-,-,-,-,-,-
	-,-,-,-,4,4,1,1,1,1,4,4,-,-,-,-
	-,-,-,4,1,1,1,1,1,1,1,1,4,-,-,-
	-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,-
	-,-,4,1,1,1,1,1,1,1,1,1,1,4,-,-
	-,4,1,9,9,1,1,1,1,1,1,9,9,1,4,-
	-,4,9,9,9,9,4,4,4,4,9,9,9,9,4,-
	-,4,9,4,9,9,4,4,4,4,9,4,9,9,4,-
	-,4,1,9,9,9,4,4,4,4,9,9,9,1,4,-
	-,-,4,1,1,9,4,4,4,4,9,1,1,4,-,-
	-,-,4,1,1,1,4,4,4,4,1,1,1,4,-,-
	-,-,-,4,1,1,1,4,4,1,1,1,4,-,-,-
	-,-,4,3,1,1,1,1,1,1,1,1,3,4,-,-
	-,4,6,3,1,1,1,1,1,1,1,1,3,6,4,-
	-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,-
	-,4,6,6,1,1,1,1,1,1,1,1,6,6,4,-
	-,4,6,4,1,1,1,4,4,1,1,1,4,6,4,-
	2,2,4,2,4,4,4,2,2,4,4,4,2,4,2,2
	2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
	2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
	-,-,-,-,-,4,1,1,1,1,4,-,-,-,-,-
	-,-,-,-,-,-,4,1,1,4,-,-,-,-,-,-
	-,-,-,-,-,-,-,4,4,-,-,-,-,-,-,-
\end{filecontents*}
\end{PresentationCode}

\begin{PresentationCode}{}
%simple codes
%empty case with -
\PixlArtTikz[Codes=123469,Style=\ttfamily,Unit=0.35]{test1.csv}
~~
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35]{test1.csv}
~~
\PixlArtTikz[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.35,Border=false]{test1.csv}
\end{PresentationCode}

\pagebreak

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.

\begin{PresentationCode}{}
%symbols associated to codes

\begin{filecontents*}[overwrite]{cap.csv}
	-,-,-,-,-,-,-,-,D,-,D,-,D,-,-,-,-,-,-,-,-,-
	-,D,D,-,-,-,-,D,D,D,D,D,D,-,-,D,D,D,D,-,-,-
	D,-,-,D,-,D,D,F,F,F,F,F,F,D,D,-,-,-,-,D,-,-
	-,D,-,-,D,F,F,F,-,-,F,F,F,F,F,D,-,D,D,-,-,-
	-,-,D,D,F,F,F,-,F,F,-,F,F,F,F,F,D,D,-,-,-,-
	-,-,-,D,F,F,F,F,F,F,F,F,F,F,F,F,D,-,-,-,-,-
	-,-,-,D,F,J,J,J,J,J,J,J,F,F,F,F,D,-,-,-,-,-
	-,-,-,D,J,-,-,-,J,-,-,-,J,J,F,F,D,-,-,-,-,-
	-,-,-,D,J,-,D,-,J,-,D,-,J,J,B,B,D,-,-,-,-,-
	-,-,-,D,J,-,-,-,J,-,-,-,J,J,B,B,D,-,-,-,-,-
	-,-,-,D,C,J,J,J,J,J,J,J,J,C,C,C,D,-,-,-,-,-
	-,-,-,D,C,C,C,C,C,C,C,C,C,C,C,D,D,D,-,-,-,-
	-,-,-,D,C,C,C,D,D,D,D,D,D,C,D,A,A,A,D,-,-,-
	-,-,-,D,F,C,C,C,C,C,C,C,C,D,A,-,-,-,A,D,-,-
	-,-,-,D,F,C,F,C,C,C,C,F,D,A,-,A,A,A,-,A,D,-
	-,-,D,C,F,F,F,F,C,C,F,D,A,-,A,F,F,F,A,-,A,D
	-,-,D,C,F,F,F,F,F,F,F,D,A,-,A,F,-,F,A,-,A,D
	-,-,D,A,D,-,A,-,A,-,A,D,A,-,A,F,F,F,A,-,A,D
	-,-,-,D,D,-,A,-,A,-,A,-,D,A,-,A,A,A,-,A,D,-
	-,-,-,-,-,D,D,F,D,D,D,D,F,D,A,-,-,-,A,D,-,-
	-,-,-,-,-,-,D,A,D,-,-,D,-,-,D,A,A,A,D,-,-,-
	-,-,-,-,-,-,D,D,D,-,-,D,D,D,D,D,D,D,-,-,-,-
\end{filecontents*}

\PixlArtTikz[Codes=ABCDFJ,Symbols={1,2,3,4,6,10},Symb,Style=\tiny\sffamily,Unit=0.35]{cap.csv}
~~
\PixlArtTikz[Codes=ABCDFJ,Colors={red,brown,yellow,black,blue,gray},Correction,Unit=0.35]{cap.csv}
\end{PresentationCode}

\pagebreak

\subsection{Starred macro}

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.

\smallskip

In this case:

\begin{itemize}
	\item the \textit{optional} argument between \texttt{<...>} is discarded;
	\item the key \Cle{Unit} is discarded too (units can be configured in the environment!)
\end{itemize}

\begin{PresentationCode}{}
\begin{center}
	\begin{tikzpicture}[scale=0.5]
		%grid to show positionning
		\draw[very thin,gray,xstep=1,ystep=1] (0,0) grid (17,-24) ;
		\foreach \x in {0,1,...,17} \draw[very thin,gray] (\x,-3pt)--(\x,3pt)%
		node[above,font=\scriptsize\sffamily] {\x} ;
		\foreach \y in {0,-1,...,-24} \draw[very thin,gray] (3pt,\y)--(-3pt,\y)%
		node[left,font=\scriptsize\sffamily] {\y} ;
		%le PixelArt
		\PixlArtTikz*[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction]{test1.csv}
		%added code
		\filldraw[blue] (14,-1) circle[radius=1] ;
		\filldraw[yellow] (14,-1) circle[radius=0.8] ;
		\draw[green,very thick,<-,>=latex] (15,-1) to[bend left=30] (18,-2)%
		node[right,font=\scriptsize\sffamily] {Code Ti\textit{k}Z} ;
	\end{tikzpicture}
\end{center}
\end{PresentationCode}

\pagebreak

\section{PixelArt environment}

\subsection{Usage}

The package \textsf{PixelArtTikz} provides an environment to create a PixelArt and add code afterwards.

\begin{itemize}
	\item The environment is created within Ti\textit{k}Z and additional code is passed on to the Ti\textit{k}Z environment!
	\item The additional code will be printed on top of the PixelArt!
\end{itemize}

\begin{PresentationCode}{listing only}
\begin{EnvPixlArtTikz}[keys]<options tikz>{filename.csv}
	%tikz code(s)
\end{EnvPixlArtTikz}
\end{PresentationCode}

The first argument, \textit{optional} and between \texttt{[...]}, proposes the \textsf{keys}:

\begin{itemize}
	\item the key \Cle{Codes} with the \textit{string} of \textit{simple} codes of the \textsf{csv} file;
	\item the key \Cle{Colors} with the \textit{list} of colors;
	\item the key \Cle{Symbols} with the \textit{optional list} of alt.\ symbols for the cells;
	\item the boolean \Cle{Correction} to color the PixelArt;\hfill{}default \textsf{false}
	\item the boolean \Cle{Symb} to print the symbols;\hfill{}default \textsf{false}
	\item the boolean \Cle{Border} to print borders of the cells;\hfill{}default \textsf{true}
	\item the key \Cle{Style} to specifythe style of the text. \hfill{}default \textsf{\textbackslash scriptsize}
\end{itemize}

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.

\medskip

The third argument, \textit{mandatory}, is the filename of the \textsf{csv}.

\subsection{Example}

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.

\begin{PresentationCode}{}
\begin{center}
	\begin{EnvPixlArtTikz}%
			[Codes=123469,Colors={red,brown,yellow,black,blue,white},Correction,Unit=0.25]
			{test1.csv}
		\filldraw[blue] (14,-1) circle[radius=1] ;
		\filldraw[yellow] (14,-1) circle[radius=0.8] ;
		\draw[green,very thick,<-,>=latex] (15,-1) to[bend left=30] (18,-2)%
		node[right,font=\scriptsize\sffamily] {Ti\textit{k}Z code} ;
	\end{EnvPixlArtTikz}
\end{center}
\end{PresentationCode}

\newpage

\section{Macro for \textit{mini-}PixelArt}

\subsection{Idea}

The idea is tu propose a macro to insert, without \textsf{csv} file, a small PixelArt with small colors list.

\begin{PresentationCode}{listing only}
	\MiniPixlArt[keys]{list of colors}
\end{PresentationCode}

The first argument, \textit{optional} and between \texttt{[...]} proposes the \textsf{keys }:

\begin{itemize}
	\item the key \Cle{Unit} for dimension of the cells ;\hfill{}default \textsf{0.25em},
	\item the boolean \Cle{Border} to print a small border for the cells.\hfill{}default \textsf{false}
\end{itemize}

The second argument, \textit{mandatory} and between \texttt{\{...\}}, is the colors of the cells :

\begin{itemize}
	\item each color is \textit{coded} by a letter :
	\begin{multicols}{5}
		\begin{itemize}
			\item \texttt{R : \textcolor{red}{red}}
			\item \texttt{G : \textcolor{green}{green}}
			\item \texttt{C : \textcolor{cyan}{blue}}
			\item \texttt{Y : \textcolor{yellow}{yellow}}
			\item \texttt{B : \textcolor{black}{black}}
			\item \texttt{L : \textcolor{lightgray}{gray}}
			\item \texttt{. : \colorbox{lightgray}{\textcolor{white}{white}}}
			\item \texttt{M : \textcolor{brown}{maroon}}
			\item \texttt{O : \textcolor{orange}{orange}}
			\item \texttt{P : \textcolor{violet}{purple}}
		\end{itemize}
	\end{multicols}
	\item each linebreak is done by \texttt{,} ;
	\item the thickness of the borders are 10\,\% of the unit.
\end{itemize}

The last argument, \textit{optional} and between \texttt{<...>}, proposes options for the \textsf{tikz} environment.

\subsection{Examples}

\begin{PresentationCode}{}
\MiniPixlArt{%
	..RR..RR..,
	.RRRRRRRR.,
	RRRRRRRRRR,
	RRRRRRRRRR,
	RRRRRRRRRR,
	.RRRRRRRR.,
	..RRRRRR..,
	...RRRR...,
	....RR....
}
\end{PresentationCode}

\begin{PresentationCode}{}
Inline, we can give \MiniPixlArt[Unit=5mm,Border]{BCGOYG,YLP.BR}<baseline=(current bounding box.center)>
this miniPA.
\end{PresentationCode}

\newpage

\section{Macro for cutting PixelArt}

\subsection{Idea}

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

\smallskip

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

\smallskip

The available \Cle{keys} are exactly the same as those in classic displays.

\subsection{Global usage}

The argument \texttt{cutting} can be given in the form :
%
\begin{itemize}
	\item \Cle{<number of block length>x<number of block col>} to specify the size of the blocks;
	\item \Cle{<number of V blocks>+<number of H blocks>} to specify the number of blocks.
\end{itemize}

\begin{PresentationCode}{listing only}
\CutPixlArtTikz(*)[keys]<tikz options>{file.csv}{cutting}
%(*) := change layout formatting (A1 or 1.1)
%1   := keys
%2   := tikz options
%3   := csv file
%4   := block size (LxC) or block number (L+C)

\HelpGridPixelArtTikz(*)[scale]{file.csv}{cutting}
%(*) := change layout formatting (A1 or 1.1)
%1   := scale of notice
%2   := csv file
%4   := block size (LxC) or block number (L+C)
\end{PresentationCode}

\begin{filecontents*}[overwrite]{PAkoala.csv}
A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,H,H,H,H,A,A,H,A,A,A,A,A,A
A,A,A,A,A,A,A,A,H,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A,H,A,A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coulkoala%
{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron}

\begin{PresentationCode}{listing only}
\def\listcoulkoala%
	{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron}
\end{PresentationCode}

\begin{PresentationCode}{}
%block with 8x8 size
\HelpGridPixelArtTikz{PAkoala.csv}{8x8}
~~
\PixlArtTikz[Correction,Unit=0.125,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=8x8]{PAkoala.csv}
\end{PresentationCode}

\begin{PresentationCode}{}
%16 blocks (4L 4C)
\HelpGridPixelArtTikz*[2]{PAkoala.csv}{4+4}
~~
\PixlArtTikz[Correction,Unit=0.2,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=4+4]{PAkoala.csv}
\end{PresentationCode}

\newpage

\begin{PresentationCode}{}
%block with 8x8 size
\CutPixlArtTikz[Unit=0.3,Codes=ABCDEFGHI]{PAkoala.csv}{8x8}
\end{PresentationCode}

\pagebreak

\begin{PresentationCode}{}
%16 blocks (4L 4C)
\CutPixlArtTikz*[Unit=0.3,Codes=ABCDEFGHI,Correction,Colors={\listcoulkoala}]{PAkoala.csv}{4+4}
\end{PresentationCode}

\pagebreak

\section{Anamorphic cylinder PixelArt}

\subsection{Idea}

The idea is to provide something to create PixelArt with the aim of using a cylindrical anamorphosis.

On \url{https://www.youtube.com/watch?v=PT8KUozBg3I}, there is a video \textit{demonstration}, proposed by Jean-Yves Labouche.

The overall operation is similar to that of the \textit{main} command, however there are some adjustments:

\begin{itemize}
	\item the possibility of giving the file \textsf{csv} in \textit{normal} or \textit{inverted} mode;
	\item the dimensions (width \& middle) must be specified to produce the PixelArt;
	\item the command is standalone (for the moment) so no addition(s) later.
\end{itemize}

\begin{PresentationCode}{listing only}
\PixlArtTikzCylindric[keys]{file.csv}
\end{PresentationCode}

The files illustrating this paragraph are given below.

\begin{PresentationCode}{}
%version with inverted data
\begin{filecontents*}[overwrite]{PAyoda.csv}
E,E,E,A,A,E,A,A,E,D
E,E,E,F,F,F,F,F,E,D
E,E,E,F,F,C,F,F,E,D
E,A,F,F,C,C,C,F,F,A
E,A,F,F,C,C,C,F,F,A
E,E,E,A,A,A,A,A,E,E
E,E,E,A,A,A,A,A,E,E
E,E,A,E,B,A,B,E,A,E
E,A,A,A,A,A,A,A,A,A
E,E,E,A,A,A,A,A,E,E
\end{filecontents*}

\PixlArtTikz[%
	Codes=ABCDEF,
	Colors={green,black,brown,white,brown!75!black,lightgray},
	Correction,Unit=0.35]%
	{PAyoda.csv}
\end{PresentationCode}

\begin{PresentationCode}{}
%version with normal data
\begin{filecontents*}{PAsorciere.csv}
V,V,V,V,N,N,N,V,V,V
V,V,V,N,N,N,N,N,V,V
N,N,N,N,N,N,N,N,N,N
V,V,V,G,G,G,O,O,V,V
V,V,V,J,J,G,O,O,O,V
V,V,G,N,J,G,O,O,O,V
V,G,G,G,G,G,O,O,O,O
V,V,N,N,N,G,O,O,O,O
V,V,G,G,G,G,O,O,O,O
V,V,V,V,N,N,O,O,O,O
\end{filecontents*}

\PixlArtTikz[%
	Codes=VNGOJ,
	Colors={purple!50,black,green,orange,yellow},
	Correction,Unit=0.35]%
	{PAsorciere.csv}
\end{PresentationCode}

\subsection{Keys and options}

The first argument, \textit{optional} and between \texttt{[...]} offers \textsf{Keys} necessary for the command to function properly:

\begin{itemize}
	\item the key \Cle{Width} which defines the width (radius in cm) of the rendering;\hfill{}default \textsf{6}
	\item the key \Cle{Center} which defines the width (radius in cm) of the \textit{middle};\hfill{}default \textsf{1.25}
	\item the key \Cle{Codes} contains the \textit{string} of the \textit{simple} codes of the file \textsf{csv};
	\item the key \Cle{Colors} which contains the \textit{list} of associated colors;
	\item the key \Cle{Symbols} which contains the \textit{possible list} of alternative characters to display in the boxes;
	\item the key \Cle{Style} which allows you to specify the style of characters. \hfill{}default \textsf{normalsize}
	\item the Boolean key \Cle{Correction} which allows you to color the PixelArt;\hfill{}default \textsf{false}
	\item the Boolean key \Cle{Symb} which allows you to display the \textit{alternative} characters;\hfill{}default \textsf{false}
	\item the Boolean key \Cle{Solution} which displays the solution (with \textit{mirror} effect);\hfill{}default \textsf{false}
	\item the Boolean key \Cle{Swap} which allows you to specify the data type (\Cle{true} := normal; \Cle{false} := inverted).
	
	\hfill{}default \textsf{false}
\end{itemize}

The second argument, \textit{mandatory}, is the name of the \textsf{csv} file to use.

\pagebreak

\subsection{Example with inverted data (Yoda)}

In this paragraph, we use the data \texttt{PAyoda}, which corresponds to the \textit{inverted} layout, so the key \Cle{Swap} is not necessary.

\begin{PresentationCode}{}
%classic version
\PixlArtTikzCylindric[Codes=ABCDEF,Style=\small\ttfamily]{PAyoda.csv}

%version with 'symbols'
\PixlArtTikzCylindric[Codes=ABCDEF,Symbols={1,2,3,4,5,6},Symb,Style=\small\ttfamily]{PAyoda.csv}
\end{PresentationCode}

\begin{PresentationCode}{}
%Fix and solution
\begin{tabular}{c}
	\PixlArtTikzCylindric[%
		Codes=ABCDEF,
		Colors={green,black,brown,white,brown!75!black,lightgray},
		Solution]%
		{PAyoda.csv}
	\\
	\PixlArtTikzCylindric[%
		Codes=ABCDEF,
		Colors={green,black,brown,white,brown!75!black,lightgray},
		Correction]%
		{PAyoda.csv}
\end{tabular}
\end{PresentationCode}

\pagebreak

\subsection{Example with classic data (Witch)}

In this paragraph, we use the data \texttt{PAsorciere}, which corresponds to the \textit{normal} layout, so the key \Cle{Swap} is necessary.

\begin{PresentationCode}{}
	%classic version
	\PixlArtTikzCylindric[%
	Width=4,Center=1,Codes=VNGOJ,
	Colors={purple!50,black,green,orange,yellow},
	Swap,Style=\ttfamily\scriptsize]%
	{PAsorciere.csv}
\end{PresentationCode}

\begin{PresentationCode}{}
%Correction and solution
\begin{tabular}{c}
	\PixlArtTikzCylindric[%
		Width=4,Center=0.75,Codes=VNGOJ,
		Colors={purple!50,black,green,orange,yellow},
		Swap,Solution]%
		{PAsorciere.csv}
	\\
	\PixlArtTikzCylindric[%
		Width=4,Center=0.75,Codes=VNGOJ,
		Colors={purple!50,black,green,orange,yellow},
		Swap,Correction]%
		{PAsorciere.csv}
\end{tabular}
\end{PresentationCode}

\newpage

\part{History}

\verb|v0.1.4|~:~~~~Anamorphic cylinder PixelArts

\verb|v0.1.3|~:~~~~Cut PixelArts within several PixelArts

\verb|v0.1.2|~:~~~~\textit{mini-}PixelArts

\verb|v0.1.1|~:~~~~Bugfix with color

\verb|v0.1.0|~:~~~~Initial version

\end{document}