summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/spreadsheets/spreadsheets-mkiv.tex
blob: c5c99e97d8a5457d1ab2dade2d472022333c2416 (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
% language=uk

% author    : Hans Hagen
% copyright : PRAGMA ADE & ConTeXt Development Team
% license   : Creative Commons Attribution ShareAlike 4.0 International
% reference : pragma-ade.nl | contextgarden.net | texlive (related) distributions
% origin    : the ConTeXt distribution
%
% comment   : Because this manual is distributed with TeX distributions it comes with a rather
%             liberal license. We try to adapt these documents to upgrades in the (sub)systems
%             that they describe. Using parts of the content otherwise can therefore conflict
%             with existing functionality and we cannot be held responsible for that. Many of
%             the manuals contain characteristic graphics and personal notes or examples that
%             make no sense when used out-of-context.
%
% comment   : Some chapters might have been published in TugBoat, the NTG Maps, the ConTeXt
%             Group journal or otherwise. Thanks to the editors for corrections. Also thanks
%             to users for testing, feedback and corrections.

\usemodule[spreadsheet]
\usemodule[art-01,abr-02]

\definecolor[darkred]  [r=.4]
\definecolor[darkgreen][g=.4]
\definecolor[darkblue] [b=.4]

\definecolor[maincolor] [darkred]
\definecolor[extracolor][darkblue]

\setuptyping
  [color=extracolor]

\setuptype
  [color=extracolor]

\setuphead
  [section]
  [color=maincolor]

\setupbodyfont
  [10pt]

\setupinteraction
  [hidden]

% \setupnumbering
%   [alternative=doublesided]

\startdocument
  [metadata:author=Hans Hagen,
   metadata:title=Simple Spreadsheets,
   author=Hans Hagen,
   affiliation=PRAGMA ADE,
   location=Hasselt NL,
   title=Simple Spreadsheets,
   extra=ConTeXt MkIV,
   support=www.contextgarden.net,
   website=www.pragma-ade.nl]

\startMPpage

    StartPage;

    numeric n, m ; n := 3 * 4 ; m := 4 * 4 ;
    numeric w, h ; w := PaperWidth/n ; h := PaperHeight/m ;

    for i=1 upto n :
        for j=1 upto m :
            fill
                unitsquare
                xysized (w,h)
                shifted ((i-1)*w,(j-1)*h)
                withcolor .5[i*red/n,j*blue/m]
            ;
        endfor ;
    endfor ;

    for i=1 upto n :
        for j=1 upto m :
            draw
                textext("\tt" & char(64+i) & if j < 10 : "0" else : "" fi & decimal j)
                xysized (.7*w,.7*h)
                shifted (i*w-.5w,(m+1-j)*h-.5h)
                withcolor .5[(n+1-i)*green/n,(m+1-j)*yellow/m]
            ;
        endfor ;
    endfor ;

    draw
        textext.llft("\ssbf{\documentvariable{title}}")
        xsized (PaperHeight-h)
        rotated 90
        shifted (PaperWidth-1.75w,PaperHeight-h/2)
        withcolor white
    ;

    draw
        textext.llft("\ssbf{\documentvariable{extra}}")
        ysized (h/2)
        shifted (PaperWidth-2.5w,3.75h)
        withcolor white
    ;


    draw
        textext.llft("\ssbf{\documentvariable{author}}")
        ysized (h/2)
        shifted (PaperWidth-2.5w,2.75h)
        withcolor white
    ;

    draw
        textext.llft("\ssbf \currentdate")
        ysized (h/2)
        shifted (PaperWidth-2.5w,1.75h)
        withcolor white
    ;

    StopPage;

\stopMPpage

% \page[empty] \setuppagenumber[start=1]

\startsubject[title={Contents}]

\placelist[section][criterium=all,interaction=all]

\stopsubject

\startsection [title={Introduction}]

Occasionally a question pops up on the \CONTEXT\ mailing list and answering it
becomes a nice distraction from a boring task at hand. The spreadsheet module is
the result of such a diversion. As with more support code in \CONTEXT, this is
not a replacement for \quote {the real thing} but just a nice feature for simple
cases. The module is loaded with

\starttyping
\usemodule[spreadsheet]
\stoptyping

So this is (at least currently) not one of the core functionalities but an
add||on. Of course some useful extensions might appear in the future.

\stopsection

\startsection [title={Spreadsheet tables}]

We can use \LUA\ in each cell, because under the hood it is all \LUA. There is
some basic parsing applied so that we can use the usual \type {A..Z} variables to
access cells.

\startbuffer[demo]
\startspreadsheettable[test]
  \startrow
    \startcell 1.1         \stopcell
    \startcell 2.1         \stopcell
    \startcell A[1] + B[1] \stopcell
  \stoprow
  \startrow
    \startcell 2.1         \stopcell
    \startcell 2.2         \stopcell
    \startcell A[2] + B[2] \stopcell
  \stoprow
  \startrow
    \startcell A[1] + B[1] \stopcell
    \startcell A[2] + B[2] \stopcell
    \startcell A[3] + B[3] \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

The rendering is shown in \in {figure} [spreadsheet:1]. Keep in mind that in
\LUA\ all calculations are done using floats, at least in \LUA\ versions with
version numbers preceding 5.3.

\placefigure
  [here]
  [spreadsheet:1]
  {A simple spreadsheet.}
  {\getbuffer[demo]}

The last cell can also look like this:

\starttyping
\startcell
function()
  local s = 0
  for i=1,2 do
    for j=1,2 do
      s = s + dat[i][j]
    end
  end
  return s
end
\stopcell
\stoptyping

The content of a cell is either a number or a function. In this example
we just loop over the (already set) cells and calculate their sum. The
\type {dat} variable accesses the grid of cells.

\starttyping
\startcell
function()
  local s = 0
  for i=1,2 do
    for j=1,2 do
      s = s + dat[i][j]
    end
  end
  tmp.total = s
end
\stopcell
\stoptyping

In this variant we store the sum in the table \type {tmp} which is local to the
current sheet. Another table is \type {fnc} where we can store functions. This
table is shared between all sheets. There are two predefined functions:

\starttyping
sum(columnname,firstrow,lastrow)
fmt(specification,n)
\stoptyping

The \type {sum} function works top||down in columns, and roughly looks like
this:

\starttyping
function sum(currentcolumn,firstrow,lastrow)
  local r = 0
  for i = firstrow, lastrow do
    r = r + cells[currentcolumn][i]
  end
  return r
end
\stoptyping

The last two arguments are optional:

\starttyping
sum(columnname,lastrow)
\stoptyping

This is equivalent to:

\starttyping
function sum(currentcolumn,lastrow)
  local r = 0
  for i = 1, lastrow do
    r = r + cells[currentcolumn][i]
  end
  return r
end
\stoptyping

While:

\starttyping
sum(columnname)
\stoptyping

boils down to:

\starttyping
function sum(currentcolumn)
  local r = 0
  for i = 1, currentrow do
    r = r + cells[currentcolumn][i]
  end
  return r
end
\stoptyping

Empty cells or cells that have no numbers are skipped. Let's now see these
functions in action:

\startbuffer[demo]
\startspreadsheettable[test]
  \startrow
    \startcell 1.1 \stopcell \startcell 2.1 \stopcell
  \stoprow
  \startrow
    \startcell 2.1 \stopcell \startcell 2.2 \stopcell
  \stoprow
  \startrow
    \startcell
      function()
        local s = 0
        for i=1,2 do
          for j=1,2 do
            s = s + dat[i][j]
          end
        end
        context.bold(s)
      end
    \stopcell
    \startcell
      function()
        local s = 1
        for i=1,2 do
          for j=1,2 do
            s = s * dat[i][j]
          end
        end
        context.bold(fmt("@.1f",s))
      end
    \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

The result is shown in \in {figure} [spreadsheet:2]. Watch the \type {fmt} call:
we use an at sign instead of a percent to please \TEX.

\placefigure
  [here]
  [spreadsheet:2]
  {Cells can be (complex) functions.}
  {\getbuffer[demo]}

Keep in mind that we're typesetting and that doing complex calculations is not
our main objective. A typical application of this module is in making bills, for
which you can combine it with the correspondence modules. We leave that as an
exercise for the reader and stick to a simple example.

\startbuffer[demo]
\startspreadsheettable[test]
  \startrow
    \startcell[align=flushleft,width=8cm] "item one" \stopcell
    \startcell[align=flushright,width=3cm] @ "0.2f EUR" 3.50 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "item two" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" 8.45 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "tax 19\percent" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" 0.19 * (B[1]+B[2]) \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "total 1" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" sum(B,1,3) \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "total 2" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" B[1] + B[2] + B[3] \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "total 3" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" sum(B) \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

Here (and in \in {figure} [spreadsheet:8]) you see a quick and more
readable way to format cell content. The \type {@} in the template is
optional, but needed in cases like this:

\starttyping
@ "(@0.2f) EUR" 8.45
\stoptyping

A \type {@} is only prepended when no \type {@} is given in the template.

\placefigure
  [here]
  [spreadsheet:8]
  {Cells can be formatted by using \type {@} directives.}
  {\getbuffer[demo]}

In practice this table we can be less specific and let \type {\sum} behave more
automatical. That way the coding can be simplified (see \in {figure}
[spreadsheet:7]) and also look nicer.

\startbuffer[demo]
\startspreadsheettable[test][frame=off]
  \startrow
    \startcell[align=flushleft,width=8cm] "The first item" \stopcell
    \startcell[align=flushright,width=3cm] @ "0.2f EUR" 3.50 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "The second item" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" 8.45 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "The third item" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" 5.90 \stopcell
  \stoprow
  \startrow[topframe=on]
    \startcell[align=flushleft] "VAT 19\percent" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" 0.19 * sum(B) \stopcell
  \stoprow
  \startrow[topframe=on]
    \startcell[align=flushleft] "\bf Grand total" \stopcell
    \startcell[align=flushright] @ "0.2f EUR" sum(B) \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

\placefigure
  [here]
  [spreadsheet:7]
  {The \type {sum} function accumulates stepwise.}
  {\getbuffer[demo]}

There are a few more special start characters. This is demonstrated in \in
{figure} [spreadsheet:9]. An \type {=} character is ignored. \footnote {Taco
suggested to support this because some spreadsheet programs use that character to
flush a value.} When we start with an \type {!}, the content is not typeset.
Strings can be surrounded by single or double quotes and are not really
processed.

\startbuffer[demo]
\startspreadsheettable[test][offset=1ex]
  \startrow
    \startcell[align=flushleft] "first" \stopcell
    \startcell[align=flushleft] '\type{@ "[@i]" 1}' \stopcell
    \startcell[align=flushright,width=3cm] @ "[@i]" 1 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "second" \stopcell
    \startcell[align=flushleft] '\type{= 2}' \stopcell
    \startcell[align=flushright] = 2 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "third" \stopcell
    \startcell[align=flushleft] '\type{! 3}' \stopcell
    \startcell[align=flushright] ! 3 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "fourth" \stopcell
    \startcell[align=flushleft] '\type{4}' \stopcell
    \startcell[align=flushright] 4 \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "\bf total one" \stopcell
    \startcell[align=flushleft] '\type{sum(C)}' \stopcell
    \startcell[align=flushright] sum(C) \stopcell
  \stoprow
  \startrow
    \startcell[align=flushleft] "\bf total two" \stopcell
    \startcell[align=flushleft] '\type{= sum(C)}' \stopcell
    \startcell[align=flushright] = sum(C) \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

The \type {sum} function is clever enough not to include itself in the
summation. Only preceding cells are taken into account, given that they
represent a number.

\placefigure
  [here]
  [spreadsheet:9]
  {Cells can be hidden by \type {!} and can contain strings only.}
  {\getbuffer[demo]}

\stopsection

\startsection [title={Normal tables}]

In the previous examples we used \TEX\ commands for structuring the sheet but
the content of cells is \LUA\ code. It is also possible to stick to a regular
table and use specific commands to set and get cell data.

\startbuffer[demo]
\bTABLE[align=middle]
  \bTR
    \bTD \getspr{100} \eTD \bTD test \setspr{30} \eTD
  \eTR
  \bTR
    \bTD \getspr{20} \eTD \bTD \getspr{4+3} \eTD
  \eTR
  \bTR
    \bTD \getspr{A[1] + A[2]} \eTD
    \bTD \getspr{B1 + B2} \eTD
  \eTR
  \bTR
    \bTD[nx=2] \bf \getspr{(A[3] + B[3]) /100} \eTD
  \eTR
  \bTR
    \bTD[nx=2] \bf \getspr{fmt("@0.3f",(A[3] + B[3]) /100)} \eTD
  \eTR
  \bTR
    \bTD[nx=2] \bf \getspr{fmt("@0.3f",(sum(A,1,2)) / 10)} \eTD
  \eTR
\eTABLE
\stopbuffer

\typebuffer[demo]

The method to use depends on the complexity of the table. If there is
more text than data then this method is probably more comfortable.

\placefigure
  [here]
  [spreadsheet:3]
  {A sheet can be filled and accessed from regular tables.}
  {\getbuffer[demo]}

% \setupspreadsheet[mysheet]
%
% \startspreadsheet[mysheet]
%
% \bTABLE[align=middle]
%   \bTR
%     \bTD \getspr{100} \eTD \bTD test \setspr{30} \eTD
%   \eTR
%   \bTR
%     \bTD \getspr{20} \eTD \bTD \getspr{4+3.5} \eTD
%   \eTR
%   \bTR
%     \bTD \getspr{A[1] + A[2]} \eTD
%     \bTD \getspr{B[1] + B[2]} \eTD
%   \eTR
%   \bTR
%     \bTD[nx=2] \bf \getspr{A[3] + B[3]} \eTD
%   \eTR
% \eTABLE
%
% \stopspreadsheet

\stopsection

\startsection[title={A few settings}]

It's possible to influence the rendering. The following example demonstrates
this. We don't use any formatting directives.

\startbuffer[demo]
\startspreadsheettable[test]
  \startrow
    \startcell   123456.78 \stopcell
  \stoprow
  \startrow
    \startcell  1234567.89 \stopcell
  \stoprow
  \startrow
    \startcell A[1] + A[2] \stopcell
  \stoprow
\stopspreadsheettable
\stopbuffer

\typebuffer[demo]

\placefigure
  [here]
  [spreadsheet:4]
  {Formatting (large) numbers.}
  {\getbuffer[demo]}

\in {Figure} [spreadsheet:4] demonstrates how this gets rendered by
default. However, often you want numbers to be split in parts separated by
periods and commas. This can be done as follows:

\startbuffer[setup]
\definehighlight[BoldAndRed]  [style=bold,color=darkred]
\definehighlight[BoldAndGreen][style=bold,color=darkgreen]

\setupspreadsheet
  [test]
  [period={\BoldAndRed{.}},
   comma={\BoldAndGreen{,}},
   split=yes]
\stopbuffer

\typebuffer[setup] \getbuffer[setup]

\placefigure
  [here]
  [spreadsheet:5]
  {Formatting (large) numbers with style and color.}
  {\getbuffer[setup,demo]}

\stopsection

\startsection[title={The \LUA\ end}]

You can also use spreadsheets from within \LUA. The following example is
rather straightforward:

\startbuffer[demo-a]
\startluacode
context.startspreadsheettable { "test" }
  context.startrow()
    context.startcell() context("123456.78")   context.stopcell()
  context.stoprow()
  context.startrow()
    context.startcell() context("1234567.89")  context.stopcell()
  context.stoprow()
  context.startrow()
    context.startcell() context("A[1] + A[2]") context.stopcell()
  context.stoprow()
context.stopspreadsheettable()
\stopluacode
\stopbuffer

\typebuffer[demo-a]

However, even more \LUA|-|ish is the next variant:

\startbuffer[demo-b]
\startluacode
  local set = moduledata.spreadsheets.set
  local get = moduledata.spreadsheets.get

  moduledata.spreadsheets.start("test")
    set("test",1,1,"123456.78")
    set("test",2,1,"1234567.89")
    set("test",3,1,"A[1] + A[2]")
  moduledata.spreadsheets.stop()

  context.bTABLE()
    context.bTR()
      context.bTD() context(get("test",1,1)) context.eTD()
    context.eTR()
    context.bTR()
      context.bTD() context(get("test",2,1)) context.eTD()
    context.eTR()
    context.bTR()
      context.bTD() context(get("test",3,1)) context.eTD()
    context.eTR()
  context.eTABLE()
\stopluacode
\stopbuffer

\typebuffer[demo-b]

Of course the second variant does not make much sense as we can do this way
more efficient by not using a spreadsheet at all:

\startbuffer[demo-c]
\startluacode
  local A1, A2 = 123456.78, 1234567.89
  context.bTABLE()
    context.bTR()
      context.bTD() context(A1)    context.eTD()
    context.eTR()
    context.bTR()
      context.bTD() context(A2)    context.eTD()
    context.eTR()
    context.bTR()
      context.bTD() context(A1+A2) context.eTD()
    context.eTR()
  context.eTABLE()
\stopluacode
\stopbuffer

\typebuffer[demo-c]

You can of course use format explicitly. Here we use the normal percent
directives because we're in \LUA, and not in \TEX, where percentage
signs are a bit of an issue.

\startbuffer[demo-d]
\startluacode
  local A1, A2 = 123456.78, 1234567.89
  local options = { align = "flushright" }
  context.bTABLE()
    context.bTR()
      context.bTD(options)
        context("%0.2f",A1)
      context.eTD()
    context.eTR()
    context.bTR()
      context.bTD(options)
        context("%0.2f",A2)
      context.eTD()
    context.eTR()
    context.bTR()
      context.bTD(options)
        context("%0.2f",A1+A2)
      context.eTD()
    context.eTR()
  context.eTABLE()
\stopluacode
\stopbuffer

\typebuffer[demo-d]

As expected and shown in \in {figure} [spreadsheet:6], only the first and last
variant gets the numbers typeset nicely.

\placefigure
  [here]
  [spreadsheet:6]
  {Spreadsheets purely done as \CONTEXT\ \LUA\ Document.}
  {\startcombination[4*1]
     {\getbuffer[demo-a]} {}
     {\getbuffer[demo-b]} {}
     {\getbuffer[demo-c]} {}
     {\getbuffer[demo-d]} {}
   \stopcombination}

\stopsection

\startsection[title={Helper macros}]

There are two helper macros that you can use to see what is stored in a
spreadsheet:

\starttyping
\inspectspreadsheet[test]
\showspreadsheet   [test]
\stoptyping

The first command reports the content of \type {test} to the console, and
the second one typesets it in the running text:

\blank
\showspreadsheet[test]
\blank

Another helper function is \type {\doifelsespreadsheetcell}, You can use this
one to check if a cell is set.

\startbuffer[demo]
(1,1): \doifelsespreadsheetcell[test]{1}{1}{set}{unset}
(2,2): \doifelsespreadsheetcell[test]{2}{2}{set}{unset}
(9,9): \doifelsespreadsheetcell[test]{9}{9}{set}{unset}
\stopbuffer

\typebuffer[demo]

This gives:

\startlines
\getbuffer[demo]
\stoplines

There is not much more to say about this module, apart from that it is a
nice example of a \TEX\ and \LUA\ mix. Maybe some more (basic) functionality
will be added in the future but it all depends on usage.

\stopsection

\startsubject[title={Colofon}]

\starttabulate[|B|p|]
\NC author    \NC \getvariable{document}{author}, \getvariable{document}{affiliation}, \getvariable{document}{location} \NC \NR
\NC version   \NC \currentdate \NC \NR
\NC website   \NC \getvariable{document}{website} \endash\ \getvariable{document}{support} \NC \NR
\NC copyright \NC \symbol[cc][cc-by-sa-nc] \NC \NR
\stoptabulate

\stopsubject

\stopdocument