summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/pictochrono/doc/pictochrono-doc.tex
blob: f55a582174aa26e24c964adc5d80fdcb89cff966 (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
% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')

\documentclass[english,11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage{DejaVuSerif}
%\usepackage[scale=1.125]{inconsolata}
\usepackage{pictochrono}
\usepackage{soul}
\usepackage{tabularray}
\usepackage{lipsum}
\usepackage{codehigh}
\usepackage{fontawesome5}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
%\rhead{\sffamily\small\affloetalab[Legende]}
\lfoot{\sffamily\small [pictochrono]}
\cfoot{\sffamily\small - \thepage{} -}
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
\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

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

\def\TPversion{0.1.0}
\def\TPdate{13/02/2024}
\usepackage{tcolorbox}

\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
	\hl{\vphantom{\texttt{pf}}\texttt{#1}}%
}

\usepackage{babel}

\begin{document}

\pagestyle{fancy}

\thispagestyle{empty}

\begin{center}
	\begin{minipage}{0.88\linewidth}
	\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
		\begin{center}
			\begin{tabular}{c}
				{\Huge \texttt{pictochrono}}\\
				\\
				{\LARGE A chronometer, made with Ti\textit{k}Z,} \\
				\\
				{\LARGE for inline insertion.} \\
				\\
				{\small \texttt{Version \TPversion{} -- \TPdate}}
		\end{tabular}
		\end{center}
	\end{tcolorbox}
\end{minipage}
\end{center}

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

\hrule

\phantomsection

\hypertarget{matoc}{}

\tableofcontents

\vspace*{5mm}

\hrule

\vspace*{5mm}

\vfill

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!10]
\hfill
{\pictochrono[Height=4cm]{20}}
\hfill~
\end{tcolorbox}

\medskip

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!10]
{\LARGE\bfseries\sffamily Exercise n°1 (\pictochrono[ColTime=red]{10})\dotfill(5 points)}\\
{\LARGE\bfseries\sffamily Exercise n°2 (\pictochrono[ColTime=blue]{25})\dotfill(9 points)}\\
{\LARGE\bfseries\sffamily Exercise n°3 (\pictochrono[Delta=15,ColTime=orange]{35})\dotfill(11 points)}
\end{tcolorbox}

\vfill~

\pagebreak

\section{The package pictochrono}

\subsection{Ideas}

The idea is to display a pictogram like "chronometer" to present times for exercises, for example.

The pictogram can be inserted inline with automatic height and vertical offset, or with a manual height and offset.

\subsection{Loading}

The package loads within the preamble, with \MontreCode{\textbackslash usepackage\{pictochrono\}}.

The only loaded packages are \MontreCode{simplekv}, \MontreCode{calc}, \MontreCode{simplekv}, \MontreCode{xstring}, \MontreCode{etoolbox} and \MontreCode{tikz} (with \MontreCode{calc} library).

\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
\usepackage{pictochrono}
\end{codehigh}

\section{The command}

\subsection{Usage}

The command is \MontreCode{\textbackslash pictochrono}.

\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
\pictochrono[keys]{duration}<v.align>
\end{codehigh}

\medskip

The optional keys are :

\begin{itemize}
	\item the key \MontreCode{Height} :
	\begin{itemize}
		\item can use an automatic height, with \MontreCode{auto} (by default, global height of current fonte + small vertical offset) ;
		\item can specify a global height ;
	\end{itemize}
	\item the key \MontreCode{Color} for the main color (\MontreCode{black} by default) ;
	\item the key \MontreCode{ColTime} for the color of duration, if specified (\MontreCode{lightgray} by default) ;
	\item the key \MontreCode{Delta} for the graduations of minutes (within \texttt{0/5/10/15/20/30}) (\MontreCode{5} by default) ;
	\item the key \MontreCode{Offset} for manual vertical offset (\MontreCode{auto} by default) ;
\end{itemize}

\medskip

The mandatory argument, between \MontreCode{\{...\}}, is the duration to be displayed.

\medskip

The optional argument, between \MontreCode{<...>}, can specify a vertical alignment of the pictogram (within \texttt{vcenter/vbottom/vtop}, or empty for default positioning).

\subsection{Examples}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%automatic inline insertion
This is a test, with a \pictochrono{25} minutes chronometer.
\end{demohigh}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%automatic inline insertion, with user colors.
{\Huge This is an other test, with a 
\pictochrono[Delta=15,Color=blue,ColTime=red]{20} minutes chronometer.}
\end{demohigh}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%manual inline insertion, with manual offset.
This a \pictochrono[Height=3em,Offset=-0.75em]{45} minutes chronometer.
\end{demohigh}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%manual insertion
\pictochrono[Height=5cm,ColTime=teal]{33}
\end{demohigh}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%wihtin a tblr
\begin{tblr}{hlines,vlines,colspec={Q[m,c]Q[8cm,m,j]}}
  \pictochrono[Height=4cm,ColTime=purple]{20}
  &
  \lipsum[1][1-9] \\
\end{tblr}
\end{demohigh}

\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
	%wihtin a tblr
\begin{tblr}{hlines,vlines,colspec={Q[m,c]Q[8cm,m,j]}}
  \pictochrono[Height=4cm,ColTime=purple]{20}<vcenter>
  &
  \lipsum[1][1-9] \\
\end{tblr}
\end{demohigh}

\vfill

\section{History}

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

\vspace*{15mm}

\end{document}