-
Notifications
You must be signed in to change notification settings - Fork 4
/
ivoatexDoc.tex
2183 lines (1786 loc) · 88.9 KB
/
ivoatexDoc.tex
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
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[11pt,a4paper]{ivoa}
\input tthdefs
\input gitmeta
\tolerance=3000
\hbadness=4000
\usepackage{listings}
\lstloadlanguages{sh,make,[latex]tex}
\lstset{flexiblecolumns=true,numberstyle=\small,showstringspaces=False,
identifierstyle=\texttt,defaultdialect=[latex]tex}
\usepackage{todonotes}
\usepackage[utf8]{inputenc}
\definecolor{texcolor}{rgb}{0.4,0.1,0.1}
\newcommand{\texword}[1]{\texttt{\color{texcolor} #1}}
\newcommand{\BibTeX}{Bib\TeX}
\iftth
\newcommand{\comicstuff}[1]{
\begin{html}<span class="comic">#1</span>\end{html}}
\else
\newcommand{\comicstuff}[1]{(HTML exclusive material)}
\fi
\customcss{custom.css}
\title{The \ivoatex\ Document Preparation System}
\ivoagroup{Standards and Processes}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/MarkusDemleitner]{Markus Demleitner}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/MarkTaylor]{Mark Taylor}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/JamesDempsey]{James Dempsey}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/PatrickDowler]{Patrick Dowler}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/PaulHarrison]{Paul Harrison}
\author[http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/MarcoMolinaro]{Marco Molinaro}
\editor{Markus Demleitner}
\previousversion[http://ivoa.net/documents/Notes/IVOATexDoc/20220525]{Version 1.3}
\previousversion[http://www.ivoa.net/documents/Notes/IVOATexDoc/20180814]{Version
1.2}
\previousversion[http://www.ivoa.net/documents/Notes/IVOATexDoc/20160430]{Version
1.1}
\previousversion[http://www.ivoa.net/documents/Notes/IVOATexDoc/20150129]{Version
1.0}
\begin{document}
\begin{abstract}
This note describes the \ivoatex\ document preparation system for IVOA
standards and notes. \ivoatex\ supports the production of
PDF and HTML renderings of the documents with sources in
plain text suitable for version control, as is desirable for normative
texts. This note contains a user guide as well as a discussion of
\ivoatex's dependencies and its implementation. It describes the
software as of June 2023 (release 1.3).
\ivoatex{} has special facilities for the git version control system,
and the default deployment uses github infrastructure. Since at this
point github is the IVOA's designated version control system, this note
also contains material on the policies effective in the IVOA's use of
github.
\end{abstract}
\section*{Acknowledgments}
\ivoatex\ heavily draws from experiences made with previous markup-based
document preparation systems, in particular LaTeX classes and
infrastructure created by S\'ebastien Derriere and Mark Taylor, as well
as Paul Harrison's XML-based ivoadoc system.
We thank tth's author, Ian Hutchinson, for generous technical support
and prompt provision of solutions in the upstream source where necessary.
\section{Introduction}
Creating and developing standards is a big part of the operations of
the International Virtual Observatory Alliance (IVOA).
As these are normative texts, attention to detail is very important, and
being able to rigorously track changes to the documents is highly
advantageous.
Standards are also often developed cooperatively, which means that
capabilities for branching and merging are desirable. This strongly
suggests employing version control systems for document authoring.
Change tracking in software designed for editing office documents, to
the extent it is supported at all, usually requires significant
manual intervention, is optional, often used incorrectly, and frequently
lacks interoperability. Led by these considerations, it was decided that
\ivoatex\ would have to be based on plain text source files.
As mandated by the IVOA Document Standards \citep{2017ivoa.spec.0517G},
finished documents have to be at
least available in PDF, while an additional HTML rendering for online
use is recommended. A document preparation system should thus be
able to produce documents in these formats in at least acceptable
quality.
With these constraints in mind, several possible solutions were
investigated. Paul
Harrison's ivoadoc
system\footnote{\url{https://volute.g-vo.org/svn/trunk/projects/ivoapub/ivoadoc}}
went for XHTML as
an input format and used XSLT2 and XML-FO as document processors. While
this facilitated several interesting features -- for instance,
automatic extraction and formatting of XML schema fragments or
straightforward embedding of RDFa markup for machine-readable examples
--, it turned out that tooling issues were severe (e.g., reliable use
of SGML catalogs\footnote{This is important as retrieval of DTDs and
similar data from their commonly used system identifiers (i.e.,
typically W3C web servers) is at least undesirable and in practice
causes massive delays in formatting due to rate limiting on the part of
the W3C.}, non-free hyphenation patterns, classpath issues) and the use
of XML-FO for PDF generation yielded inferior renderings with little
prospect for improvements by third parties. Also, authors disliked
writing HTML tags.
Other options considered for source languages included docbook or
a lightweight markup language (ReStructuredText and markdown having
been serious contenders).
In each case, there were concerns either regarding the system's power
and flexibility or its ease of installation and maintenance.
Meanwhile, several documents -- to mention just a few, SAMP, VOTable,
and VOUnits -- had successfully used \TeX-based systems typically
derived from work done in the early 2000s by S\'ebastien Derriere.
\ivoatex\ essentially is a generalisation of these standards' formatting
systems, also inheriting from them the use of the \texttt{make} tool to
automate workflows.
\ivoatex\ was extended to relieve document editors from some of the
bookkeeping involved with producing IVOA standards and provide authors
with uniform solutions for common problems in standards typesetting.
In the remainder of this document, we give quick-start instructions
on installation and authoring in sect.~\ref{sect:quick} and continue
with
a more thorough discussion of \ivoatex's facilities, focusing
on enabling automatic production of both HTML and PDF output in
sect.~\ref{sect:authoring}.
Sect.~\ref{sect:ivoapol} then documents how ivoatex is intended to be
used on github by the various actors; authors and contributors to IVOA
standards should at least have a brief look at the recommended
procedures for them in subsection~\ref{sect:contributing}.
In sect.~\ref{sect:impl}, additional
details on the implemenation are given for the benefit of authors
planning to extend \ivoatex. We close with a discussion of open issues
and desirable developments.
\section{Installation and Quick Start}
\label{sect:quick}
\subsection{Dependencies}
\ivoatex\ is designed to work more or less out of the box on common
POSIX-compliant systems; no non-free software is required for operation.
Its main uncommon dependency is the tth translator,
a program based on lex used to translate LaTeX
to HTML. As it is compact and portable, it is delivered with
\ivoatex~and built on demand.
Since \ivoatex's tth may at times offer
some enhancements over the upstream tth, using a system-installed tth is
discouraged.
The remaining dependencies include:
\begin{itemize}
\item A \LaTeX\ distribution with some commonly available packages (calc,
graphicx, xcolor, ifthen, doc, paralist, url, natbib, caption,
hyperref). See below for platform-specific advice.
\item A sufficiently capable implementation of \texttt{make}, with GNU's
implementation recommended.
\item \texttt{librsvg2-bin} when people need to (re-) build architecture
diagrams.
\item Optionally, \texttt{latexmk}. If it is available, a lot less
manual attention is necessary when rerunning LaTeX to update
bibliographies or document-internal references.
\item \texttt{python3} for generated content and other housekeeping
that is probably not relevant for most authors. Editors need it for
automatic submission to the document repository.
\item Editors will need the XSLT1 processor
\texttt{xsltproc} (a different processor can
be used, but that would probably require custom make rules) for HTML
generation.
\item Editors will need the
\texttt{gcc} compiler (another C compiler could be used; the
central makefile should probably be amended to allow easier changes
here), and \texttt{flex} for HTML generation.
\item Editors will need the \texttt{zip} archiver for package generation.
\item Editors will need \texttt{imageMagick} and \texttt{ghostscript} if
vector graphics is to be processed into HTML.
\item Editors will need \texttt{pdf2svg} if TikZ images are in a
document converted to HTML.
\end{itemize}
Based on limited experience, we believe the easiest way to run
\ivoatex{} on Windows is through cygwin, which also should make make the
installation of the dependencies reasonably simple.
Currently (2023) the standard \TeX\ distribution is
\TeX Live,\footnote{\url{https://www.tug.org/texlive/}} which is available
for Linux, macOS and Windows either directly from TUG, or via system
package managers.
On Debian-derived systems, the dependencies should be present after
running a distribution-specific adaption of
\begin{lstlisting}[basicstyle=\footnotesize]
apt install build-essential texlive-latex-extra zip xsltproc git\
texlive-bibtex-extra imagemagick ghostscript cm-super librsvg2-bin
\end{lstlisting}
(cm-super contains vector versions of computer modern fonts in T1
encoding), on RPM-based systems something like
\begin{lstlisting}
yum install texlive-scheme-full libxslt make gcc zip\
ImageMagick ghostscript git
\end{lstlisting}
should pull in everything that is necessary.
The macOS version of \TeX Live is
Mac\TeX.\footnote{\url{https://www.tug.org/mactex/}. This
distribution is large because it includes comprehensive
PDF documentation and a large collection of fonts (\texttt{texdoc <packagename>} is
useful); there is a smaller `Basic\TeX' download, though this requires
some post-install package downloads before it is useful.} It is also
possible to build \TeX\ using MacPorts (with \texttt{port install
texlive}), but this may result in a slightly non-standard
distribution.\footnote{See \url{http://tex.stackexchange.com/questions/97183/}}.
It's possible to persuade MacPorts to use a separate Mac\TeX\ install,
rather than installing its own version,
but the precise process for that that seems to change from release to release.
You can install the MacPorts dependencies with
\begin{lstlisting}
port install ImageMagick libxslt ghostscript +full
\end{lstlisting}
To see if the full prerequisites are there and compatible with \ivoatex, try
building an updated version of this document from its github source
(normal users can go without making HTML and packages, in which case a
lot of dependencies are not needed):
\begin{lstlisting}[basicstyle=\footnotesize]
git clone --recurse-submodules https://github.com/ivoa-std/ivoatexDoc
cd ivoatexDoc
make biblio # update the bibliography
make forcetex # make a PDF ignoring timestamps
make ivoatexDoc.html # make an html document
make package # make a zipfile for IVOA submission
\end{lstlisting}
During HTML generation, various diagnostics both
from tth and from xsltproc (unknown commands,
unexpected end tags, and the like) are
expected at this point and no reason for alarm; we work on reducing the
amount of spurious error messages.
\subsection{Basic \ivoatex~operation}
For ease of installation and robustness, \ivoatex\ for now is designed
to be used from within a subdirectory of the directory containing the
document sources (rather than being installed globally). Given that
it is fairly compact, having one copy per document seems acceptable.
So, the first step to use \ivoatex\ is to create a development
directory:
\begin{lstlisting}
export DOCNAME=SampleDoc
# this would be your document's short name, e.g., RegTAP, SIAv2)
mkdir $DOCNAME
\end{lstlisting}
The DOCNAME -- which will turn up in URLs, standard identifiers, and the
like -- should be chosen to be both succinct and expressive, and it
should not contain non-alphanumeric characters (the examples given here
assume that, too). A name
like \texttt{SimpleDALRegExt} probably marks the upper limit in terms of
length.
While it is clearly preferable if authors use the IVOA's
designated common version control system\footnote{Which, despite
many concerns \citep{book:zuboff}, currently is
github.com.} from the outset of
document development, it is possible to build ivoatex documents
locally as well.
\subsubsection{Installation from Archive (not recommended)}
Without version control, it is sufficient to obtain \ivoatex\ from a
distribution site and unpack it into the future document directory:
\begin{lstlisting}
cd $DOCNAME
curl http://ivoatex.g-vo.org/ivoatex-latest.tar.gz \
| tar -xvzf -k
sh ivoatex/make-templates.sh $DOCNAME
\end{lstlisting}
The shell script will print some error messages because no version
control has been enabled. These are safe to ignore.
\subsubsection{Installation with git version control}
The recommended way to run \ivoatex{}
is to use git's submodule feature. This makes it reasonably simple to keep
ivoatex up to date without polluting the
document's history, and it makes it straightforward to
feed back any improvements you may make to ivoatex. Hence, you will
usually start a document like this:
\begin{lstlisting}[basicstyle=\footnotesize]
cd $DOCNAME
git init
git submodule add https://github.com/ivoa-std/ivoatex
sh ivoatex/make-templates.sh $DOCNAME
git commit -m "Starting $DOCNAME"
\end{lstlisting}
The \verb|ivoatex/make-templates.sh| script will copy a few template files from
the ivoatex distribution to the working space. You could do that
manually, too; see the script for what files to move where.
At this point, create a repository in your account using github.com's web
interface. Use \$DOCNAME as the repository name, and do not choose any
template. This procedure will leave you on a web page with a URI like
\nolinkurl{https://github.com/msdemlei/ivoatexDoc}.
On that page, you can obtain a
``Clone URI'', which is what you can push to. Use the ssh variant,
i.e., something like \verb|[email protected]:username/docname.git|.
Then, push your newly changed material into this new repository's main
branch:
\begin{lstlisting}[basicstyle=\footnotesize]
git remote add origin <Clone URI>
git push --set-upstream origin main
\end{lstlisting}
(depending on your git version and configuration,
you may have to use ``master'' rather
than ``main'').
\subsubsection{Beginning the document}
\label{sect:beginning}
\paragraph{Main metadata in the Makefile}
\label{sect:mainmeta}
For convenience, the document production should start from some common
templates which are part of the \ivoatex\ distribution. The above
procedure has already created \verb|README.md| (a brief introduction to
what the document is about), \verb|$DOCNAME.tex| (the future document)
and \verb|Makefile| (where some of the document metadata is defined).
The next step is to fill out the makefile template.
As of the formatting of this document, this template looks like this:
\lstinputlisting[language=make,basicstyle=\footnotesize]{ivoatex/Makefile.template}
All lines with question marks must be filled out. The document date
is the publication date, which can be significantly different from the
current date. After its initial setting, it should only be changed at
the time of submission to the document archive. It is always in
DALI-style ISO format \citep{2017ivoa.spec.0517D}, e.g., 2014-03-31.
\texttt{SOURCES} is used in dependency processing. It would be amended
when the source file is split into separate files or if material is
included into the document, e.g., via \texword{lstinputlisting}.
Graphics files included do not need to be given here, as the document
will automatically depend on them. The exception is
\verb|role_diagram.pdf|; see~sect.~\ref{sect:archdiag}.
\texttt{FIGURES} must contain the names of all bitmap graphics included
in the document; files missing here will be missing from the package for
distribution to the IVOA document repository, which will break the HTML
rendering. As to \texttt{VECTORFIGURES}, see
sect.~\ref{sect:vectorgraphics}.
\texttt{AUX\_FILES} is intended for files that should be included in the
upload to the IVOA document repository while not taking part in the
actual formatting. This in particular concerns XML Schema files, for
which the IVOA maintains a separate repository, but is by no means
limited to them.
\ivoatex{} evaluates another variable, \verb|DOCREPO_BASEURL|. There, you
can set a non-standard location of the formatted document. This
is only necessary for legacy documents, which is why the variable is not
mentioned in the template makefile. For example, this document sets:
\begin{lstlisting}
DOCREPO_BASEURL=http://ivoa.net/documents/Notes/IVOATexDoc
\end{lstlisting}
\paragraph{Additional metadata in the \LaTeX~source}
The template for the \TeX\ source contains several lines with
multiple question marks. These must be filled out as well.
As illustrated in the template, both \texword{author} and
\texword{previousversion} support an optional argument giving an URL; for
\texword{author}, it should normally point to the respective person's
page in the IVOA wiki\footnote{You can also have ORCIDs there, which are
now HTTP URIs, too.}, for \texword{previousversion}, it should point to
the landing page of the respective document version in the IVOA document
repository. Since \ivoatex~version 1.4, you can use ``make
new-release`` to manage \texword{previousversion}.
\texword{ivoagroup} should contain the name of the (one) IVOA working or
interest group under whose auspices the document development mainly
happens. If this is an interest group (which is only possible for
notes), use \verb|ivoagroup[IG]{...}| to make \ivoatex~use ``Interest
Group'' rather than ``Working Group'' as the label of the corresponding
piece of metadata.
Pick one from the following list\footnote{We do not
enforce the use of the controlled vocabulary. Automatic submission
with \texttt{make upload} will fail if you invent something here,
though.}:
\begin{compactitem}
\item Applications
\item Data Access Layer
\item Data Models
\item Grid and Web Services
\item Registry
\item Data Curation and Preservation
\item Standards and Processes
\item Semantics
\item Operations
\item Radio
\item Theory
\item VO Event
\item Time Domain
\item Education
\item No Group (only possible for Notes)
\end{compactitem}
\paragraph{The README}
The \verb|README.md| template should be edited to give a short
(one-paragraph) introduction to what the document is about at an even
higher level than the abstract. The template also contains instructions
for building, pointers to the IVOA document repository, and a license
statement. While you can change these if you want, that should not
usually be necessary.
\paragraph{The Architecture Diagram}
\label{sect:archdiag}
An architecture diagram is only
necessary for documents on the recommendation track. Notes may have
one, but since Notes are not shown on it, that is rather
unusual.
To prepare an architecture diagram, first obtain the full description of
all IVOA standards:
\begin{lstlisting}
cp ivoatex/archdiag-full.xml role_diagram.xml
git add role_diagram.xml
\end{lstlisting}
This is just an abstract specification that is compiled into images. To
ensure this happens, \verb|role_diagram.svg| to \verb|FIGURES| in the
Makefile. As long as the \LaTeX~toolchain does not support the SVG
image format, you must additionally append \verb|role_diagram.pdf| to
\verb|SOURCES|.
Then edit
\texttt{role\_diagram.xml} and remove all references to standards unrelated
to the current document. As a rule, all \texttt{rec} elements for
standards not mentioned in
``Role within the IVOA Architecture'' should be removed. Finally, use a
\xmlel{thisrec} element for the current standard. An architecture
diagram for VOResource would thus be specified like this:
\begin{lstlisting}[basicstyle=\footnotesize]
<archdiag xmlns="http://ivoa.net/archdiag">
<thisrec name="VOResource" x="64.5" y="155" w="71"/>
<rec name="RegTAP" x="76" y="180" w="48"/>
<rec name="Reg.Intf" x="75" y="205" w="50"/>
<!-- and a few more -->
</archdiag>
\end{lstlisting}
The standard-specific
architecture diagram will be built by saying \texttt{make
role\_diagram.svg} and can be viewed using, for instance, common web
browsers. Please refrain from editing the SVG with vector graphics
programs\footnote{You would have to version control it then, too, and that
typically does not work well for the output of such programs}.
In the PDF renderings of the document,
a PDF version of the architecture diagram is
required. This is built using \texttt{make role\_diagram.pdf}, and a
stand-in will be built if your system lacks the software to do this
conversion (currently: rsvg-convert).
As long as the tooling situation regarding \LaTeX~and SVG is as
unsatisfactory as it is, please commit both \texttt{role\_diagram.svg} and
\texttt{role\_diagram.pdf} to the version control system.
\paragraph{Source code conventions}
\ivoatex\ requires the source to be written in UTF-8 encoding, since the
references shipped with it are in UTF-8.
Authors are urged to keep lines shorter than 72 characters in input
files whenever possible in order to keep diffs useful and readable.
When edits are made, paragraphs should not normally be reflowed to avoid
large diffs for minor edits. Authors desiring a reflow after many edits
are encouraged to concentrate them in a separate, reflow-only commit.
\paragraph{Makefile targets}
The PDF version of the document is built by the makefile's default rule,
so running \texttt{make} will usually by enough. This will produce a
file \texttt{\$DOCNAME.pdf}.
Other makefile targets for author use include:
\begin{itemize}
\item \texttt{help} gives a summary of the more common targets.
\item \texttt{\$DOCNAME.html} generates an HTML rendering of the
document; at this point, this will typically emit quite a bit of
spurious diagnostics. Unfortunately, real problems may hide within.
Therefore, we currently recommend a visual inspection of the resulting
HTML before submission.
\item \texttt{test} runs document-defined tests (see
sect.~\ref{sect:tests}).
\item \texttt{generate} is used to update machine-generated content in
the document, typically by the main editor. See
section~\ref{sect:generated} for details.
\item \texttt{update} updates the ivoatex submodule to whatever is in
the main ivoatex branch on github. This will fail if you have
uncommitted local changes to your ivoatex.
\item \texttt{new-release} updates the Makefile and the document for a
new version of the document. It is somewhat smart in that, for
instance, it will automatically make a REC-1.0 into a WD-1.1, and it
will automatically add links to the previous version and a changelog
section. While you will need to edit the DOCDATE in the Makefile later on, this
is the recommended way to bump versions.
\item \texttt{tag} creates a git tag for the current document version and
pushes it to the origin server. This is for when you do a release; see
sect.~\ref{sect:submitting} for details.
\item \texttt{untag} removes the tag for the current document version.
This is for when you have tagged a release that you had to change after
you ran \verb|make tag|.
\item \texttt{bib-suggestions} inspects the document's references for
standards with new versions and points these out (see
sect.~\ref{sect:citation}).
\item \texttt{upload} produces a package, shows metadata to be uploaded to the
IVOA document repository and
then uploads the package. See sect.~\ref{sect:submitting} for how to
responsibly use this target).
\item \texttt{biblio} updates the bibliography (i.e., runs \BibTeX);
running this is necessary after one of the bibliography files is updated
or when a new publication is referenced from the document. This target
is not necessary on machines that have latexmk.
\item \texttt{forcetex} rebuilds the PDF unconditionally just as if the
main source had been edited. This target is probably not useful on
machines with latexmk.
\item \texttt{package} generates a zip file containing everything needed
for publication in the IVOA's document repository. Obviously,
\texttt{DOCVERSION}, \texttt{DOCTYPE}, and \texttt{DOCDATE} in the
Makefile should be updated as necessary before this target is built.
The result is a zip file with a name compliant to the IVOA document
standards \citep{2017ivoa.spec.0517G}.
\item \texttt{arxiv-upload} produces a file arxiv-upload.tar.gz for
the current document. ArXiv uploads are automatically done by the
document coordinator for RECs and ENs, and editors \emph{should not} do
them themselves. Authors of Notes may upload their documents to arXiv.
\item \texttt{\$DOCNAME-draft.pdf} generates a PDF rendering just like a
simple make, but it will add a watermark warning against distribution. This is
mainly intended for continuous integration workflows. It only works
if \verb|pdftk| is installed.
\end{itemize}
\begin{admonition}{Note}
Simply running \texttt{latex}, \texttt{pdflatex},
or \texttt{mklatex} directly
(rather than through make) is \emph{not} supported with \ivoatex. Due
to the non-global installation of the support files, the \TeX\ run needs
a special environment that is prepared by the makefile.
Also note that on systems without latexmk,
bibliography processing must be initated manually by
running \texttt{make biblio}; unless authors checked in the bbl file
this produces, this must also be run immediately after a document checkout.
\end{admonition}
\subsection{Examples}
Examples for \ivoatex\ use are found in the ivoa-std organisation on
github\footnote{\url{https://github.com/ivoa-std}}.
\section{Authoring documents}
\label{sect:authoring}
While \ivoatex\ documents can be written much like any other \TeX\
document, it is advisable to follow certain standards and use special
facilities for common appearance, easier development, and robustness
against evolution of \ivoatex\ itself.
\subsection{\ivoatex\ Features}
\ivoatex\ provides a small set of macros and environments designed
to ease standards authoring. These include:
\begin{bigdescription}
\item[\texword{author}, \texword{previousversion}, \texword{ivoagroup}] these are discussed
in sect.~\ref{sect:beginning}.
\item[\texword{ucd}] a macro for marking up UCDs. This in particular
helps with hyphenation of these, typically long, strings.
\item[\texword{xmlel}] a macro for marking up XML element or attribute
names and similar.
\item[\texword{vorent}] for a name taken from VOResource or its
extensions, usually an
element or attribute name.
\item[\texword{admonition}] This is an environment for
displayed boxes, intended for notes, tips, and the like.
It takes an argument giving the head of the box, e.g.,
\begin{lstlisting}
\begin{admonition}{Note}
Admonitions should not be overdone.
Also, they are floating insertions.
\end{admonition}
\end{lstlisting}
\item[\texword{bigdescription}] This is an environment for definition
lists in the style of HTML \xmlel{dl}, and it will be translated into
one. Use \verb|\item[term]| for the term to be defined
(the construct this item is in is a \texword{bigdescription}).
\item[\texword{auxilaryurl}] A macro expanding a path relative to the
current document to a full URL. This is discussed more extensively in
sect.~\ref{sect:links}
\item[\texword{inlinetable}] This is an environment for showing tables
in-place (rather than as an insertion potentially somewhere else, as
LaTeX's table environment does). This may lead to rather empty pages
when the tables get longer.
\end{bigdescription}
The intention behind macros like \texword{xmlel} and \texword{vorent} is
that such terms are typeset uniformly across documents. Further
semantic markup like this is planned for future releases, and document
authors are encouraged to contribute terms.
Also note that the title page is generated by the abstract environment.
Thus, all \ivoatex\ documents must have an abstract within the
\texword{abstract} environment.
\subsection{Listings, Verbatim Material}
\label{sect:verbatim}
\ivoatex\ documents should use the \texword{listings} package to include
source code snippets, XML fragments and the like.
Benefits over the \verb|verbatim| environment include easier control over
font size and formatting, the possibility to include external files,
and optional language-sensitive pretty-printing.
While the ivoa class
requires the package as of version 1.1 (and hence you can use the
\texword{lstlisting} environment without an explicit
\texword{usepackage} declaration), you will usually want to configure
the package in the document preamble (i.e., before its
\verb|\begin{document}|), perhaps like this:
\begin{lstlisting}
\lstloadlanguages{XML,sh}
\lstset{flexiblecolumns=true,tagstyle=\ttfamily,
showstringspaces=False}
\end{lstlisting}
Additional
languages supported that are likely relevant in a VO context include C,
fortran, python, SQL, and java, specified as above case-insensitively.
The setup in the example (flexible columns, tags in
typewriter, no explicit blanks even in strings)
produces reasonably pleasant output for a wide range of languages.
Actual listings are obtained with code like
\begin{verbatim}
\begin{lstlisting}[language=XML]
<example id="empty"/>
\end{lstlisting}
\end{verbatim}
Alternatively, entire files can be included like this:
\begin{verbatim}
\lstinputlisting[language=XSLT]{makeutypes.xslt}
\end{verbatim}
In the PDF rendering, the listings are pretty-printed
according to the value of the \verb|language| parameter if one is supplied.
This can aid comprehension, but in some cases the syntax-sensitive
processing can end up formatting the content in
unhelpful or distracting ways,
so authors should decide whether to supply a language value
or not, in which case output is simply \verb|monospaced|.
In the HTML rendering no pretty-printing is attempted in any case,
and the content is, currently, simply included in \xmlel{pre} elements.
If a more compact rendering of listings is desired, for instance,
because larger portions of source code are required in the document,
listings' \texword{basic\-style} option should be used together with one
of LaTeX standard size macros. This could be in the argument of
\texword{lstset} in the preamble for a global setting, or on a
case-by-case basis as in
\lstinputlisting[language=tex]{verbatimstyles.tex}
As of version 1.2 of \ivoatex, only \texword{footnotesize} is actually
formatted by the CSS embedded in the HTML document, and we believe
listings should not be much smaller than that anyway. As the options
are translated into CSS classes, it is fairly easy to add further
formatting functionality on a document-by-document basis, though.
\subsection{References and Bibliography}
\subsubsection{Built-in Bibliographies}
\ivoatex\ documents should use natbib and \BibTeX\ to manage references.
The package comes with two default bibliographies:
\begin{itemize}
\item \texttt{ivoatex/ivoabib.bib} containing records for many publications
likely to be cited by IVOA documents. Feel free to add further records
if they might reasonably be cited by other IVOA documents.
\item\texttt{ivoatex/docrepo.bib} containing records for IVOA documents
listed in ADS, i.e., recommendations, endorsed notes, and a selection of
other notes.
\end{itemize}
Without latexmk, changes to the document that
introduce new references or changes to the
bibliography require that \texttt{make biblio} is run before changes
become visible.
\ivoatex\ comes with a bibliography style of its own, derived from
\texttt{agsm.bst}. The custom bibliography style was derived to
optimise some types of sources uncommon outside of the VO community, in
particular IVOA recommendations and notes. Users are welcome to improve
\texttt{ivoatex/ivoa.bst}.
\subsubsection{Citation Style}
\label{sect:citation}
As usual in natbib, actual references are made through either writing
\verb|\citep{tag}|, yielding a form like ``(Einstein 1905)'',
or \verb|\citet{tag}|, yielding a form like ``Einstein (1905)''.
\ivoatex\ does not support variant forms of citep and citet (i.e., those
with optional arguments) yet; they will work in PDF output but fail in
HTML. Contributions to improve this are welcome.
To reference an IVOA recommendation, locate its bibcode either using ADS
or directly within \texttt{ivoatex/docrepo.bib} and then use one of the
cite macros. The preferred style is to introduce a short name for the
standard once with a citation and then use that short name in the
remainder of the document to have expressive texts not overciting. For
instance,
\begin{lstlisting}
IVOA Identifiers \citep{2016ivoa.spec.0523D} introduces URIs to
reference Registry records, which are typically transmitted in
VOResource \citep{2018ivoa.spec.0625P} format. Both VOResource
and IVOA Identifiers are based on various W3C standards.
\end{lstlisting}
will come out as
\begin{quotation}
IVOA Identifiers \citep{2016ivoa.spec.0523D} introduces URIs to
reference Registry records, which are typically transmitted in
VOResource \citep{2018ivoa.spec.0625P} format. Both VOResource and IVOA
Identifiers are based on W3C standards.
\end{quotation}
Recommendations should generally be cited in the last version available
at the time of writing\footnote{If a published recommendation is missing
in the bibliography, this can be fixed by cd-ing into the ivoatex folder
and saying \texttt{make docrepo.bib}.}. If works in progress (Working
Drafts, Proposed Recommendations) are to be cited, authors should create
a local bibliography (see below).
As part of bibliography management, authors should occasonally run
\begin{lstlisting}
make bib-suggestions
\end{lstlisting}
This will suggest updates to what IVOA standards the document cites
based on which documents obsoleted which other documents. Note that
these suggestions should not be followed where references actually are
version-sharp.
\subsubsection{Local Bibliographies}
When a reference is really only relevant to a single document or is
conceptually non-permanent -- this, in particular, pertains to Working
Drafts or Proposed Recommendations to be cited --, it should be kept in a
local bibliography. To instruct \LaTeX{} to use the references there,
the declaration at the foot of the document needs to be
changed to
\begin{lstlisting}
\bibliography{ivoatex/ivoabib,ivoatex/docrepo,localrefs}
\end{lstlisting}
Then a file \texttt{localrefs.bib} is created and checked into the
version control repository. An example \BibTeX\ record for an
in-progress document is
\begin{lstlisting}
@Misc{wd:Datalink,
author={Patrick Dowler and Francois Bonnarel and
Laurent Michel and Tom Donaldson and David Languignon},
editor={Patrick Dowler},
howpublished={{IVOA Working Draft 22 October 2013}},
title={DataLink},
year=2013,
url={http://ivoa.net/documents/DataLink/20131022/}
}
\end{lstlisting}
Note that \emph{howpublished} contains the precise document date and the
\emph{url} points to the actual versioned landing page, not the generic
one for the standard.
Also note that while the PDF pipeline will happily let you use
bibliography labels containing ampersands (e.g.,
\verb|2015A&A...574A..36R|), these will currently not be properly
escaped in HTML output. Hence, always replace the ampersand with a plus
in order to obtain less fragile labels.
\subsection{Graphics}
\subsubsection{Bitmap Graphics}
\ivoatex\ supports all bitmap graphics formats that pdflatex supports.
In practice, authors are encouraged to restrict themselves to JPEG, PNG,
and possibly GIF. Currently, identical images are used for both PDF and
HTML renderings. The recommended pattern for figures is
\begin{lstlisting}[language=tex]
\begin{figure}[th]
\begin{center}
\includegraphics[width=0.9\textwidth]{mydiagram.png}
\end{center}
\caption{A diagram of what this is about.}
\label{fig:mydiag}
\end{figure}
\end{lstlisting}
This gives \LaTeX\ some leeway in placing the figure, defines the image
size in units of the page width, and centres the image itself.
All bitmap graphics in a document must be listed in the makefile's
\texttt{FIGURES} variable. If they are not, the HTML rendering will be
broken.
\subsubsection{Vector Graphics}
\label{sect:vectorgraphics}
Without major hacking to produce suitable output in both HTML and PDF,
vector graphics in ivoatex must be in either PDF or TikZ. Since ivoatex
internally uses SVG for the architecture diagram, it would be
easy to extend it to support SVG, but this has not been done yet.
PDF files can be directly used in \texword{includegraphics}. The names of
such figures must be then be listed in the makefile's \texttt{VECTORFIGURES}
variable.
From \texttt{VECTORFIGURES}, \ivoatex\ arranges that, when a PDF figure
\texttt{foo.pdf} is used, the HTML target depends on a file called
\texttt{foo.png}\footnote{So, yes, at this point PDFs are shown as
bitmaps in the HTML. In the PDF output, they remain vectors, though.}.
This PNG will usually be generated automatically by
\ivoatex\ using a combination of ghostscript and ImageMagick. It may
sometimes be preferable to perform a custom conversion by hand (e.g.,
more compact representation with bilevel source images), in which case
the pre-rendered PNG must be included in the version controlled
repository. This also
has the advantage that neither ghostscript nor ImageMagick are build
dependencies of the document.
For authoring graphics directly in \LaTeX,
TikZ\footnote{\url{https://github.com/pgf-tikz/pgf}} is a common choice.
However, because of the way \ivoatex{} produces HTML output, inline
\verb|tikzpicture|-s would only end up as replacement text in HTML. To
avoid this, in \ivoatex{} each \verb|tikzpicture| environment must sit
in a file of its own, and the extension of this file needs to be
\verb|.tikz.tex|. You can include calls to \verb|\usetikzlibrary|
in such files.
As usual for figures in \ivoatex, the name of this file should be added
to the \verb|FIGURES| Makefile variable in order to keep dependency
calculations reliable (but it is less important than with bitmap
graphics, which would be left out of packages if not listed, leading to
broken HTML renderings).
To display such a figure, write something like
\verb|\tikzfigure{some-diagram}| in the \LaTeX{} source. In the
PDF-rendering branch, this is not much more than an \verb|include|, in
HTML, this will lead to a reference to an SVG called
\verb|some-diagram.tikz.svg|. To make ivoatex build this SVG, include
that name in the \verb|VECTORFIGURES| Makefile variable.
IvoatexDoc has an example TikZ image called \verb|hello.tikz.tex|
containing this:
\lstinputlisting[language=XSLT,basicstyle=\footnotesize]{hello.tikz.tex}
\noindent and hence has in its Makefile
\begin{lstlisting}
FIGURES = hello.tikz.tex
VECTORFIGURES = hello.tikz.svg
\end{lstlisting}
In this way \verb|\tikzfigure{hello}| yields: \tikzfigure{hello}. You
will of course have the \verb|.tikz.tex| file under version control.
However, as ivoatexDoc itself does, you should not put the generated SVG
under version control unless it is paramount to avoid a pdf2svg as a
build dependency. The diffs on that SVG will be ugly, confusing, and
useless.
To develop such figures, it is probably most convenient to run
\verb|make hello.tikz.pdf| and inspect the resultin PDF.
To build HTML documents containing TikZ figures, you need to
install pdf2svg\footnote{In Debian under that name or at
\url{http://www.cityinthesky.co.uk/opensource/pdf2svg/}}.
\subsection{Tables}
In tables, rules should be used sparingly. The standard pattern for tables is
something like
\begin{lstlisting}[language=tex]
\begin{table}[th]
\begin{tabular}{p{0.35\textwidth}p{0.64\textwidth}}
\sptablerule
\textbf{Column Head}&\textbf{Another column head}\\
\sptablerule
A value & Another value\\
A value in row 2& And so on\\
\sptablerule
\caption{A sample table}
\label{table:extable}
\end{tabular}
\end{table}
\end{lstlisting}
The \texword{sptablerule} used here inserts a horizontal rule with some
extra spacing and will be rendered consistently in both PDF and HTML.
It should not, as a rule, used between table rows. It is intended
primarily to delimit the table itself as well as the the heading and the
body.
\subsection{Hyperlinks}
\label{sect:links}
While \ivoatex\ puts no restrictions on the usage of hyperref features,
the preferred way to include links in \ivoatex\ documents is to use the
\texword{url} macro, i.e., use the URL itself as the anchor text. In
this way, the link remains (to some extent) usable even if the document
is printed. The alternative two-argument \texword{href} should
generally be avoided as it fails on paper. For instance,
\begin{lstlisting}
(this is bad:) The \href{http://ivoa.net}{IVOA} has issued
\href{http://ivoa.net/documents}{many standards}.
\end{lstlisting}
would severely degrade when printed and is hence discouraged, whereas
\begin{lstlisting}
The IVOA\footnote{\url{http://ivoa.net}} has issued many
standards, all of which can be retrieved from
\url{http://ivoa.net/documents}.
\end{lstlisting}
works properly on all of \ivoatex's target media.
With non-HTTP URIs, it is recommended to use hyperref's
\texword{nolinkurl} macro (rather than an unadorned \texword{texttt} or
similar); advantages include that line breaking is better with
nolinkurl, less manual escaping is necessary, and, if desired,
such URIs can be more easily styled. An example:
\begin{lstlisting}
The value of the \xmlel{standardID} attribute will be
be \nolinkurl{ivo://ivoa.net/std/Registry#OAI-2.0}.
\end{lstlisting}