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
|
<!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>ms basic information (The GNU Troff Manual)</title>
<meta name="description" content="ms basic information (The GNU Troff Manual)">
<meta name="keywords" content="ms basic information (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="ms-Introduction.html" rel="up" title="ms Introduction">
<link href="ms-Document-Structure.html" rel="next" title="ms Document Structure">
<link href="ms-Introduction.html" rel="prev" title="ms Introduction">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
-->
</style>
</head>
<body lang="en">
<div class="subsubsection-level-extent" id="ms-basic-information">
<div class="nav-panel">
<p>
Next: <a href="ms-Document-Structure.html" accesskey="n" rel="next">Document Structure</a>, Previous: <a href="ms-Introduction.html" accesskey="p" rel="prev">Introduction</a>, Up: <a href="ms-Introduction.html" accesskey="u" rel="up">Introduction</a> [<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="subsubsection" id="Basic-information">4.6.1.1 Basic information</h4>
<p><samp class="file">ms</samp> documents are plain text files; prepare them with your
preferred text editor. If you’re in a hurry to start, know that
<samp class="file">ms</samp> needs one of its macros called at the beginning of a document
so that it can initialize. A <em class="dfn">macro</em> is a formatting instruction to
<samp class="file">ms</samp>. Put a macro call on a line by itself. Use ‘<samp class="samp">.PP</samp>’ if you
want your paragraph’s first line to be indented, or ‘<samp class="samp">.LP</samp>’ if you
don’t.
</p>
<p>After that, start typing normally. It is a good practice to start each
sentence on a new line, or to put two spaces after sentence-ending
punctuation, so that the formatter knows where the sentence boundaries
are. You can separate paragraphs with further paragraphing macros, or
with blank lines, and you can indent with tabs. When you need one of
the features mentioned earlier (see <a class="pxref" href="ms.html"><samp class="file">ms</samp></a>), return to this part of the
manual.
</p>
<p>Format the document with the <code class="command">groff</code> command. <code class="command">nroff</code>
can be useful for previewing.
</p>
<table class="cartouche" border="1"><tr><td>
<div class="example">
<pre class="example-preformatted">$ editor radical.ms
$ nroff -ww -z -ms radical.ms # check for errors
$ nroff -ms radical.ms | less -R
$ groff -T ps -ms radical.ms > radical.ps
$ see radical.ps
</pre></div>
</td></tr></table>
<p>Our <samp class="file">radical.ms</samp> document might look like this.
</p>
<table class="cartouche" border="1"><tr><td>
<div class="example">
<pre class="example-preformatted">.LP
Radical novelties are so disturbing that they tend to be
suppressed or ignored, to the extent that even the
possibility of their existence in general is more often
denied than admitted.
→That's what Dijkstra said, anyway.
</pre></div>
</td></tr></table>
<p><samp class="file">ms</samp> exposes many aspects of document layout to user control via
<code class="code">groff</code>’s <em class="dfn">registers</em> and <em class="dfn">strings</em>, which store numbers
and text, respectively. Measurements in <code class="code">groff</code> are expressed with
a suffix called a <em class="dfn">scaling unit</em>.
</p>
<dl class="table">
<dt><code class="code">i</code></dt>
<dd><p>inches
</p>
</dd>
<dt><code class="code">c</code></dt>
<dd><p>centimeters
</p>
</dd>
<dt><code class="code">p</code></dt>
<dd><p>points (1/72 inch)
</p>
</dd>
<dt><code class="code">P</code></dt>
<dd><p>picas (1/6 inch)
</p>
</dd>
<dt><code class="code">v</code></dt>
<dd><p>vees; current vertical spacing
</p>
</dd>
<dt><code class="code">m</code></dt>
<dd><p>ems; width of an “M” in the current font
</p>
</dd>
<dt><code class="code">n</code></dt>
<dd><p>ens; one-half em
</p></dd>
</dl>
<p>Set registers with the <code class="code">nr</code> request and strings with the <code class="code">ds</code>
request. <em class="dfn">Requests</em> are like macro calls; they go on lines by
themselves and start with the <em class="dfn">control character</em>, a dot (<code class="code">.</code>).
The difference is that they directly instruct the formatter program,
rather than the macro package. We’ll discuss a few as applicable. It
is wise to specify a scaling unit when setting any register that
represents a length, size, or distance.
</p>
<table class="cartouche" border="1"><tr><td>
<div class="example">
<pre class="example-preformatted">.nr PS 10.5p \" Use 10.5-point type.
.ds FAM P \" Use Palatino font family.
</pre></div>
</td></tr></table>
<p>In the foregoing, we see that <code class="code">\"</code> begins a comment. This is an
example of an <em class="dfn">escape sequence</em>, the other kind of formatting
instruction. Escape sequences can appear anywhere. They begin with the
escape character (<code class="code">\</code>) and are followed by at least one more
character. <samp class="file">ms</samp> documents
tend to use only a few of <code class="code">groff</code>’s many requests and escape
sequences; see <a class="ref" href="Request-Index.html">Request Index</a> and <a class="ref" href="Escape-Sequence-Index.html">Escape Sequence Index</a> or
the <cite class="cite">groff<span class="r">(7)</span></cite> man page for complete lists.
</p>
<dl class="table">
<dt><code class="code">\"</code></dt>
<dd><p>Begin comment; ignore remainder of line.
</p>
</dd>
<dt><code class="code">\n[<var class="var">reg</var>]</code></dt>
<dd><p>Interpolate value of register <var class="var">reg</var>.
</p>
</dd>
<dt><code class="code">\*[<var class="var">str</var>]</code></dt>
<dd><p>Interpolate contents of string <var class="var">str</var>.
</p>
</dd>
<dt><code class="code">\*<var class="var">s</var></code></dt>
<dd><p>abbreviation of <code class="code">\*[<var class="var">s</var>]</code>; the name <var class="var">s</var> must be only one
character
</p>
</dd>
<dt><code class="code">\[<var class="var">char</var>]</code></dt>
<dd><p>Interpolate glyph of special character named <var class="var">char</var>.
</p>
</dd>
<dt><code class="code">\&</code></dt>
<dd><p>dummy character
</p>
</dd>
<dt><code class="code">\~</code></dt>
<dd><p>Insert an unbreakable space that is adjustable like a normal space.
</p>
</dd>
<dt><code class="code">\|</code></dt>
<dd><p>Move horizontally by one-sixth em (“thin space”).
</p></dd>
</dl>
<p>Prefix any words that start with a dot ‘<samp class="samp">.</samp>’ or neutral apostrophe
‘<samp class="samp">'</samp>’ with <code class="code">\&</code> if they are at the beginning of an input line
(or might become that way in editing) to prevent them from being
interpreted as macro calls or requests. Suffix ‘<samp class="samp">.</samp>’, ‘<samp class="samp">?</samp>’, and
‘<samp class="samp">!</samp>’ with <code class="code">\&</code> when needed to cancel end-of-sentence detection.
</p>
<table class="cartouche" border="1"><tr><td>
<div class="example">
<pre class="example-preformatted">My exposure was \&.5 to \&.6 Sv of neutrons, said Dr.\&
Wallace after the criticality incident.
</pre></div>
</td></tr></table>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="ms-Document-Structure.html">Document Structure</a>, Previous: <a href="ms-Introduction.html">Introduction</a>, Up: <a href="ms-Introduction.html">Introduction</a> [<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>
|