File: latex2e_27.html

package info (click to toggle)
setzer 65-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,372 kB
  • sloc: python: 13,320; xml: 3,660; makefile: 139; sh: 6
file content (206 lines) | stat: -rw-r--r-- 7,400 bytes parent folder | download
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This document is an unofficial reference manual for LaTeX, a
document preparation system, version of October 2018.

This manual was originally translated from LATEX.HLP v1.0a in the
VMS Help Library.  The pre-translation version was written by
George D. Greenwade of Sam Houston State University.  The
LaTeX 2.09 version was written by Stephen Gilmore.  The
LaTeX2e version was adapted from this by Torsten Martinsen.  Karl
Berry made further updates and additions, and gratefully acknowledges
using Hypertext Help with LaTeX, by Sheldon Green, and
LaTeX Command Summary (for LaTeX 2.09) by
L. Botway and C. Biemesderfer (published by the TeX Users
Group as TeXniques number 10), as reference material.  We also
gratefully acknowledge additional material appearing in
latex2e-reference by Martin Herbert Dietze.  (From these references no
text was directly copied.)

Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018 Karl Berry.

Copyright 1988, 1994, 2007 Stephen Gilmore.

Copyright 1994, 1995, 1996 Torsten Martinsen.

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. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Terminal input/output (LaTeX2e unofficial reference manual (October 2018))</title>

<meta name="description" content="Terminal input/output (LaTeX2e unofficial reference manual (October 2018))">
<meta name="keywords" content="Terminal input/output (LaTeX2e unofficial reference manual (October 2018))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="latex2e_0.html#Top" rel="start" title="Top">
<link href="latex2e_30.html#Index" rel="index" title="Index">
<link href="latex2e_0.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="latex2e_0.html#Top" rel="up" title="Top">
<link href="latex2e_28.html#Command-line" rel="next" title="Command line">
<link href="latex2e_26.html#g_t_005ctelephone" rel="prev" title="\telephone">
<style type="text/css">
<!--
body {margin: 1em; margin-top: 0px; padding-top: 1px}
a.anchor {float: right}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body id="top" lang="en">
<a name="Terminal-input_002foutput" class="anchor"></a>
<a name="Terminal-input_002foutput-1" class="anchor"></a>
<h2 class="chapter">Terminal input/output</h2>

<a name="index-input_002foutput_002c-to-terminal" class="anchor"></a>
<a name="index-terminal-input_002foutput" class="anchor"></a>



<hr>
<a name="g_t_005ctypein" class="anchor"></a>
<a name="g_t_005ctypein-1" class="anchor"></a>
<h3 class="section"><code>\typein</code></h3>

<a name="index-_005ctypein" class="anchor"></a>

<p>Synopsis, one of:
</p>
<div class="example">
<pre class="example">\typein{<var>prompt-msg</var>}
\typein[<var>cmd</var>]{<var>prompt-msg</var>}
</pre></div>

<p>Print <var>prompt-msg</var> on the terminal and cause LaTeX to stop and
wait for you to type a line of input.  This line of input ends when you
hit the return key.
</p>
<p>For example, this
</p>
<div class="example">
<pre class="example">As long as I live I shall never forget \typein{Enter student name:}
</pre></div>

<p>coupled with this command line interaction
</p>
<div class="example">
<pre class="example">Enter student name:

\@typein=Aphra Behn
</pre></div>

<p>gives the output &lsquo;<samp>... never forget Aphra Behn</samp>&rsquo;.
</p>
<p>The first command version, <code>\typein{<var>prompt-msg</var>}</code>, causes
the input you typed to be processed as if it had been included in the
input file in place of the <code>\typein</code> command.
</p>
<p>In the second command version the optional argument <code><var>cmd</var></code>
argument must be a command name &mdash; it must begin with a backslash, \.
This command name is then defined or redefined to be the input that you
typed.  For example, this
</p>
<div class="example">
<pre class="example">\typein[\student]{Enter student name:}
\typeout{Recommendation for \student .}
</pre></div>

<p>gives this output on the command line,
</p>
<div class="example">
<pre class="example">Enter student name:

\student=John Dee
Recommendation for John Dee.
</pre></div>

<p>where the user has entered &lsquo;<samp>John Dee.</samp>&rsquo;
</p>

<hr>
<a name="g_t_005ctypeout" class="anchor"></a>
<a name="g_t_005ctypeout-1" class="anchor"></a>
<h3 class="section"><code>\typeout</code></h3>

<a name="index-_005ctypeout" class="anchor"></a>

<p>Synopsis:
</p>
<div class="example">
<pre class="example">\typeout{<var>msg</var>}
</pre></div>

<p>Print <code>msg</code> on the terminal and in the <code>log</code> file.
</p>
<p>This
</p>
<div class="example">
<pre class="example">\newcommand{\student}{John Dee}
\typeout{Recommendation for \student .}
</pre></div>

<p>outputs &lsquo;<samp>Recommendation for John Dee</samp>&rsquo;.  Like what happens here with
<code>\student</code>, commands that are defined with <code>\newcommand</code> or
<code>\renewcommand</code> (among others) are replaced by their definitions
before being printed.
</p>
<p>LaTeX&rsquo;s usual rules for treating multiple spaces as a single space
and ignoring spaces after a command name apply to <code>msg</code>.  As above,
use the command <code>\space</code> to get a single space, independent of
surrounding spaces.  Use <code>^^J</code> to get a newline.  Get a percent
character with <code>\csname @percentchar\endcsname</code>.
</p>
<p>This command can be useful for simple debugging, as here:
</p>
<div class="example">
<pre class="example">\newlength{\jhlength}
\setlength{\jhlength}{5pt}
\typeout{The length is \the\jhlength.}
</pre></div>

<p>produces on the command line &lsquo;<samp>The length is 5.0pt</samp>&rsquo;.
</p>




</body>
</html>