Skip to content

Commit 8ce8876

Browse files
committed
VADE: fix tex translation
1 parent d0df82d commit 8ce8876

File tree

3 files changed

+83
-73
lines changed

3 files changed

+83
-73
lines changed

_build/pages/vade_syntax.markdown

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ Source Code Format
1010
Here you learn about the basics of BASIC, so to speak. This chapter deals with the way a SmallBASIC program composed.
1111

1212
A program consists of a single source file. It is possible to include
13-
libraries from external source files with the Unit-mechanism (see ).
13+
libraries from external source files with the Unit-mechanism.
1414

1515
Source files are simple text files. They can be written in **ASCII** or **UTF-8**.
1616

17-
The basic program component is a line of text, ending with or characters.[^1]
17+
The basic program component is a line of text, ending with ~CR~ or ~LF/CR~ characters.[^1]
1818

19-
SmallBASIC is **case-insensitive**: The names and will always refer to the same
20-
variable or function. Likewise, keywords are case-insensitive: Both and
21-
are legal variants of the same command.
19+
SmallBASIC is **case-insensitive**: The names `myvar` and `MyVar` will always refer to the same variable or function.
20+
Likewise, keywords are case-insensitive: Both `print` and `PRINT` are legal variants of the same command.
2221

2322
**Whitespace** -- i.e., non-printing characters like spaces and tabs --
2423
is ignored in SmallBASIC, except inside string literals where it is retained. [^2]
@@ -32,20 +31,21 @@ the above line were abbreviated to
3231

3332
fora=0to10
3433

35-
this would cause an error, because and wouldn't be recognized as
36-
keywords anymore. Rather, SmallBASIC would consider and to be variable names.[^3]
34+
this would cause an error, because `for` and `to` wouldn't
35+
be recognized as keywords anymore. Rather, SmallBASIC would consider
36+
`fora` and `to10` to be variable names.[^3]
3737

3838
Each program line contains one or more commands. Multiple commands on a
39-
line are **separated by a colon**.
39+
line are **separated by a colon** ~:~.
4040

4141
print "Hello world!"
4242
print "Wonderful day."
4343

4444
print "Hello world!" : print "Wonderful day."
4545

46-
**Line continuation**: If the ampersand is the last character on a line,
47-
then the interpreter will assume that the current command extends to the
48-
next line as well.
46+
**Line continuation**: If the ampersand ~&~ is the last character
47+
on a line, then the interpreter will assume that the current command
48+
extends to the next line as well.
4949

5050
X = 245 * 198 - sqr(5)
5151

@@ -59,21 +59,21 @@ Numbers
5959
-------
6060

