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
|
'\" p
.TH \%soelim 1 "24 January 2024" "groff 1.23.0"
.SH Name
\%soelim \- recursively interpolate source requests in
.I roff
or other text files
.
.
.\" ====================================================================
.\" Legal Terms
.\" ====================================================================
.\"
.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of
.\" a permission notice identical to this one.
.\"
.\" Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for
.\" modified versions, except that this permission notice may be
.\" included in translations approved by the Free Software Foundation
.\" instead of in the original English.
.
.
.\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
.do nr *groff_soelim_1_man_C \n[.cp]
.cp 0
.
.\" Define fallback for groff 1.23's MR macro if the system lacks it.
.nr do-fallback 0
.if !\n(.f .nr do-fallback 1 \" mandoc
.if \n(.g .if !d MR .nr do-fallback 1 \" older groff
.if !\n(.g .nr do-fallback 1 \" non-groff *roff
.if \n[do-fallback] \{\
. de MR
. ie \\n(.$=1 \
. I \%\\$1
. el \
. IR \%\\$1 (\\$2)\\$3
. .
.\}
.rr do-fallback
.\" Man pages are seldom preprocessed with pic(1).
.mso pic.tmac
.
.
.\" ====================================================================
.\" Definitions
.\" ====================================================================
.
.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
.el .ds tx TeX
.
.
.\" ====================================================================
.SH Synopsis
.\" ====================================================================
.
.SY \%soelim
.RB [ \-Crt ]
.RB [ \-I
.IR dir ]
.RI [ input-file\~ .\|.\|.]
.YS
.
.
.SY \%soelim
.B \-\-help
.YS
.
.
.SY \%soelim
.B \-v
.
.SY \%soelim
.B \-\-version
.YS
.
.
.\" ====================================================================
.SH Description
.\" ====================================================================
.
GNU
.I soelim \" GNU
is a preprocessor for the
.MR groff 7
document formatting system.
.
.I \%soelim
works as a filter to eliminate source requests in
.MR roff 7
input files;
that is,
it replaces lines of the form
.RB \[lq] .so
.IR included-file \[rq]
within each text
.I input-file
with the contents of
.IR included-file ,
recursively.
.
By default,
it writes
.B lf
requests as well to record the name and line number of each
.I input-file
and
.IR included-file ,
so that any diagnostics produced by later processing can be accurately
traced to the original input.
.
Options allow this information to be suppressed
.RB ( \-r )
or supplied in \*[tx] comments instead
.RB ( \-t ).
.
In the absence of
.I input-file
arguments,
.I \%soelim
reads the standard input stream.
.
Output is written to the standard output stream.
.
.
.PP
If the name of a
.I macro-file
contains a backslash,
use
.B \[rs]\[rs]
or
.B \[rs]e
to embed it.
.
To embed a space,
write
.RB \[lq] \[rs]\~ \[rq]
(backslash followed by a space).
.
Any other escape sequence in
.IR macro-file ,
including
.RB \[lq] \[rs][rs] \[rq],
prevents
.I \%soelim
from replacing the source request.
.
.
.PP
The dot must be at the beginning of a line and must be followed by
.RB \[lq] so \[rq]
without intervening spaces or tabs for
.I \%soelim
to handle it.
.
This convention allows source requests to be \[lq]protected\[rq] from
processing by
.IR \%soelim ,
for instance as part of macro definitions or
.RB \[lq] if \[rq]
requests.
.
.
.PP
There must also be at least one space between
.RB \[lq] so \[rq]
and its
.I macro-file
argument.
.
The
.B \-C
option overrides this requirement.
.
.
.PP
The foregoing is the limit of
.IR \%soelim 's
understanding of the
.I roff
language;
it does not,
for example,
replace the input line
.
.RS
.EX
\&.if 1 .so otherfile
.EE
.RE
.
with the contents of
.IR otherfile .
.
With its
.B \-r
option,
therefore,
.I \%soelim
can be used to process text files in general,
to flatten a tree of input documents.
.
.
.PP
.I soelim \" generic
was designed to handle situations where the target of a
.I roff \" generic
source request requires a preprocessor such as
.MR \%eqn 1 ,
.MR \%pic 1 ,
.MR \%refer 1 ,
or
.MR \%tbl 1 .
.
The usual processing sequence of
.MR groff 1
is as follows.
.
.\" Does this groff installation use a command prefix? In installed
.\" pages, this comparison will not look like it needs to be dynamically
.\" decided.
.\"
.\" This is done so that the box sizes (in the pic(1) diagram) and arrow
.\" alignments (in the text alternative) can remain fixed.
.if !'\%'\%' \{\
In the diagrams below,
the traditional names for
.I soelim
and
.I troff
are used;
on this system,
the GNU versions are installed as
.I \%soelim
and
.IR \%troff .
.\}
.
.
.PP
.ie t \{\
.PS
.ps 10
.vs 12
box invisible width 0.5 height 0.4 "input" "file";
move to last box .bottom;
down;
arrow 0.3;
box invisible width 0.8 height 0.2 "preprocessor";
move to last box .right
right;
arrow 0.3;
A: box invisible width 0.35 height 0.2 "troff";
move to last box .top;
up;
move 0.3;
box invisible width 0.6 height 0.4 "sourced" "file";
line <- up 0.3 from A.top;
move to A.right;
right;
arrow 0.3;
box invisible width 0.85 height 0.2 "postprocessor";
move to last box .bottom;
down;
arrow 0.3;
box invisible width 0.5 height 0.4 "output" "file"
.ps
.vs
.PE
.\}
.el \{\
.EX
input sourced
file file
\[bv] \[bv]
\[da] \[da]
preprocessor \[an]\[->] troff \[an]\[->] postprocessor
\[bv]
\[da]
output
file
.EE
.\}
.PP
That is,
files sourced with
.RB \[lq] so \[rq]
are normally read
.I only
by the formatter,
.IR \%troff .
.
.I \%soelim
is
.I not
required for
.I \%troff
to source files.
.
.
.PP
If a file to be sourced should also be preprocessed,
it must already be read
.I before
the input file passes through the preprocessor.
.
.IR \%soelim ,
normally invoked via
.IR groff 's
.B \-s
option,
handles this.
.
.
.PP
.ie t \{\
.PS
.ps 10
.vs 12
box invisible width 0.5 height 0.4 "input" "file";
move to last box .bottom;
down;
arrow 0.3;
A: box invisible width 0.5 height 0.2 "soelim";
line <- 0.3;
box invisible width 0.5 height 0.4 "sourced" "file";
move to A.right;
right;
arrow 0.3;
box invisible width 0.8 height 0.2 "preprocessor";
arrow 0.3;
box invisible width 0.35 height 0.2 "troff";
arrow 0.3
box invisible width 0.85 height 0.2 "postprocessor";
move to last box .bottom;
down;
arrow 0.3;
box invisible width 0.5 height 0.4 "output" "file"
.ps
.vs
.PE
.\}
.el \{\
.EX
input
file
\[bv]
\[da]
soelim \[an]\[->] preprocessor \[an]\[->] troff \[an]\[->] \
postprocessor
\[ua] \[bv]
\[bv] \[da]
sourced output
file file
.EE
.\}
.
.
.\" ====================================================================
.SH Options
.\" ====================================================================
.
.B \-\-help
displays a usage message,
while
.B \-v
and
.B \-\-version
show version information;
all exit afterward.
.
.
.TP
.B \-C
Recognize an input line starting with
.B .so
even if a character other than a space or newline follows.
.
.TP
.BI \-I\~ dir
Search the directory
.I dir
path for
.I input-
and
.I included-files.
.
.B \-I
may be specified more than once;
each
.I dir
is searched in the given order.
.
To search the current working directory before others,
add
.RB \[lq] "\-I .\&" \[rq]
at the desired place;
it is otherwise searched last.
.
.
.TP
.B \-r
Write files \[lq]raw\[rq];
do not add
.B lf
requests.
.
.
.TP
.B \-t
Emit \*[tx] comment lines starting with
.RB \[lq] % \[rq]
indicating the current file and line number,
rather than
.B lf
requests for the same purpose.
.
.
.PP
If both
.B \-r
and
.B \-t
are given,
the last one specified controls.
.
.
.\" ====================================================================
.SH "See also"
.\" ====================================================================
.
.MR groff 1
.
.
.\" Clean up.
.rm tx
.
.\" Restore compatibility mode (for, e.g., Solaris 10/11).
.cp \n[*groff_soelim_1_man_C]
.do rr *groff_soelim_1_man_C
.
.
.\" Local Variables:
.\" fill-column: 72
.\" mode: nroff
.\" End:
.\" vim: set filetype=groff textwidth=72:
|