xref: /original-bsd/old/eqn/USD.doc/eqnguide/g2 (revision c3e32dec)
%sccs.include.proprietary.roff%

@(#)g2 8.1 (Berkeley) 06/08/93

.SC "Size and Font Changes"

By default, equations are set in 10-point type (the same size as this guide), with standard mathematical conventions to determine what characters are in roman and what in italic. Although C EQN makes a valiant attempt to use esthetically pleasing sizes and fonts, it is not perfect. To change sizes and fonts, use .ul size n and .ul roman, italic, .ul bold and .ul fat. Like .ul sub and .ul sup, size and font changes affect only the thing that follows them, and revert to the normal situation at the end of it. Thus

1 bold x y

2 is bold x y .EN and

1 size 14 bold x = y + size 14 {alpha + beta}

2 gives size 14 bold x = y + size 14 {alpha + beta} .EN As always, you can use braces if you want to affect something more complicated than a single letter. For example, you can change the size of an entire equation by

1 size 12 { ... }

2

Legal sizes which may follow .ul size are 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36. You can also change the size .ul by a given amount; for example, you can say .ul size~+2 to make the size two points bigger, or .ul size~-3 to make it three points smaller. This has the advantage that you don't have to know what the current size is.

If you are using fonts other than roman, italic and bold, you can say .ul font X where .ul X is a one character C TROFF name or number for the font. Since C EQN is tuned for roman, italic and bold, other fonts may not give quite as good an appearance.

The .ul fat operation takes the current font and widens it by overstriking: .ul fat grad is $fat grad$ and .ul fat {x sub i} is $fat {x sub i}$.

If an entire document is to be in a non-standard size or font, it is a severe nuisance to have to write out a size and font change for each equation. Accordingly, you can set a ``global'' size or font which thereafter affects all equations. At the beginning of any equation, you might say, for instance,

1 ^EQ gsize 16 gfont R ... ^EN

2 to set the size to 16 and the font to roman thereafter. In place of R, you can use any of the C TROFF font names. The size after .ul gsize can be a relative change with + or -.

Generally, .ul gsize and .ul gfont will appear at the beginning of a document but they can also appear thoughout a document: the global font and size can be changed as often as needed. For example, in a footnote\(dd .FS \(ddLike this one, in which we have a $gsize -2$few random expressions like $x sub i$ and $pi sup 2$. The sizes for these were set by the command .ul gsize~-2. .FE $gsize +2$ you will typically want the size of equations to match the size of the footnote text, which is two points smaller than the main text. Don't forget to reset the global size at the end of the footnote. .SC "Diacritical Marks"

To get funny marks on top of letters, there are several words:

1 .tr ^^ .tr ~~ x dot $x dot$ x dotdot $x dotdot$ x hat $x hat$ x tilde $x tilde$ x vec $x vec$ x dyad $x dyad$ x bar $x bar$ x under $x under$

2 The diacritical mark is placed at the right height. The .ul bar and .ul under are made the right length for the entire construct, as in $x+y+z bar$; other marks are centered. .SC "Quoted Text"

Any input entirely within quotes (\|"..."\|) is not subject to any of the font changes and spacing adjustments normally done by the equation setter. This provides a way to do your own spacing and adjusting if needed:

1 italic "sin(x)" + sin (x)

2 is italic "sin(x)" + sin (x) .EN

Quotes are also used to get braces and other C EQN keywords printed:

1 "{ size alpha }"

2 is "{ size alpha }" .EN and

1 roman "{ size alpha }"

2 is roman "{ size alpha }" .EN

The construction "" is often used as a place-holder when grammatically C EQN needs something, but you don't actually want anything in your output. For example, to make $"" sup 2 roman He$, you can't just type .ul sup 2 roman He because a .ul sup has to be a superscript .ul on something. Thus you must say

1 "" sup 2 roman He

2

To get a literal quote use ``\\"''. C TROFF characters like .ul \e(bs can appear unquoted, but more complicated things like horizontal and vertical motions with .ul \eh and .ul \ev should always be quoted. (If you've never heard of .ul \\h and .ul \\v, ignore this section.) .SC "Lining Up Equations"

Sometimes it's necessary to line up a series of equations at some horizontal position, often at an equals sign. This is done with two operations called .ul mark and .ul lineup.

The word .ul mark may appear once at any place in an equation. It remembers the horizontal position where it appeared. Successive equations can contain one occurrence of the word .ul lineup. The place where .ul lineup appears is made to line up with the place marked by the previous .ul mark if at all possible. Thus, for example, you can say

1 ^EQ I x+y mark = z ^EN ^EQ I x lineup = 1 ^EN

2 to produce x+y mark = z .EN x lineup = 1 .EN For reasons too complicated to talk about, when you use C EQN and `-ms', use either C .EQ I or C .EQ L . mark and .ul lineup don't work with centered equations. Also bear in mind that .ul mark doesn't look ahead;

1 x mark =1 ... x+y lineup =z

2 isn't going to work, because there isn't room for the .ul x+y part after the .ul mark remembers where the .ul x is. .SC "Big Brackets, Etc."

.tr ~ To get big brackets [~], braces {~}, parentheses (~), and bars |~| around things, use the .ul left and .ul right commands: .tr ~~

1 left { a over b + 1 right } ~=~ left ( c over d right ) + left [ e right ]

2 is left { a over b + 1 right } ~=~ left ( c over d right ) + left [ e right ] .EN The resulting brackets are made big enough to cover whatever they enclose. Other characters can be used besides these, but the are not likely to look very good. One exception is the .ul floor and .ul ceiling characters:

1 left floor x over y right floor <= left ceiling a over b right ceiling

2 produces left floor x over y right floor <= left ceiling a over b right ceiling .EN

Several warnings about brackets are in order. First, braces are typically bigger than brackets and parentheses, because they are made up of three, five, seven, etc., pieces, while brackets can be made up of two, three, etc. Second, big left and right parentheses often look poor, because the character set is poorly designed.

The .ul right part may be omitted: a ``left something'' need not have a corresponding ``right something''. If the .ul right part is omitted, put braces around the thing you want the left bracket to encompass. Otherwise, the resulting brackets may be too large.

If you want to omit the .ul left part, things are more complicated, because technically you can't have a .ul right without a corresponding .ul left. Instead you have to say

1 left "" ..... right )

2 for example. The .ul left "" means a ``left nothing''. This satisfies the rules without hurting your output. .SC "Piles"

There is a general facility for making vertical piles of things; it comes in several flavors. For example:

1 .tr ~~ A ~=~ left [ pile { a above b above c } ~~ pile { x above y above z } right ]

2 will make A ~=~ left [ pile { a above b above c } ~~ pile { x above y above z } right ] .EN The elements of the pile (there can be as many as you want) are centered one above another, at the right height for most purposes. The keyword .ul above is used to separate the pieces; braces are used around the entire list. The elements of a pile can be as complicated as needed, even containing more piles.

Three other forms of pile exist: .ul lpile makes a pile with the elements left-justified; .ul rpile makes a right-justified pile; and .ul cpile makes a centered pile, just like .ul pile. The vertical spacing between the pieces is somewhat larger for .ul l-, .ul r- and .ul cpiles than it is for ordinary piles.

1 2 roman sign (x)~=~ left { lpile {1 above 0 above -1} ~~ lpile {if~x>0 above if~x=0 above if~x<0}

2 makes roman sign (x)~=~ left { lpile {1 above 0 above -1} ~~ lpile {if~x>0 above if~x=0 above if~x<0} .EN Notice the left brace without a matching right one. .SC Matrices

It is also possible to make matrices. For example, to make a neat array like matrix { ccol { x sub i above y sub i } ccol { x sup 2 above y sup 2 } } .EN you have to type

1 matrix { ccol { x sub i above y sub i } ccol { x sup 2 above y sup 2 } }

2 This produces a matrix with two centered columns. The elements of the columns are then listed just as for a pile, each element separated by the word .ul above. You can also use .ul lcol or .ul rcol to left or right adjust columns. Each column can be separately adjusted, and there can be as many columns as you like.

The reason for using a matrix instead of two adjacent piles, by the way, is that if the elements of the piles don't all have the same height, they won't line up properly. A matrix forces them to line up, because it looks at the entire structure before deciding what spacing to use.

A word of warning about matrices _ .ul each column must have the same number of elements in it. The world will end if you get this wrong.