-
Notifications
You must be signed in to change notification settings - Fork 0
/
author1.do.txt
156 lines (138 loc) · 5.67 KB
/
author1.do.txt
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
TITLE: Test of one author at one institution
AUTHOR: John Doe Email:[email protected] at Cyberspace Inc.
DATE: today
# Externaldocument: testdoc
========= Generalized References =========
label{genrefs}
Sometimes a series of individual documents may be assembled to one
large document. The assembly impacts how references to sections
are written: when referring to a section in the same document, a label
can be used, while references to sections in other documents are
written differently, sometimes involving a link (URL) and a citation.
Especially if both the individual documents and the large assembly document
are to exist side by side, a flexible way of referencing is needed.
For this purpose, DocOnce offers *generalized references* which allows
a reference to have two different formulations, one for internal
references and one for external references. Since LaTeX supports
references to labels in external documents via the `xr` package,
the generalized references in DocOnce has a syntax that may utilize
the `xr` feature in LaTeX.
The syntax of generalized references reads
!bc
ref[internal][cite][external]
!ec
If all standard `ref` references (with curly braces)
in the text `internal` are references
to labels in the present document, the above `ref` command is replaced
by the text `internal`. Otherwise, if cite is non-empty and the format
is `latex` or `pdflatex` one assumes that the references in `internal`
are to external documents declared by a comment line `#
Externaldocuments: testdoc, mydoc` (usually after the title, authors,
and date). In this case the output text is `internal cite` and the
LaTeX package `xr` is used to handle the labels in the external documents.
When referring to a complete chapter (not a section in it), which
corresponds to a complete external document, it does not make sense
to write out `internal cite` since the `internal` reference is a
chapter number. In such cases, the `refch[internal][cite][external]` syntax can be used,
and if the label is in another LaTeX document, the output is just `cite`.
For all
output formats other than `latex` and `pdflatex`, the `external`
text will be the output.
Here is an example on a specific generalized reference to a section
in a document:
!bc
As explained in
ref[Section ref{subsec:ex}][in "Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex"
cite{testdoc:12}][a "section":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex" in
the document "A Document for Testing DocOnce":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}], DocOnce documents may include tables.
!ec
With `latex` or `pdflatex` as output, this translates to
!bc
As explained in
Section ref{subsec:ex}, DocOnce documents may include tables.
!ec
if the label `{subsec:ex}` appears in the present DocOnce source, and
otherwise
!bc
As explained in
Section ref{subsec:ex} in "Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex"
cite{testdoc:12}, DocOnce documents may include tables.
!ec
In a format different from `latex` and `pdflatex`, the effective DocOnce
text becomes
!bc
As explained in
a "section":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex" in
the document "A Document for Testing DocOnce":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}, DocOnce documents may include tables.
!ec
The rendered text in the current format `${FORMAT}` becomes
!bquote
As explained in
ref[Section ref{subsec:ex}][in "Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex"
cite{testdoc:12}][a "section":
"https://hplgit.github.io/doconce/test/demo_testdoc.html#subsec:ex" in
the document "A Document for Testing DocOnce":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}], DocOnce documents may include tables.
!equote
A reference to an entire external document, which is usually a chapter
if the reference is internal in the DocOnce source, applies the
`refch` syntax:
!bc
As explained in
refch[Chapter ref{ch:testdoc}]["Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}][the document
"A Document for Testing DocOnce":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}], DocOnce documents may include tables.
!ec
The output now if `ch:testdoc` is not a label in the document,
becomes in the `latex` and `pdflatex` case
!bc
As explained in
"Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}, DocOnce documents may include tables.
!ec
That is, the internal reference `Chapter ...` is omitted since
it is not meaningful to refer to an external document as "Chapter".
The resulting rendered text in the current format `${FORMAT}` becomes
!bquote
As explained in
refch[Chapter ref{ch:testdoc}]["Langtangen, 2012":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}][the document
"A Document for Testing DocOnce":
"https://hplgit.github.io/doconce/test/demo_testdoc.html"
cite{testdoc:12}], DocOnce documents may include tables.
!equote
Note that LaTeX cannot
have links to local files, so a complete URL on the form
`https://...` must be used.
And here is another example with internal references only:
!bc
Generalized references are described in ref[Section ref{genrefs}][dummy1][
dummy2].
!ec
The text is rendered to
!bquote
Generalized references are described in
ref[Section ref{genrefs}][dummy1][
dummy2].
!equote
========= Test of math =========
# Here we test the chapter heading to see if latex output then has
# book style rather than article style.
Inline math, $a=b$, is the only math in this document.
# Need BIBFILE because of cite{} examples
BIBFILE: papers.pub