6161
Numbers can be written in the usual manner, using either
62-
»conventional« or scientific notation. All of the following
62+
`conventional~ or scientific notation. All of the following
6363
examples are legal numbers in:
6464

6565
1, 0, -1, 1.2, -23232.5, 1.902e-50, -.423
6666

67-
As is shown in the last example, numbers with an absolute value `<1` need not be preceded with `0`.
67+
As is shown in the last example, numbers with an absolute value ~<\1~ need not be preceded with ~0~.
6868

6969
Integer numbers can also be represented in hexadecimal, octal and binary
7070
notation with various prefixes:
7171

72-
**hexadecimal**: `&h, 0h, &x, or 0x`
72+
**hexadecimal**: ~&h~, ~0h~, ~&x~, or ~0x~
7373

74-
**octal**: `&o or 0o`
74+
**octal**: ~&o~ or ~0o~
7575

76-
**binary**: `&b or 0b`
76+
**binary**: ~&b~ (or ~0b~)
7777

7878
&hAFFE0815, &o4242, &b100101011
7979
0hAFFE0815, 0o4242, 0b100101011
@@ -82,15 +82,16 @@ String literals
8282
---------------
8383

8484
String literals are character sequences which are to be treated as
85-
program data &raquo;as is&laquo;, not as variable or keyword names. String
86-
literals are bracketed by double quotes.
85+
program data ~as is~, not as variable or keyword names. String
86+
literals are bracketed by double quotes ~\"~.
8787

8888
"This is a string literal"
8989
this will be considered as a sequence of keywords
9090

9191
Note that when a string literal is to be extended across more than one
9292
line, it must be properly closed before the continuation ampersand and
93-
re-opened on the subsequent line with the delimiter character:
93+
re-opened on the subsequent line with the ~\"~ delimiter
94+
character:
9495

9596
print "Hello &
9697
world!" ' error
@@ -101,56 +102,55 @@ re-opened on the subsequent line with the delimiter character:
101102
Identifiers
102103
===========
103104

104-
Identifiers -- &raquo;names&laquo; for variables and functions -- follow the
105+
Identifiers -- ~names~ for variables and functions -- follow the
105106
usual conventions:
106107

107-
They consist of a letter or an underscore , followed by one or more of
108-
the following:
108+
They consist of a letter or an underscore ~\_~, followed by one or
109+
more of the following:
109110

110111
- other letters
111112

112-
- digits ( -- )
113+
- digits (~0~ -- ~9~)
113114

114-
- the underscore
115+
- the underscore ~\_~
115116

116-
- the dollar sign (only as the last character of the identifier, see
117-
below)
117+
- the dollar sign ~\$~ (only as the last character of the
118+
identifier, see below)
118119

119-
A single underscore is a legal complete identifier.
120+
A single underscore ~\_~ is a legal complete identifier.
120121

121122
Identifiers can have virtually unlimited length. All characters are
122123
significant in resolving an identifier (ie, to determine whether two
123124
identifiers refer to the same variable.)[^4]
124125

125-
Traditionally, in BASIC the **dollar sign** serves as a signal to
126+
Traditionally, in BASIC the **dollar sign** `$` serves as a signal to
126127
indicate that a name identifies a string variable, if used as the last
127128
character of the identifier (i.e., `my_name$`).
128129

129130
Since SmallBASIC is a typeless language (see below) where variables can hold
130131
values of any type, such a signal would be misleading, yet it has been
131132
retained for the sake of compatibility. It may be placed as the last
132133
character of an identifier only. Here it serves two distinguish between
133-
identifiers ( and are two different identifiers), but has otherwise no
134+
identifiers (`harry` and `harry$` are two different identifiers), but has otherwise no
134135
function.
135136

136137
Comments
137138
========
138139

139140
**Line comments** can be introduced in three ways:
140141

141-
- With the keyword,
142+
- With the keyword `rem`,
142143

143-
- With the apostrophe character,
144+
- With the apostrophe character ~'~,
144145

145-
- With a hash sign.
146+
- With a hash sign ~\#~.
146147

147148
Everything on the current line following the comment introduction will
148149
be ignored in program execution.
149150

150-
If the keyword is used and it is preceded by other commands on the
151-
current line, it must be separated from the previous commands by a colon
151+
If the `rem` keyword is used and it is preceded by other commands on the
152+
current line, it must be separated from the previous commands by a colon ~:~
152153
If the hash sign is used, it must be the first character on the line.
153-
(See also the use of a hash sign in &raquo;shebanging&laquo; a script, )
154154

155155
for a=0 to 10 ' this is a valid comment
156156
print a : rem this also
@@ -160,8 +160,8 @@ If the hash sign is used, it must be the first character on the line.
160160

161161
print "Hello world!" rem vain commenting attempt
162162

163-
The in the last line above will cause an error, because it needs to be
164-
preceded with a colon .
163+
The `rem` in the last line above will cause an error, because it
164+
needs to be preceded with a colon ~:~.
165165

166166
There are no provision for **block comments**.
167167

@@ -171,13 +171,13 @@ There are no provision for **block comments**.
171171

172172
[^2]: All listings in the vademecum follow the same convention and show
173173
the source code as you would have typed it in in the IDE. If a line
174-
in the listing begins with a greater-than sign , this indicates a
175-
response of the program printed on your screen.
174+
in the listing begins with a greater-than sign ~\>~, this
175+
indicates a response of the program printed on your screen.
176176

177177
[^3]: As a rule of thumb, it's advisable to always leave spaces around
178178
keywords.
179179

180180
[^4]: This is in contrast to many older BASICs. The *Commodore BASIC*
181181
shipped with the honourable C64, for example, allowed identifiers of
182182
arbitrary length, but used only the first two letters for
183-
resolution: and were considered to refer to the same variable.
183+
resolution: `hoogla` and `hooray` were considered to refer to the same variable.

css/style.css

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,14 @@ small {
4848
font-size: 80%;
4949
}
5050
sub,sup {
51-
font-size: 75%;
5251
line-height: 0;
5352
position: relative;
5453
vertical-align: baseline;
5554
}
5655
sup {
56+
font-size: 75%;
5757
top: -0.5em;
5858
}
59-
sub {
60-
bottom: -0.25em;
61-
}
6259
img {
6360
border: 0;
6461
max-width: 100%;
@@ -663,4 +660,17 @@ hr.menuSeparator {
663660
margin-top: .5em;
664661
margin-bottom: 0;
665662
margin-right: 1em;
666-
}
663+
}
664+
665+
sub {
666+
font-family: monospace, monospace;
667+
font-size: 1em;
668+
}
669+
670+
sub:before {
671+
content: "\00bb";
672+
}
673+
674+
sub:after {
675+
content: "\00ab";
676+
}

pages/vade_syntax.html

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,86 +69,86 @@ <h1 id="source-code-format">Source Code Format</h1>
6969
<p><a href="/">Home</a> &gt; <a href="/pages/vade.html">Vade</a></p>
7070
</div>
7171
<p>Here you learn about the basics of BASIC, so to speak. This chapter deals with the way a SmallBASIC program composed.</p>
72-
<p>A program consists of a single source file. It is possible to include libraries from external source files with the Unit-mechanism (see ).</p>
72+
<p>A program consists of a single source file. It is possible to include libraries from external source files with the Unit-mechanism.</p>
7373
<p>Source files are simple text files. They can be written in <strong>ASCII</strong> or <strong>UTF-8</strong>.</p>
74-
<p>The basic program component is a line of text, ending with or characters.<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></p>
75-
<p>SmallBASIC is <strong>case-insensitive</strong>: The names and will always refer to the same variable or function. Likewise, keywords are case-insensitive: Both and are legal variants of the same command.</p>
74+
<p>The basic program component is a line of text, ending with <sub>CR</sub> or <sub>LF/CR</sub> characters.<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></p>
75+
<p>SmallBASIC is <strong>case-insensitive</strong>: The names <code>myvar</code> and <code>MyVar</code> will always refer to the same variable or function. Likewise, keywords are case-insensitive: Both <code>print</code> and <code>PRINT</code> are legal variants of the same command.</p>
7676
<p><strong>Whitespace</strong> – i.e., non-printing characters like spaces and tabs – is ignored in SmallBASIC, except inside string literals where it is retained. <a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></p>
7777
<pre><code>for a = 0 to 10
7878

7979
for a=0to 10</code></pre>
8080
<p>But note that the omission of whitespace can lead to parsing errors: If the above line were abbreviated to</p>
8181
<pre><code>fora=0to10</code></pre>
82-
<p>this would cause an error, because and wouldn’t be recognized as keywords anymore. Rather, SmallBASIC would consider and to be variable names.<a href="#fn3" class="footnote-ref" id="fnref3"><sup>3</sup></a></p>
83-
<p>Each program line contains one or more commands. Multiple commands on a line are <strong>separated by a colon</strong>.</p>
82+
<p>this would cause an error, because <code>for</code> and <code>to</code> wouldn’t be recognized as keywords anymore. Rather, SmallBASIC would consider <code>fora</code> and <code>to10</code> to be variable names.<a href="#fn3" class="footnote-ref" id="fnref3"><sup>3</sup></a></p>
83+
<p>Each program line contains one or more commands. Multiple commands on a line are <strong>separated by a colon</strong> <sub>:</sub>.</p>
8484
<pre><code>print &quot;Hello world!&quot;
8585
print &quot;Wonderful day.&quot;
8686

8787
print &quot;Hello world!&quot; : print &quot;Wonderful day.&quot;</code></pre>
88-
<p><strong>Line continuation</strong>: If the ampersand is the last character on a line, then the interpreter will assume that the current command extends to the next line as well.</p>
88+
<p><strong>Line continuation</strong>: If the ampersand <sub>&amp;</sub> is the last character on a line, then the interpreter will assume that the current command extends to the next line as well.</p>
8989
<pre><code>X = 245 * 198 - sqr(5)
9090

9191
X = 245 * 198 &amp;
9292
- sqr(5)</code></pre>
9393
<h1 id="literals">Literals</h1>
9494
<h2 id="numbers">Numbers</h2>
95-
<p>Numbers can be written in the usual manner, using either »conventional« or scientific notation. All of the following examples are legal numbers in:</p>
95+
<p>Numbers can be written in the usual manner, using either `conventional~ or scientific notation. All of the following examples are legal numbers in:</p>
9696
<pre><code>1, 0, -1, 1.2, -23232.5, 1.902e-50, -.423</code></pre>
97-
<p>As is shown in the last example, numbers with an absolute value <code>&lt;1</code> need not be preceded with <code>0</code>.</p>
97+
<p>As is shown in the last example, numbers with an absolute value <sub>&lt;\1</sub> need not be preceded with <sub>0</sub>.</p>
9898
<p>Integer numbers can also be represented in hexadecimal, octal and binary notation with various prefixes:</p>
99-
<p><strong>hexadecimal</strong>: <code>&amp;h, 0h, &amp;x, or 0x</code></p>
100-
<p><strong>octal</strong>: <code>&amp;o or 0o</code></p>
101-
<p><strong>binary</strong>: <code>&amp;b or 0b</code></p>
99+
<p><strong>hexadecimal</strong>: <sub>&amp;h</sub>, <sub>0h</sub>, <sub>&amp;x</sub>, or <sub>0x</sub></p>
100+
<p><strong>octal</strong>: <sub>&amp;o</sub> or <sub>0o</sub></p>
101+
<p><strong>binary</strong>: <sub>&amp;b</sub> (or <sub>0b</sub>)</p>
102102
<pre><code>&amp;hAFFE0815, &amp;o4242, &amp;b100101011
103103
0hAFFE0815, 0o4242, 0b100101011</code></pre>
104104
<h2 id="string-literals">String literals</h2>
105-
<p>String literals are character sequences which are to be treated as program data »as is«, not as variable or keyword names. String literals are bracketed by double quotes.</p>
105+
<p>String literals are character sequences which are to be treated as program data ~as is~, not as variable or keyword names. String literals are bracketed by double quotes <sub>&quot;</sub>.</p>
106106
<pre><code>&quot;This is a string literal&quot;
107107
this will be considered as a sequence of keywords</code></pre>
108-
<p>Note that when a string literal is to be extended across more than one line, it must be properly closed before the continuation ampersand and re-opened on the subsequent line with the delimiter character:</p>
108+
<p>Note that when a string literal is to be extended across more than one line, it must be properly closed before the continuation ampersand and re-opened on the subsequent line with the <sub>&quot;</sub> delimiter character:</p>
109109
<pre><code>print &quot;Hello &amp;
110110
world!&quot; &#39; error
111111

