summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/texsis/base/TXSprns.doc
blob: 03f734edea79a4f46dedd7b28543f4b9fa2dcbb6 (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
%% file: TXSprns.doc - Parentheses Sizing - TeXsis version 2.18
%% @(#) $Id: TXSprns.doc,v 18.2 2000/05/17 00:19:46 myers Exp $
%======================================================================*
% (C) Copyright 1989, 1992 by Eric Myers and Frank E. Paige
% This file is a part of TeXsis.  Distribution and/or modifications
% are allowed under the terms of the LaTeX Project Public License (LPPL).
% See the file COPYING or ftp://ftp.texsis.org/texsis/LPPL
%======================================================================*
\ifx\undefined\meta \texsis\input TXSdocM.doc\draft\fi 


\subsection{Automatic Parentheses Sizing  \label{sect.paren}}%
Plain \TeX\ provides automatic adjustment of the sizes of parentheses
and other delimiters when you use \cs{left} and \cs{right}, as in
\index{parentheses!sizes}
\example
|$$|
\cs{left}|(| \meta{math material } \cs{right}|)|
|$$|
\endexample
\TeXsis\ provides similar automatic sizing of parentheses and square
brackets in displayed equations without the need of typing \cs{left} and
\cs{right}.  You must still use \cs{left} and \cs{right} for all other
delimiters, and they can be used for parentheses and square brackets if
desired.  This feature is turned on and off with \CS{autoparens} and
\cs{offparens} respectively; the default, once you say \cs{texsis}, is
\CS{autoparens}. Thus, for example,
\TeXexample
|smalltt\autoparens
 $$
( a \over b )
 $$
|endTeXexample
produces
\autoparens 
 $$ 
( a \over b ) 
 $$
whereas
\TeXexample 
|smalltt\offparens 
 $$ 
( a \over b ) 
 $$ 
|endTeXexample 
\goodbreak\noindent
produces
\offparens 
 $$ 
( a \over b ) 
 $$ 
\autoparens
which is not what one normally desires.
   
   The automatic sizing of parentheses works by making |)|, |(|, |]|,
and |[| active characters in displayed equations and defining them to be
macros which use \cs{left} and \cs{right} to size the parentheses.  While
this normally works properly and simplifies the typing of equations, it
will fail if the \cs{left} and \cs{right} operators are not properly
balanced, such as when a long equation is split between two or more
lines with \cs{eqalign} or \cs{EQNalign}.  Almost all such problems can be
solved by using the control sequences \cs{lparen}, \cs{rparen}, \cs{lbrack},
and \cs{rbrack}, which are taken from Plain \TeX\ and which give just the
standard parenthesis and bracket characters. For example,
$$
\EQNalign{
F &= \Biggl\lbrack (a \over b) + (c \over d) \cr
&\qquad + (e \over f) + (g \over h) \Biggr\rbrack \cr}
$$
can be produced with
\TeXexample
$$
\EQNalign{
F &= \Biggl\lbrack (a \over b) + (c \over d) \cr
&\quad + (e \over f) + (g \over h) \Biggr\rbrack \cr}
$$
|endTeXexample
\noindent
Note that in this example the parentheses are balanced on one line and
so can be sized automatically, while the brackets span two lines and so
must be sized ``by hand.''  The \cs{vbig} macro described in the next section
provides additional flexibility for sizing.

      If all else fails, you can use \cs{offparens} to turn off the
automatic sizing of parentheses and put in \cs{left} and \cs{right} or
explicit sizes yourself.  In any case, you must put \cs{left} and
\cs{right}, if needed, in in-line equations (math expressions which are
not displayed equations), because. \CS{autoparens} only applies to
displayed equations, not in-line math text.\Footnote\dag{Previous
versions of \TeXsis\ used the control sequence \cs{onparens} to provide
automatic parentheses sizing in {\it all} math-mode expressions.  While
you can still use this, we do not encourage it since it may cause
problems with other uses of these characters.}

%>>> EOF TXSprns.doc <<<