⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e4

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
字号:
.NHThe Language.PPWe will not try to describe the language precisely here;interested readers may refer to the appendix for more details.Throughout this section, we will write expressionsexactlyas they are handed to the typesetting program (hereinafter called.UC ``EQN'' ),except that we won't show the delimitersthat the user types to mark the beginning and end of the expression.The interface between.UC EQNand.UC TROFFis described at the end of this section..PPAs we said, typing x=y+z+1 should produce $x=y+z+1$,and indeed it does.Variables are made italic, operators and digits become roman,and normal spacings between letters and operators are altered slightlyto give a more pleasing appearance..PPInput is free-form.Spaces and new lines in the input are used by.UC EQNto separate pieces of the input;they are not used to create space in the output.Thus .P1x    =    y   + z + 1.P2also gives $x=y+z+1$.Free-form input is easier to type initially;subsequent editing is also easier,for an expression may be typed as many short lines..PPExtra white space can be forced into the output by severalcharacters of various sizes.A tilde ``\|~\|'' gives a space equalto the normal word spacing in text;a circumflex gives half this much,and a tab charcter spaces to the next tab stop..PPSpaces (or tildes, etc.)also serve to delimit pieces of the input.For example, to get.EQf(t) = 2 pi int sin ( omega t )dt.ENwe write.P1f(t) = 2 pi int sin ( omega t )dt.P2Here spaces are.ulnecessaryin the inputto indicate that .ulsin, pi, int,and.ulomegaare special, and potentially worth special treatment..UC EQNlooks up each such string of charactersin a table, and if appropriate gives it a translation.In this case, .ulpiand.ulomegabecome their greek equivalents,.ulintbecomes the integral sign(which must be moved down and enlarged so it looks ``right''),and.ulsinis made roman, following conventional mathematical practice.Parentheses, digits and operators are automatically made romanwherever found..PPFractions are specified with the keyword.ulover:.P1a+b over c+d+e = 1.P2produces.EQa+b over c+d+e = 1.EN.PPSimilarly, subscripts and superscripts are introduced by the keywords.ulsuband.ulsup:.EQx sup 2 + y sup 2 = z sup 2.ENis produced by.P1x sup 2 + y sup 2 = z sup 2.P2The spaces after the 2's are necessary to mark the end ofthe superscripts;similarly the keyword.ulsuphas to be marked off by spaces orsome equivalent delimiter.The return to the proper baseline is automatic.Multiple levels of subscripts or superscriptsare of course allowed:``x\|\|sup\|\|y\|\|sup\|\|z'' is$x sup y sup z$.The construct``something.ulsubsomething.ulsupsomething''is recognized as a special case,so ``x sub i sup 2''is$x sub i sup 2$ instead of ${x sub i} sup 2$..PPMore complicated expressions can now be formed with theseprimitives:.EQ{partial sup 2 f} over {partial x sup 2} =x sup 2 over a sup 2 + y sup 2 over b sup 2.ENis produced by.P1.ce 0   {partial sup 2 f} over {partial x sup 2} =   x sup 2 over a sup 2 + y sup 2 over b sup 2.P2Braces {} are used to group objects together;in this case they indicate unambiguously what goes over whaton the left-hand side of the expression.The language defines the precedence of.ulsupto be higher than that of.ulover,sono braces are needed to get the correct association on the right side.Braces can always be used when in doubtabout precedence..PPThe braces convention is an example of the powerof using a recursive grammarto define the language.It is part of the language that if a construct can appearin some context,then .ulany expressionin bracescan also occur in that context..PPThere is a.ulsqrtoperator for making square roots of the appropriate size:``sqrt a+b'' produces $sqrt a+b$,and.P1x =  {-b +- sqrt{b sup 2 -4ac}} over 2a.P2is.EQx={-b +- sqrt{b sup 2 -4ac}} over 2a.ENSince large radicals look poor on our typesetter,.ulsqrtis not useful for tall expressions..PPLimits on summations, integrals and similarconstructions are specified withthe keywords.ulfromand.ulto.To get.EQsum from i=0 to inf x sub i -> 0.ENwe need only type.P1sum from i=0 to inf x sub i -> 0.P2Centering and making the $SIGMA$ big enough and the limits smallerare all automatic.The.ulfromand.ultoparts are both optional,and the central part (e.g., the $SIGMA$)can in fact be anything:.P1lim from {x -> pi /2} ( tan~x) = inf.P2is.EQlim from {x -> pi /2} ( tan~x) = inf.ENAgain,the braces indicate just what goes into the.ulfrompart..PPThere is a facility for making braces, brackets, parentheses, and vertical barsof the right height, using the keywords.ulleftand .ulright:.P1left [ x+y over 2a right ]~=~1.P2makes.EQleft [ x+y over 2a right ]~=~1.ENA.ulleftneed not have a corresponding.ulright,as we shall see in the next example.Any characters may follow.ulleftand.ulright,but generally only various parentheses and bars are meaningful..PPBig brackets, etc.,are often used with another facility,called.ulpiles,which make vertical piles of objects.For example,to get.EQsign (x) ~==~ left {   rpile {1 above 0 above -1}   ~~lpile {if above if above if}   ~~lpile {x>0 above x=0 above x<0}.ENwe can type.P1sign (x) ~==~ left {   rpile {1 above 0 above -1}   ~~lpile {if above if above if}   ~~lpile {x>0 above x=0 above x<0}.P2The construction ``left {''makes a left brace big enoughto enclose the``rpile {...}'',which is a right-justified pile of``above ... above ...''.``lpile'' makes a left-justified pile.There are also centered piles.Because of the recursive language definition,apilecan contain any number of elements;any element of a pile can of coursecontain piles..PPAlthough.UC EQNmakes a valiant attemptto use the right sizes and fonts,there are times when the default assumptionsare simply not what is wanted.For instance the italic.ulsignin the previous example would conventionallybe in roman.Slides and transparencies often require larger characters than normal text.Thus we also provide size and fontchanging commands:``size 12 bold {A~x~=~y}''will produce$size 12 bold{ A~x~=~y}$..ulSizeis followed by a number representing a character size in points.(One point is 1/72 inch;this paper is set in 9 point type.).PPIf necessary, an input string can be quoted in "...",which turns off grammatical significance, and any font or spacing changes that might otherwise be done on it.Thus we can say .P1lim~ roman "sup" ~x sub n = 0.P2to ensure that the supremum doesn't become a superscript:.EQlim~ roman "sup" ~x sub n = 0.EN.PPDiacritical marks, long a problem in traditional typesetting,are straightforward:.EQx dot under + x hat + y tilde + X hat + Y dotdot = z+Z bar.ENis made by typing.P1x dot under + x hat + y tilde + X hat + Y dotdot = z+Z bar.P2.PPThere are also facilities for globally changing defaultsizes and fonts, for example for making viewgraphsor for setting chemical equations.The language allows for matrices, and for lining up equationsat the same horizontal position..PPFinally, there is a definition facility,so a user can say.P1define name "...".P2at any time in the document;henceforth, any occurrence of the token ``name''in an expressionwill be expanded into whatever was insidethe double quotes in its definition.This lets users tailorthe language to their own specifications,for it is quite possible to redefinekeywordslike.ulsupor.ulover.Section 6 shows an example of definitions..PPThe.UC EQNpreprocessor reads intermixed text and equations,and passes its output to.UC TROFF.Since.UC TROFFuses lines beginning with a period as control words(e.g., ``.ce'' means ``center the next output line''),.UC EQNuses the sequence ``.EQ'' to mark the beginning of an equation and``.EN'' to mark the end.The ``.EQ'' and ``.EN'' are passed through to.UC TROFF untouched,so they can also be used by a knowledgeable user tocenter equations, number them automatically, etc.By default, however,``.EQ'' and ``.EN'' are simply ignored by.UC TROFF ,so by default equations are printed in-line..PP``.EQ'' and ``.EN'' can be supplemented by.UC TROFFcommands as desired;for example, a centered display equationcan be produced with the input:.P1.ce 0.in 5 .ce .EQ x sub i = y sub i ... .EN.in 0.P2.PPSince it is tedious to type``.EQ'' and ``.EN'' around very short expressions(single letters, for instance),the user can also define two characters to serveas the left and right delimiters of expressions.These characters are recognized anywhere in subsequent text.For example if the left and right delimiters have both been set to ``#'',the input:.P1Let #x sub i#, #y# and #alpha# be positive.P2produces:.P1Let $x sub i$, $y$ and $alpha$ be positive.P2.PPRunning a preprocessor is strikingly easy on.UC UNIX.To typesettext stored in file``f\|'',one issues the command:.P1eqn f | troff.P2The vertical bar connects the outputof one process.UC (EQN)to the input of another.UC (TROFF) .

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -