Skip to content

Commit 21e1fc0

Browse files
committed
Added paragraph numbering
Also added newlines at the ends of files.
1 parent 69bae82 commit 21e1fc0

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
*.out
1616
*.pdf
1717
*.synctex.gz
18-
*.toc
18+
*.toc

README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ This is the source for the CPLEX document "Extensions for parallel programming".
22

33
The document can be generated using the following command:
44

5-
latexmk -pdf -silent cplexts
5+
latexmk -pdf -silent cplexts

countable.tex

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
\clause{Counted loops}
22
\sclause{Introduction}
3+
\pnum
34
A
45
\defn{counted loop}
56
is a
@@ -15,6 +16,7 @@
1516
the loop's iteration count can be computed
1617
before the loop body is executed.
1718

19+
\pnum
1820
There shall be no
1921
\tcode{return},
2022
\tcode{break},
@@ -25,6 +27,8 @@
2527

2628
\sclause{Constraints on a counted \tcode{for} statement}
2729
\ssclause{Introduction}
30+
31+
\pnum
2832
The syntax of a
2933
\tcode{for}
3034
statement includes three
@@ -36,12 +40,14 @@
3640
the third is called the
3741
\defn{loop-increment}.
3842

43+
\pnum
3944
When a constraint limits the form of an expression,
4045
parentheses are allowed around the expression
4146
or any required subexpression.
4247

4348
\ssclause{Constraints on the form of the control clauses}
4449

50+
\pnum
4551
\begin{cpp}
4652
The
4753
\nonterminal{condition}
@@ -55,6 +61,7 @@
5561
\end{note}
5662
\end{cpp}
5763