112112
print &quot;Hello &quot; &amp;
113113
&quot;world!&quot; &#39; correct</code></pre>
114114
<h1 id="identifiers">Identifiers</h1>
115-
<p>Identifiers – »names« for variables and functions – follow the usual conventions:</p>
116-
<p>They consist of a letter or an underscore , followed by one or more of the following:</p>
115+
<p>Identifiers – <sub>names</sub> for variables and functions – follow the usual conventions:</p>
116+
<p>They consist of a letter or an underscore <sub>_</sub>, followed by one or more of the following:</p>
117117
<ul>
118118
<li><p>other letters</p></li>
119-
<li><p>digits ( – )</p></li>
120-
<li><p>the underscore</p></li>
121-
<li><p>the dollar sign (only as the last character of the identifier, see below)</p></li>
119+
<li><p>digits (<sub>0</sub><sub>9</sub>)</p></li>
120+
<li><p>the underscore <sub>_</sub></p></li>
121+
<li><p>the dollar sign <sub>$</sub> (only as the last character of the identifier, see below)</p></li>
122122
</ul>
123-
<p>A single underscore is a legal complete identifier.</p>
123+
<p>A single underscore <sub>_</sub> is a legal complete identifier.</p>
124124
<p>Identifiers can have virtually unlimited length. All characters are significant in resolving an identifier (ie, to determine whether two identifiers refer to the same variable.)<a href="#fn4" class="footnote-ref" id="fnref4"><sup>4</sup></a></p>
125-
<p>Traditionally, in BASIC the <strong>dollar sign</strong> serves as a signal to indicate that a name identifies a string variable, if used as the last character of the identifier (i.e., <code>my_name$</code>).</p>
126-
<p>Since SmallBASIC is a typeless language (see below) where variables can hold values of any type, such a signal would be misleading, yet it has been retained for the sake of compatibility. It may be placed as the last character of an identifier only. Here it serves two distinguish between identifiers ( and are two different identifiers), but has otherwise no function.</p>
125+
<p>Traditionally, in BASIC the <strong>dollar sign</strong> <code>$</code> serves as a signal to indicate that a name identifies a string variable, if used as the last character of the identifier (i.e., <code>my_name$</code>).</p>
126+
<p>Since SmallBASIC is a typeless language (see below) where variables can hold values of any type, such a signal would be misleading, yet it has been retained for the sake of compatibility. It may be placed as the last character of an identifier only. Here it serves two distinguish between identifiers (<code>harry</code> and <code>harry$</code> are two different identifiers), but has otherwise no function.</p>
127127
<h1 id="comments">Comments</h1>
128128
<p><strong>Line comments</strong> can be introduced in three ways:</p>
129129
<ul>
130-
<li><p>With the keyword,</p></li>
131-
<li><p>With the apostrophe character,</p></li>
132-
<li><p>With a hash sign.</p></li>
130+
<li><p>With the keyword <code>rem</code>,</p></li>
131+
<li><p>With the apostrophe character <sub></sub>,</p></li>
132+
<li><p>With a hash sign <sub>#</sub>.</p></li>
133133
</ul>
134134
<p>Everything on the current line following the comment introduction will be ignored in program execution.</p>
135-
<p>If the keyword is used and it is preceded by other commands on the current line, it must be separated from the previous commands by a colon If the hash sign is used, it must be the first character on the line. (See also the use of a hash sign in »shebanging« a script, )</p>
135+
<p>If the <code>rem</code> keyword is used and it is preceded by other commands on the current line, it must be separated from the previous commands by a colon <sub>:</sub> If the hash sign is used, it must be the first character on the line.</p>
136136
<pre><code>for a=0 to 10 &#39; this is a valid comment
137137
print a : rem this also
138138
# this is a whole line commented out
139139
next a
140140
rem the last comment
141141

