summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty
blob: f1422a6f9f2e3e8abb1cf5ba1499e9315f70b051 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%    	pas-tableur.sty  v2.00     encodage : UTF8      	       %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%           	Créé par Stéphane PASQUET 		          			 %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\def\fileversion{2.00}
\def\filedate{2014/08/16}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{pas-tableur}[%
  \filedate\space v\fileversion\space
  LaTeX package by Stephane PASQUET]
\@ifpackageloaded{tikz}{}{\RequirePackage{tikz}}
\usetikzlibrary{calc}
\@ifpackageloaded{xstring}{}{\RequirePackage{xstring}}
\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}}


% Définition des couleurs

\definecolor{grayTopCell}{cmyk}{0.08,0.05,0.06,0}
\definecolor{grayBottomCell}{cmyk}{0.1,0.07,0.08,0}
\definecolor{graySepCell}{cmyk}{0.29,0.21,0.21,0}
\definecolor{blueSelecCellTop}{cmyk}{0.52,0.17,0,0}
\definecolor{blueSelecCellBottom}{cmyk}{0.75,0.34,0,0}
\definecolor{blueSelec}{cmyk}{0.23,0.06,0,0}

% Définition des dimensions par défaut

\def\col@width{7em}
\def\numline@width{3em} % largeur de la colonne indiquant le numéros des lignes
\def\line@height{1.57em}

	%==> Changer les valeurs par défaut
	\newcommand*{\tabcolwidth}[1]{\def\col@width{#1}}
	\newcommand*{\tabnumlinewidth}[1]{\def\numline@width{#1}}
	\newcommand*{\tablineheight}[1]{\def\line@height{#1}}
	
% Définition des polices de caractères

\newcommand{\helvbx}{\usefont{T1}{phv}{m}{n}}

% Construction du tableur

	%==> Style des cellules
	\tikzstyle{celempty} = [outer sep=0pt]
	\tikzstyle{celhead} = [draw=black,rectangle,outer sep=0pt]
	
	%==> Macro de redirection : étoilée ou pas étoilée ?
	\newcommand{\tableur}{\@ifstar{\tableur@star}{\tableur@nostar}}

	%==> Macro étoilée : \tableur*{A/<l1>,B/<l2>,...}. Tableur avec colonnes de largeurs différentes
	\newcommand{\tableur@star}[2][1] 
	{%
		\xdef\list@of@col{#2}
		% Placement de la première cellule en-tête
		\StrChar{#2}{1}[\first@name]
		\StrBetween{#2}{/}{,}[\first@width]
		\node[minimum width={\first@width},minimum height=\line@height,celhead] (\first@name) {\helvbx\first@name};
		\fill[grayBottomCell] 
					(\first@name.south west) -- 
					(\first@name.south east) -- 
					($0.5*(\first@name.south east)+0.5*(\first@name.north east)$) -- 
					($0.5*(\first@name.south west)+0.5*(\first@name.north west)$) --
					cycle;
				\fill[grayTopCell] 
					(\first@name.north west) -- 
					(\first@name.north east) -- 
					($0.5*(\first@name.south east)+0.5*(\first@name.north east)$) -- 
					($0.5*(\first@name.south west)+0.5*(\first@name.north west)$) --
					cycle;
		\node[minimum width={\first@width},minimum height=\line@height,celhead] at (\first@name) {\helvbx\first@name};
		
		% Placement des autres en-têtes de colonnes
		
		\foreach \name/\w [remember=\name as \lastname,count=\colnumber] in {#2}
		{
			\ifx\name\first@name
			\else
				\node[minimum width={\w},minimum height=\line@height,celhead,right] (\name) at (\lastname.east) {\helvbx\name};
				\fill[grayBottomCell] 
					(\name.south west) -- 
					(\name.south east) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)$) --
					cycle;
				\fill[grayTopCell] 
					(\name.north west) -- 
					(\name.north east) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)$) --
					cycle;
				\node[minimum width={\w},minimum height=\line@height,celhead,right] at (\lastname.east) {\helvbx\name};
			\fi
		}
		
		% Placement des en-têtes de lignes
		
		\node[below left,celhead,minimum width=\numline@width,minimum height=\line@height] (numline1) at (\first@name.south west) {\helvbx 1};
		\fill[grayBottomCell] 
					(numline1.south west) -- 
					(numline1.south east) -- 
					($0.5*(numline1.south east)+0.5*(numline1.north east)$) -- 
					($0.5*(numline1.south west)+0.5*(numline1.north west)$) --
					cycle;
		\fill[grayTopCell] 
					(numline1.north west) -- 
					(numline1.north east) -- 
					($0.5*(numline1.south east)+0.5*(numline1.north east)$) -- 
					($0.5*(numline1.south west)+0.5*(numline1.north west)$) --
					cycle;
		\node[below left,celhead,minimum width=\numline@width,minimum height=\line@height] (numline1) at (\first@name.south west) {\helvbx1};
		\ifnum#1>1
			\foreach \num@line [remember=\num@line as \lastnum (initially 1)] in {2,...,#1}
			{
				\node[below,celhead,minimum width=\numline@width,minimum height=\line@height] (numline\num@line) at (numline\lastnum.south) {\helvbx\num@line};
				\fill[grayBottomCell] 
					(numline\num@line.south west) -- 
					(numline\num@line.south east) -- 
					($0.5*(numline\num@line.south east)+0.5*(numline\num@line.north east)$) -- 
					($0.5*(numline\num@line.south west)+0.5*(numline\num@line.north west)$) --
					cycle;
				\fill[grayTopCell] 
					(numline\num@line.north west) -- 
					(numline\num@line.north east) -- 
					($0.5*(numline\num@line.south east)+0.5*(numline\num@line.north east)$) -- 
					($0.5*(numline\num@line.south west)+0.5*(numline\num@line.north west)$) --
					cycle;
				\node[below,celhead,minimum width=\numline@width,minimum height=\line@height] (numline\num@line) at (numline\lastnum.south) {\helvbx\num@line};
			}
		\fi
		
		% Tracé de la grille
		
		\foreach \name/\w in {#2}
		{
			\node[celempty,below,minimum height=\line@height,minimum width=\w] (cell\name-1) at (\name.south) {};
			\draw[graySepCell] ($(cell\name-1.south west)+(0.25pt,0)$) -- (cell\name-1.south east) -- ($(cell\name-1.north east)+(0,-0.25pt)$);
		}
		\ifnum#1>1
			\foreach\numline [remember=\numline as \lastnumline (initially 1)] in {2,...,#1}
			{
				\foreach \name/\w in {#2}
				{
					\node[celempty,below,minimum height=\line@height,minimum width=\w] (cell\name-\numline) at (cell\name-\lastnumline.south) {};
					\draw[graySepCell] ($(cell\name-\numline.south west)+(0.25pt,0)$) -- (cell\name-\numline.south east) -- ($(cell\name-\numline.north east)+(0,-0.25pt)$);
				}
			}
		\fi
	} % --> Fin de \tableur*
	
	%==> Macro non étoilée : \tableur{A,B,C,...} ou \tableur{A-C}
	
	%----------> Liste des noms de colonnes <----------
	\xdef\col@names{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
	
	\newcommand{\tableur@nostar}[2][1] % [#1] -> nombre de lignes (par défaut, "1"), #2 -> A,B,...,Z
	{%
		\IfSubStr{#2}{-}
		{%
			\StrBefore{#2}{-}[\str@start] % 1ère lettre, par ex. "G"
			\StrBehind{#2}{-}[\str@end]	  % 2ème lettre, par ex. "L"
			\StrBetween{\col@names}{\str@start}{\str@end}[\str@col] %  retourne par exemple "HIJK"
			\edef\str@col{\str@start\str@col\str@end} % retourne alors "GHIJKL"
			\StrLen{\str@col}[\nb@columns] % nombre de colonnes
			% --> On place la première cellule en-tête
			\node[minimum width={\col@width},minimum height=\line@height,celhead] (\str@start) {\helvbx\str@start};
			\fill[grayBottomCell] 
					(\str@start.south west) -- 
					(\str@start.south east) -- 
					($0.5*(\str@start.south east)+0.5*(\str@start.north east)$) -- 
					($0.5*(\str@start.south west)+0.5*(\str@start.north west)$) --
					cycle;
			\fill[grayTopCell] 
					(\str@start.north west) -- 
					(\str@start.north east) -- 
					($0.5*(\str@start.south east)+0.5*(\str@start.north east)$) -- 
					($0.5*(\str@start.south west)+0.5*(\str@start.north west)$) --
					cycle;
			\node[minimum width={\col@width},minimum height=\line@height,celhead] at (\str@start) {\helvbx\str@start};
			% --> On place les autres en-têtes
			\foreach \i [remember=\i as \lasti (initially 1)] in {2,...,\nb@columns}
			{
				\StrChar{\str@col}{\i}[\name]
				\StrChar{\str@col}{\lasti}[\lastname]
				\node[minimum width={\col@width},minimum height=\line@height,celhead,right] (\name) at (\lastname.east) {\helvbx\name};
				\fill[grayBottomCell] 
					(\name.south west) -- 
					(\name.south east) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)$) --
					cycle;
				\fill[grayTopCell] 
					(\name.north west) -- 
					(\name.north east) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)$) --
					cycle;
				\node[minimum width={\col@width},minimum height=\line@height,celhead] at (\name) {\helvbx\name};
			}
		}
		{
			\StrChar{#2}{1}[\str@start]
			\node[minimum width={\col@width},minimum height=\line@height,celhead] (\str@start) {\helvbx\str@start};
			\fill[grayBottomCell] 
					(\str@start.south west) -- 
					(\str@start.south east) -- 
					($0.5*(\str@start.south east)+0.5*(\str@start.north east)$) -- 
					($0.5*(\str@start.south west)+0.5*(\str@start.north west)$) --
					cycle;
			\fill[grayTopCell] 
					(\str@start.north west) -- 
					(\str@start.north east) -- 
					($0.5*(\str@start.south east)+0.5*(\str@start.north east)$) -- 
					($0.5*(\str@start.south west)+0.5*(\str@start.north west)$) --
					cycle;
			\node[minimum width={\col@width},minimum height=\line@height,celhead] at (\str@start) {\helvbx\str@start};
			
			\foreach \name [remember=\name as \lastname] in {#2}
			{
				\ifx\name\str@start
				\else
					\node[minimum width={\col@width},minimum height=\line@height,celhead,right] (\name) at (\lastname.east)  {\helvbx\name};
					\fill[grayBottomCell] 
						(\name.south west) -- 
						(\name.south east) -- 
						($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
						($0.5*(\name.south west)+0.5*(\name.north west)$) --
						cycle;
					\fill[grayTopCell] 
						(\name.north west) -- 
						(\name.north east) -- 
						($0.5*(\name.south east)+0.5*(\name.north east)$) -- 
						($0.5*(\name.south west)+0.5*(\name.north west)$) --
						cycle;
					\node[minimum width={\col@width},minimum height=\line@height,celhead] at (\name) {\helvbx\name};
				\fi
			}
		}
		
		
		% Placement des en-têtes de lignes
		
		\StrChar{#2}{1}[\first@name]
		\node[below left,celhead,minimum width=\numline@width,minimum height=\line@height] (numline1) at (\first@name.south west) {\helvbx 1};
		\fill[grayBottomCell] 
					(numline1.south west) -- 
					(numline1.south east) -- 
					($0.5*(numline1.south east)+0.5*(numline1.north east)$) -- 
					($0.5*(numline1.south west)+0.5*(numline1.north west)$) --
					cycle;
		\fill[grayTopCell] 
					(numline1.north west) -- 
					(numline1.north east) -- 
					($0.5*(numline1.south east)+0.5*(numline1.north east)$) -- 
					($0.5*(numline1.south west)+0.5*(numline1.north west)$) --
					cycle;
		\node[below left,celhead,minimum width=\numline@width,minimum height=\line@height] (numline1) at (\first@name.south west) {\helvbx1};
		\ifnum#1>1
			\foreach \num@line [remember=\num@line as \lastnum (initially 1)] in {2,...,#1}
			{
				\node[below,celhead,minimum width=\numline@width,minimum height=\line@height] (numline\num@line) at (numline\lastnum.south) {\helvbx\num@line};
				\fill[grayBottomCell] 
					(numline\num@line.south west) -- 
					(numline\num@line.south east) -- 
					($0.5*(numline\num@line.south east)+0.5*(numline\num@line.north east)$) -- 
					($0.5*(numline\num@line.south west)+0.5*(numline\num@line.north west)$) --
					cycle;
				\fill[grayTopCell] 
					(numline\num@line.north west) -- 
					(numline\num@line.north east) -- 
					($0.5*(numline\num@line.south east)+0.5*(numline\num@line.north east)$) -- 
					($0.5*(numline\num@line.south west)+0.5*(numline\num@line.north west)$) --
					cycle;
				\node[below,celhead,minimum width=\numline@width,minimum height=\line@height] (numline\num@line) at (numline\lastnum.south) {\helvbx\num@line};
			}
		\fi
		
		% Tracé de la grille
		
		\IfSubStr{#2}{-}
		{%
			\foreach \i in {1,...,\nb@columns}
			{
				\StrChar{\str@col}{\i}[\name]
				\node[celempty,below,minimum height=\line@height,minimum width=\col@width] (cell\name-1) at (\name.south) {};
				\draw[graySepCell] ($(cell\name-1.south west)+(0.25pt,0)$) -- (cell\name-1.south east) -- ($(cell\name-1.north east)+(0,-0.25pt)$);
			}
			\ifnum#1>1
				\foreach\numline [remember=\numline as \lastnumline (initially 1)] in {2,...,#1}
				{
					\foreach \i in {1,...,\nb@columns}
					{
						\StrChar{\str@col}{\i}[\name]
						\node[celempty,below,minimum height=\line@height,minimum width=\col@width] (cell\name-\numline) at (cell\name-\lastnumline.south) {};
						\draw[graySepCell] ($(cell\name-\numline.south west)+(0.25pt,0)$) -- (cell\name-\numline.south east) -- ($(cell\name-\numline.north east)+(0,-0.25pt)$);
					}
				}
			\fi	
		}
		{%
			\foreach \name in {#2}
			{
				\node[celempty,below,minimum height=\line@height,minimum width=\col@width] (cell\name-1) at (\name.south) {};
				\draw[graySepCell] ($(cell\name-1.south west)+(0.25pt,0)$) -- (cell\name-1.south east) -- ($(cell\name-1.north east)+(0,-0.25pt)$);
			}
			\ifnum#1>1
				\foreach\numline [remember=\numline as \lastnumline (initially 1)] in {2,...,#1}
				{
					\foreach \name in {#2}
					{
						\node[celempty,below,minimum height=\line@height,minimum width=\col@width] (cell\name-\numline) at (cell\name-\lastnumline.south) {};
						\draw[graySepCell] ($(cell\name-\numline.south west)+(0.25pt,0)$) -- (cell\name-\numline.south east) -- ($(cell\name-\numline.north east)+(0,-0.25pt)$);
					}
				}
			\fi
		}
}
	
% Insérer quelque chose dans une cellule

\define@cmdkey [PAS] {celtxt} {width}{}
\define@cmdkey [PAS] {celtxt} {color}{}
\define@boolkey [PAS] {celtxt} {l}[true]{}
\define@boolkey [PAS] {celtxt} {r}[true]{}
\define@boolkey [PAS] {celtxt} {c}[true]{} 
\presetkeys    [PAS] {celtxt} {width = \col@width, color=black}{}

\newcommand*{\celtxt}[1][]{\cel@txt[#1]}

\newcommand\cel@txt[3][]{%
	\setkeys[PAS]{celtxt}{#1}
   \begingroup
   \@makeother\^%
   \@makeother\$%
   \@celtxt@[#1]{#2}{#3}%
}
\newcommand\@celtxt@[4][]{%
   \endgroup
   \setkeys[PAS]{celtxt}{#1}
   \StrPosition{#4}{=}[\@equalPos]
   \ifnum\@equalPos=1
      %\def\@scale{1}%
      \let\@style\texttt
   \else
      %\def\@scale{0.9}%
      \let\@style\@empty
   \fi
   \ifPAS@celtxt@c
   	\def\pos@align{c}
   \else
   	\ifPAS@celtxt@r
   		\def\pos@align{r}
   	\else
   		\def\pos@align{l}
   	\fi
   \fi
   \node at (cell#2-#3) {\makebox[\dimexpr\cmdPAS@celtxt@width-2pt][\pos@align]{\@style{\textcolor{\cmdPAS@celtxt@color}{#4}}}};
}

% Cellule sélectionnée : \selecCell

\newcommand*\selecCell[2]
{%
	%==> En-tête ligne
	
	\fill[blueSelecCellBottom] 
					(numline#2.south west) -- 
					(numline#2.south east) -- 
					($0.5*(numline#2.south east)+0.5*(numline#2.north east)$) -- 
					($0.5*(numline#2.south west)+0.5*(numline#2.north west)$) --
					cycle;
	\fill[blueSelecCellTop] 
					(numline#2.north west) -- 
					(numline#2.north east) -- 
					($0.5*(numline#2.south east)+0.5*(numline#2.north east)$) -- 
					($0.5*(numline#2.south west)+0.5*(numline#2.north west)$) --
					cycle;
	\node[celhead,minimum width=\numline@width,minimum height=\line@height] at (numline#2) {\helvbx#2};
	
	%==> En-tête colonne
	
	\fill[blueSelecCellBottom] 
					($(#1.south west)+(0.25pt,0.25pt)$) -- 
					($(#1.south east)+(-0.25pt,0.25pt)$) -- 
					($0.5*(#1.south east)+0.5*(#1.north east)+(-0.25pt,0)$) -- 
					($0.5*(#1.south west)+0.5*(#1.north west)+(0.25pt,0)$) --
					cycle;
	\fill[blueSelecCellTop] 
					($(#1.north west)+(0.25pt,-0.25pt)$) -- 
					($(#1.north east)+(-0.25pt,-0.25pt)$) -- 
					($0.5*(#1.south east)+0.5*(#1.north east)+(-0.25pt,0)$) -- 
					($0.5*(#1.south west)+0.5*(#1.north west)+(0.25pt,0)$) --
					cycle;
	\node at (#1) {\helvbx#1};

	%==> Cellule cell#1-#1
	
	\draw[very thick] (cell#1-#2.south west) rectangle (cell#1-#2.north east);
	\fill[black] ($(cell#1-#2.south east)+(-1pt,1pt)$) rectangle +(3pt,-3pt);
}

% Sélection de plusieurs cellules : \multiSelec{A-1}{B-2} _/!\_ Nouvelle syntaxe 2014

\newcommand*\multiSelec[2]
{%
	\fill[blueSelec,opacity=0.5] ($(cell#1.north west)+(0.25pt,-0.25pt)$) rectangle ($(cell#2.south east)+(-0.25pt,0.25pt)$);
	\draw[very thick] (cell#1.south west) rectangle (cell#1.north east);
	\fill[black] ($(cell#2.south east)+(-0.5pt,0.5pt)$) rectangle +(3pt,-3pt);

	%==> On colorie les en-têtes "colonnes"
	
	\StrChar{#1}{1}[\str@start] % par exemple, "G"
	\StrChar{#2}{1}[\str@end]   % par exemple, "L"
	\StrBetween{\col@names}{\str@start}{\str@end}[\str@col] %  retourne par exemple "HIJK"
	\edef\str@col{\str@start\str@col\str@end} % retourne alors "GHIJKL"
	\StrLen{\str@col}[\nb@columns] % nombre d'en-têtes "colonnes" à colorier
	\foreach \i in {1,...,\nb@columns}
	{
		\StrChar{\str@col}{\i}[\name]
		\fill[blueSelecCellBottom] 
					($(\name.south west)+(0.25pt,0.25pt)$) -- 
					($(\name.south east)+(-0.25pt,0.25pt)$) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)+(-0.25pt,0)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)+(0.25pt,0)$) --
					cycle;
		\fill[blueSelecCellTop] 
					($(\name.north west)+(0.25pt,-0.25pt)$) -- 
					($(\name.north east)+(-0.25pt,-0.25pt)$) -- 
					($0.5*(\name.south east)+0.5*(\name.north east)+(-0.25pt,0)$) -- 
					($0.5*(\name.south west)+0.5*(\name.north west)+(0.25pt,0)$) --
					cycle;
		\node at (\name) {\helvbx\name};
	}
	
	%==> On colorie les en-têtes "lignes"
	
	\StrGobbleLeft{#1}{2}[\first@num]
	\StrGobbleLeft{#2}{2}[\second@num]
	\foreach \i in {\first@num,...,\second@num}
	{
		\fill[blueSelecCellBottom] 
					(numline\i.south west) -- 
					(numline\i.south east) -- 
					($0.5*(numline\i.south east)+0.5*(numline\i.north east)$) -- 
					($0.5*(numline\i.south west)+0.5*(numline\i.north west)$) --
					cycle;
		\fill[blueSelecCellTop] 
					(numline\i.north west) -- 
					(numline\i.north east) -- 
					($0.5*(numline\i.south east)+0.5*(numline\i.north east)$) -- 
					($0.5*(numline\i.south west)+0.5*(numline\i.north west)$) --
					cycle;
		\node[celhead,minimum width=\numline@width,minimum height=\line@height] at (numline\i) {\helvbx\i};
	}
}
\endinput