64+
\pnum
5865
The controlling expression shall be a comparison expression
5966
with one of the following forms:%
6067
\footnote{DFEP:
@@ -75,6 +82,7 @@
7582
equality-expression \terminal{!=} relational-expression
7683
\end{bnf}
7784

85+
\pnum
7886
Exactly one of the operands of the comparison operator
7987
shall be an identifier designating an induction variable,
8088
as described below.
@@ -87,6 +95,7 @@
8795
part of the limit expression.
8896
\end{cpp}
8997

98+
\pnum
9099
The loop-increment shall be an expression with the following form:%
91100
\footnote{DFEP:
92101
OpenMP and ``classic'' Cilk allow only a single induction variable:
@@ -124,6 +133,7 @@
124133
identifier \terminal{=} additive-expression \terminal{+} identifier
125134
\end{bnf}
126135

136+
\pnum
127137
\begin{cpp}
128138
Each comma in the grammar of loop-increment shall represent
129139
a use of the built-in comma operator.
@@ -144,6 +154,7 @@
144154
\defn{stride expression}
145155
for that induction variable.
146156

157+
\pnum
147158
An induction variable shall not be designated by more than one
148159
\grammarterm{single-increment}.
149160

@@ -169,6 +180,7 @@
169180

170181
\ssclause{Other statically checkable constraints}
171182

183+
\pnum
172184
Each induction variable shall have unqualified integral%
173185
\yescpp{,}
174186
\begin{cpp}
@@ -178,6 +190,7 @@
178190
or pointer type,
179191
and shall have automatic storage duration.
180192

193+
\pnum
181194
Each stride expression shall have integral
182195
\begin{cpp}
183196
or enumeration
@@ -356,6 +369,7 @@
356369
\end{tabular}
357370
\end{table}
358371

372+
\pnum
359373
The
360374
\defn{iteration count}
361375
is computed according to
@@ -369,6 +383,7 @@
369383
The iteration count expression shall be well-formed.
370384
\end{cpp}
371385

386+
\pnum
372387
The type of the difference between the limit expression and the control variable
373388
is the
374389
\defn{subtraction type}\nocpp{.}%
@@ -406,6 +421,7 @@
406421
\end{tabular}
407422
\end{table}
408423

424+
\pnum
409425
For each induction variable
410426
$V$,
411427
one of the expressions from
@@ -424,6 +440,7 @@
424440

425441
\ssclause{Dynamic constraints}
426442

443+
\pnum
427444
If an induction variable is modified within the loop
428445
other than as the side effect of its single-increment operation,
429446
the behavior of the program is undefined.%
@@ -439,6 +456,7 @@
439456
the behavior of the program is undefined.
440457
\end{cpp}
441458

459+
\pnum
442460
If $X$ and $Y$ are values of the control variable
443461
that occur in consecutive evaluations of the loop condition
444462
in the serialization,%
@@ -456,6 +474,7 @@
456474
Unsigned wraparound is not allowed.
457475
\end{note}
458476

477+
\pnum
459478
If the condition expression is true on entry to the loop,
460479
then the behavior is undefined
461480
if the computed iteration count is not greater than zero.
@@ -466,6 +485,7 @@
466485

467486
\ssclause{Evaluation relaxations}
468487

488+
\pnum
469489
The stride expressions shall not be evaluated if the iteration count is zero;
470490
otherwise,
471491
the stride and limit expressions are evaluated exactly once.%
@@ -477,6 +497,7 @@
477497
%of the increment or limit expression,
478498
%the behavior is undefined.
479499

500+
\pnum
480501
Within each iteration of the loop body,
481502
the name of each induction variable refers to a local object,
482503
as if the name were declared as an object within the body of the loop,
@@ -489,6 +510,7 @@
489510

490511
\begin{cpp}
491512
\sclause{Constraints on a counted range-based \tcode{for} statement}
513+
\pnum
492514
In a counted range-based
493515
\tcode{for}
494516
statement ([stmt.ranged] 6.5.4),
@@ -504,4 +526,4 @@
504526
\tcode{for}
505527
statement.
506528
\end{note}
507-
\end{cpp}
529+
\end{cpp}

cplexmac.tex

+12
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@
1010
\newcommand{\nocpp}[1]{}
1111
\newcommand{\yescpp}[1]{#1}
1212
}
13+
%% Paragraph numbering
14+
\newcounter{Paras}
15+
\counterwithin{Paras}{clause}
16+
\counterwithin{Paras}{sclause}
17+
\counterwithin{Paras}{ssclause}
18+
\counterwithin{Paras}{sssclause}
19+
\counterwithin{Paras}{ssssclause}
20+
\counterwithin{Paras}{sssssclause}
21+
\makeatletter
22+
\def\pnum{\addtocounter{Paras}{1}\noindent\llap{{%
23+
\scriptsize\raisebox{.7ex}{\arabic{Paras}}}\hspace{\@totalleftmargin}\quad}}
24+
\makeatother

cplexts.tex

+7-10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
linkcolor=blue, % usual default for browsers
1818
urlcolor=blue
1919
]{hyperref} % for PDF hyperlinks and bookmarks
20+
\usepackage{chngcntr} % for paragraph numbering
2021
\usepackage{color} % for editorial marking
2122
\usepackage{ifthen} % for conditional code/text
2223
\usepackage{listings} % for code listings
@@ -42,7 +43,7 @@
4243
% These parameters, and the documentclass options,
4344
% are about document identification and overall formatting.
4445
\newcommand{\cplexts}{$CPLEXTS$}
45-
\renewcommand{\extrahead}{2014-02-05}
46+
\renewcommand{\extrahead}{2014-03-06}
4647
\standard{\cplexts}
4748
\yearofedition{2016}
4849
\languageofedition{(E)}
@@ -105,12 +106,14 @@
105106

106107
\clause{Document conventions}
107108

109+
\pnum
108110
\begin{cpp}
109111
Text that is specific to C++
110112
is enclosed in square brackets
111113
and presented in oblique sans-serif type.
112114
\end{cpp}
113115

116+
\pnum
114117
Definitions of terms and grammar non-terminals defined in the C
115118
\begin{cpp}
116119
or C++
@@ -119,6 +122,7 @@
119122
Terms and grammar non-terminals defined in this document
120123
are referenced in the index.
121124

125+
\pnum
122126
According to the ISO editing directives,
123127
the use of footnotes
124128
``shall be kept to a minimum.''
@@ -133,18 +137,11 @@
133137
Departure from existing practice.
134138
\end{description}
135139

140+
\pnum
136141
Annex A contains information
137142
concerning the editing of the LaTeX source of this document.
138143
It will not survive to final publication.
139144

140-
Despite the examples of the C and C++ standards,
141-
the ISO editing directives state quite clearly
142-
that paragraphs should not be numbered.
143-
(``A paragraph is an unnumbered subdivision of a clause or subclause.'')
144-
Consequently, the LaTeX document class used for this document,
145-
which is specifically intended for ISO documents,
146-
does not support paragraph numbering.
147-
148145
\include{countable}
149146

150147
\include{samples}
@@ -161,4 +158,4 @@
161158
\end{references}
162159

163160
\printindex
164-
\end{document}
161+
\end{document}

0 commit comments

Comments
 (0)