summaryrefslogtreecommitdiffstats
path: root/doc/groff.html.node/Input-Conventions.html
blob: 35005bddedb15759da22cb5cb93fe1892e0c0fb9 (plain)
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
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- This manual documents GNU troff version 1.23.0.

Copyright � 1994-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<title>Input Conventions (The GNU Troff Manual)</title>

<meta name="description" content="Input Conventions (The GNU Troff Manual)">
<meta name="keywords" content="Input Conventions (The GNU Troff Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Request-Index.html" rel="index" title="Request Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Text.html" rel="up" title="Text">
<link href="Input-Encodings.html" rel="prev" title="Input Encodings">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
ul.mark-bullet {list-style-type: disc}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Input-Conventions">
<div class="nav-panel">
<p>
Previous: <a href="Input-Encodings.html" accesskey="p" rel="prev">Input Encodings</a>, Up: <a href="Text.html" accesskey="u" rel="up">Text</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Input-Conventions-1">5.1.10 Input Conventions</h4>
<a class="index-entry-id" id="index-input-conventions"></a>
<a class="index-entry-id" id="index-conventions-for-input"></a>

<p>Since GNU <code class="code">troff</code> fills text automatically, it is common practice
in the <code class="code">roff</code> language to avoid visual composition of text in input
files: the esthetic appeal of the formatted output is what matters.
Therefore, <code class="code">roff</code> input should be arranged such that it is easy for
authors and maintainers to compose and develop the document, understand
the syntax of <code class="code">roff</code> requests, macro calls, and preprocessor
languages used, and predict the behavior of the formatter.  Several
traditions have accrued in service of these goals.
</p>
<ul class="itemize mark-bullet">
<li>Follow sentence endings in the input with newlines to ease their
recognition (see <a class="pxref" href="Sentences.html">Sentences</a>).  It is frequently convenient to end
text lines after colons and semicolons as well, as these typically
precede independent clauses.  Consider doing so after commas; they often
occur in lists that become easy to scan when itemized by line, or
constitute supplements to the sentence that are added, deleted, or
updated to clarify it.  Parenthetical and quoted phrases are also good
candidates for placement on text lines by themselves.

</li><li>Set your text editor&rsquo;s line length to 72 characters or
fewer.<a class="footnote" id="DOCF32" href="groff.html_fot.html#FOOT32"><sup>32</sup></a>
This limit, combined with the previous item of advice, makes it less
common that an input line will wrap in your text editor, and thus will
help you perceive excessively long constructions in your text.  Recall
that natural languages originate in speech, not writing, and that
punctuation is correlated with pauses for breathing and changes in
prosody.

</li><li>Use <code class="code">\&amp;</code> after &lsquo;<samp class="samp">!</samp>&rsquo;, &lsquo;<samp class="samp">?</samp>&rsquo;, and &lsquo;<samp class="samp">.</samp>&rsquo; if they are
followed by space, tab, or newline characters and don&rsquo;t end a sentence.

</li><li>In filled text lines, use <code class="code">\&amp;</code> before &lsquo;<samp class="samp">.</samp>&rsquo; and &lsquo;<samp class="samp">'</samp>&rsquo; if they
are preceded by space, so that reflowing the input doesn&rsquo;t turn them
into control lines.

</li><li>Do not use spaces to perform indentation or align columns of a table.
Leading spaces are reliable when text is not being filled.

</li><li>Comment your document.  It is never too soon to apply comments to
record information of use to future document maintainers (including your
future self).  We thus introduce another escape sequence, <code class="code">\&quot;</code>,
which causes GNU <code class="code">troff</code> to ignore the remainder of the input line.

</li><li>Use the empty request&mdash;a control character followed immediately by a
newline&mdash;to visually manage separation of material in input files.
Many of the <code class="code">groff</code> project&rsquo;s own documents use an empty request
between sentences, after macro definitions, and where a break is
expected, and two empty requests between paragraphs or other requests or
macro calls that will introduce vertical space into the document.

<p>You can combine the empty request with the comment escape sequence to
include whole-line comments in your document, and even &ldquo;comment out&rdquo;
sections of it.
</p></li></ul>

<p>We conclude this section with an example sufficiently long to illustrate
most of the above suggestions in practice.  For the purpose of fitting
the example between the margins of this manual with the font used for
its typeset version, we have shortened the input line length to 56
columns.  As before, an arrow &rarr; indicates a tab character.
</p>
<table class="cartouche" border="1"><tr><td>
<div class="example">
<pre class="example-preformatted">.\&quot;   nroff this_file.roff | less
.\&quot;   groff -T ps this_file.roff &gt; this_file.ps
&rarr;The theory of relativity is intimately connected with
the theory of space and time.
.
I shall therefore begin with a brief investigation of
the origin of our ideas of space and time,
although in doing so I know that I introduce a
controversial subject.  \&quot; remainder of paragraph elided
.
.

&rarr;The experiences of an individual appear to us arranged
in a series of events;
in this series the single events which we remember
appear to be ordered according to the criterion of
\[lq]earlier\[rq] and \[lq]later\[rq], \&quot; punct swapped
which cannot be analysed further.
.
There exists,
therefore,
for the individual,
an I-time,
or subjective time.
.
This itself is not measurable.
.
I can,
indeed,
associate numbers with the events,
in such a way that the greater number is associated with
the later event than with an earlier one;
but the nature of this association may be quite
arbitrary.
.
This association I can define by means of a clock by
comparing the order of events furnished by the clock
with the order of a given series of events.
.
We understand by a clock something which provides a
series of events which can be counted,
and which has other properties of which we shall speak
later.
.\&quot; Albert Einstein, _The Meaning of Relativity_, 1922
</pre></div>
</td></tr></table>

</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="Input-Encodings.html">Input Encodings</a>, Up: <a href="Text.html">Text</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>