142142
print &quot;Hello world!&quot; rem vain commenting attempt</code></pre>
143-
<p>The in the last line above will cause an error, because it needs to be preceded with a colon .</p>
143+
<p>The <code>rem</code> in the last line above will cause an error, because it needs to be preceded with a colon <sub>:</sub>.</p>
144144
<p>There are no provision for <strong>block comments</strong>.</p>
145145
<section class="footnotes">
146146
<hr />
147147
<ol>
148148
<li id="fn1"><p>Don’t worry about this, your operating system will handle it right. It may only every be an issue if you use source files written in one OS and then transferred to a different one.<a href="#fnref1" class="footnote-back"></a></p></li>
149-
<li id="fn2"><p>All listings in the vademecum follow the same convention and show the source code as you would have typed it in in the IDE. If a line in the listing begins with a greater-than sign , this indicates a response of the program printed on your screen.<a href="#fnref2" class="footnote-back"></a></p></li>
149+
<li id="fn2"><p>All listings in the vademecum follow the same convention and show the source code as you would have typed it in in the IDE. If a line in the listing begins with a greater-than sign <sub>&gt;</sub>, this indicates a response of the program printed on your screen.<a href="#fnref2" class="footnote-back"></a></p></li>
150150
<li id="fn3"><p>As a rule of thumb, it’s advisable to always leave spaces around keywords.<a href="#fnref3" class="footnote-back"></a></p></li>
151-
<li id="fn4"><p>This is in contrast to many older BASICs. The <em>Commodore BASIC</em> shipped with the honourable C64, for example, allowed identifiers of arbitrary length, but used only the first two letters for resolution: and were considered to refer to the same variable.<a href="#fnref4" class="footnote-back"></a></p></li>
151+
<li id="fn4"><p>This is in contrast to many older BASICs. The <em>Commodore BASIC</em> shipped with the honourable C64, for example, allowed identifiers of arbitrary length, but used only the first two letters for resolution: <code>hoogla</code> and <code>hooray</code> were considered to refer to the same variable.<a href="#fnref4" class="footnote-back"></a></p></li>
152152
</ol>
153153
</section>
154154
</div>

0 commit comments

Comments
 (0)