48 |
@macro cpiover{den} |
@macro cpiover{den} |
49 |
@expr{pi/\den\} |
@expr{pi/\den\} |
50 |
@end macro |
@end macro |
|
@macro LaTeX{} |
|
|
La@TeX{} |
|
|
@end macro |
|
51 |
@end ifnottex |
@end ifnottex |
52 |
|
|
53 |
|
|
736 |
Type @kbd{d B} to view the solutions in more readable notation. |
Type @kbd{d B} to view the solutions in more readable notation. |
737 |
Type @w{@kbd{d C}} to view them in C language notation, @kbd{d T} |
Type @w{@kbd{d C}} to view them in C language notation, @kbd{d T} |
738 |
to view them in the notation for the @TeX{} typesetting system, |
to view them in the notation for the @TeX{} typesetting system, |
739 |
and @kbd{d L} to view them in the notation for the @LaTeX{} typesetting |
and @kbd{d L} to view them in the notation for the La@TeX{} typesetting |
740 |
system. Type @kbd{d N} to return to normal notation. |
system. Type @kbd{d N} to return to normal notation. |
741 |
|
|
742 |
@noindent |
@noindent |
1121 |
Calc has added annotations to the file to help it remember the modes |
Calc has added annotations to the file to help it remember the modes |
1122 |
that were used for this formula. They are formatted like comments |
that were used for this formula. They are formatted like comments |
1123 |
in the @TeX{} typesetting language, just in case you are using @TeX{} or |
in the @TeX{} typesetting language, just in case you are using @TeX{} or |
1124 |
@LaTeX{}. (In this example @TeX{} is not being used, so you might want |
La@TeX{}. (In this example @TeX{} is not being used, so you might want |
1125 |
to move these comments up to the top of the file or otherwise put them |
to move these comments up to the top of the file or otherwise put them |
1126 |
out of the way.) |
out of the way.) |
1127 |
|
|
5218 |
Here things like powers, square roots, and quotients and fractions |
Here things like powers, square roots, and quotients and fractions |
5219 |
are displayed in a two-dimensional pictorial form. Calc has other |
are displayed in a two-dimensional pictorial form. Calc has other |
5220 |
language modes as well, such as C mode, FORTRAN mode, @TeX{} mode |
language modes as well, such as C mode, FORTRAN mode, @TeX{} mode |
5221 |
and @LaTeX{} mode. |
and La@TeX{} mode. |
5222 |
|
|
5223 |
@smallexample |
@smallexample |
5224 |
@group |
@group |
13922 |
@noindent |
@noindent |
13923 |
The commands in this section change Calc to use a different notation for |
The commands in this section change Calc to use a different notation for |
13924 |
entry and display of formulas, corresponding to the conventions of some |
entry and display of formulas, corresponding to the conventions of some |
13925 |
other common language such as Pascal or @LaTeX{}. Objects displayed on the |
other common language such as Pascal or La@TeX{}. Objects displayed on the |
13926 |
stack or yanked from the Calculator to an editing buffer will be formatted |
stack or yanked from the Calculator to an editing buffer will be formatted |
13927 |
in the current language; objects entered in algebraic entry or yanked from |
in the current language; objects entered in algebraic entry or yanked from |
13928 |
another buffer will be interpreted according to the current language. |
another buffer will be interpreted according to the current language. |
13947 |
and would have written the formula back with notations (like implicit |
and would have written the formula back with notations (like implicit |
13948 |
multiplication) which would not have been legal for a C program. |
multiplication) which would not have been legal for a C program. |
13949 |
|
|
13950 |
As another example, suppose you are maintaining a C program and a @LaTeX{} |
As another example, suppose you are maintaining a C program and a La@TeX{} |
13951 |
document, each of which needs a copy of the same formula. You can grab the |
document, each of which needs a copy of the same formula. You can grab the |
13952 |
formula from the program in C mode, switch to @LaTeX{} mode, and yank the |
formula from the program in C mode, switch to La@TeX{} mode, and yank the |
13953 |
formula into the document in @LaTeX{} math-mode format. |
formula into the document in La@TeX{} math-mode format. |
13954 |
|
|
13955 |
Language modes are selected by typing the letter @kbd{d} followed by a |
Language modes are selected by typing the letter @kbd{d} followed by a |
13956 |
shifted letter key. |
shifted letter key. |
14144 |
convert to lower-case for display and input. |
convert to lower-case for display and input. |
14145 |
|
|
14146 |
@node TeX and LaTeX Language Modes, Eqn Language Mode, C FORTRAN Pascal, Language Modes |
@node TeX and LaTeX Language Modes, Eqn Language Mode, C FORTRAN Pascal, Language Modes |
14147 |
@subsection @TeX{} and @LaTeX{} Language Modes |
@subsection @TeX{} and La@TeX{} Language Modes |
14148 |
|
|
14149 |
@noindent |
@noindent |
14150 |
@kindex d T |
@kindex d T |
14156 |
The @kbd{d T} (@code{calc-tex-language}) command selects the conventions |
The @kbd{d T} (@code{calc-tex-language}) command selects the conventions |
14157 |
of ``math mode'' in Donald Knuth's @TeX{} typesetting language, |
of ``math mode'' in Donald Knuth's @TeX{} typesetting language, |
14158 |
and the @kbd{d L} (@code{calc-latex-language}) command selects the |
and the @kbd{d L} (@code{calc-latex-language}) command selects the |
14159 |
conventions of ``math mode'' in @LaTeX{}, a typesetting language that |
conventions of ``math mode'' in La@TeX{}, a typesetting language that |
14160 |
uses @TeX{} as its formatting engine. Calc's @LaTeX{} language mode can |
uses @TeX{} as its formatting engine. Calc's La@TeX{} language mode can |
14161 |
read any formula that the @TeX{} language mode can, although @LaTeX{} |
read any formula that the @TeX{} language mode can, although La@TeX{} |
14162 |
mode may display it differently. |
mode may display it differently. |
14163 |
|
|
14164 |
Formulas are entered and displayed in the appropriate notation; |
Formulas are entered and displayed in the appropriate notation; |
14165 |
@texline @math{\sin(a/b)} |
@texline @math{\sin(a/b)} |
14166 |
@infoline @expr{sin(a/b)} |
@infoline @expr{sin(a/b)} |
14167 |
will appear as @samp{\sin\left( a \over b \right)} in @TeX{} mode and |
will appear as @samp{\sin\left( a \over b \right)} in @TeX{} mode and |
14168 |
@samp{\sin\left(\frac@{a@}@{b@}\right)} in @LaTeX{} mode. |
@samp{\sin\left(\frac@{a@}@{b@}\right)} in La@TeX{} mode. |
14169 |
Math formulas are often enclosed by @samp{$ $} signs in @TeX{} and |
Math formulas are often enclosed by @samp{$ $} signs in @TeX{} and |
14170 |
@LaTeX{}; these should be omitted when interfacing with Calc. To Calc, |
La@TeX{}; these should be omitted when interfacing with Calc. To Calc, |
14171 |
the @samp{$} sign has the same meaning it always does in algebraic |
the @samp{$} sign has the same meaning it always does in algebraic |
14172 |
formulas (a reference to an existing entry on the stack). |
formulas (a reference to an existing entry on the stack). |
14173 |
|
|
14174 |
Complex numbers are displayed as in @samp{3 + 4i}. Fractions and |
Complex numbers are displayed as in @samp{3 + 4i}. Fractions and |
14175 |
quotients are written using @code{\over} in @TeX{} mode (as in |
quotients are written using @code{\over} in @TeX{} mode (as in |
14176 |
@code{@{a \over b@}}) and @code{\frac} in @LaTeX{} mode (as in |
@code{@{a \over b@}}) and @code{\frac} in La@TeX{} mode (as in |
14177 |
@code{\frac@{a@}@{b@}}); binomial coefficients are written with |
@code{\frac@{a@}@{b@}}); binomial coefficients are written with |
14178 |
@code{\choose} in @TeX{} mode (as in @code{@{a \choose b@}}) and |
@code{\choose} in @TeX{} mode (as in @code{@{a \choose b@}}) and |
14179 |
@code{\binom} in @LaTeX{} mode (as in @code{\binom@{a@}@{b@}}). |
@code{\binom} in La@TeX{} mode (as in @code{\binom@{a@}@{b@}}). |
14180 |
Interval forms are written with @code{\ldots}, and error forms are |
Interval forms are written with @code{\ldots}, and error forms are |
14181 |
written with @code{\pm}. Absolute values are written as in |
written with @code{\pm}. Absolute values are written as in |
14182 |
@samp{|x + 1|}, and the floor and ceiling functions are written with |
@samp{|x + 1|}, and the floor and ceiling functions are written with |
14183 |
@code{\lfloor}, @code{\rfloor}, etc. The words @code{\left} and |
@code{\lfloor}, @code{\rfloor}, etc. The words @code{\left} and |
14184 |
@code{\right} are ignored when reading formulas in @TeX{} and @LaTeX{} |
@code{\right} are ignored when reading formulas in @TeX{} and La@TeX{} |
14185 |
modes. Both @code{inf} and @code{uinf} are written as @code{\infty}; |
modes. Both @code{inf} and @code{uinf} are written as @code{\infty}; |
14186 |
when read, @code{\infty} always translates to @code{inf}. |
when read, @code{\infty} always translates to @code{inf}. |
14187 |
|
|
14188 |
Function calls are written the usual way, with the function name followed |
Function calls are written the usual way, with the function name followed |
14189 |
by the arguments in parentheses. However, functions for which @TeX{} |
by the arguments in parentheses. However, functions for which @TeX{} |
14190 |
and @LaTeX{} have special names (like @code{\sin}) will use curly braces |
and La@TeX{} have special names (like @code{\sin}) will use curly braces |
14191 |
instead of parentheses for very simple arguments. During input, curly |
instead of parentheses for very simple arguments. During input, curly |
14192 |
braces and parentheses work equally well for grouping, but when the |
braces and parentheses work equally well for grouping, but when the |
14193 |
document is formatted the curly braces will be invisible. Thus the |
document is formatted the curly braces will be invisible. Thus the |
14198 |
@texline @math{\sin(2 + x)}. |
@texline @math{\sin(2 + x)}. |
14199 |
@infoline @expr{sin(2 + x)}. |
@infoline @expr{sin(2 + x)}. |
14200 |
|
|
14201 |
Function and variable names not treated specially by @TeX{} and @LaTeX{} |
Function and variable names not treated specially by @TeX{} and La@TeX{} |
14202 |
are simply written out as-is, which will cause them to come out in |
are simply written out as-is, which will cause them to come out in |
14203 |
italic letters in the printed document. If you invoke @kbd{d T} or |
italic letters in the printed document. If you invoke @kbd{d T} or |
14204 |
@kbd{d L} with a positive numeric prefix argument, names of more than |
@kbd{d L} with a positive numeric prefix argument, names of more than |
14205 |
one character will instead be enclosed in a protective commands that |
one character will instead be enclosed in a protective commands that |
14206 |
will prevent them from being typeset in the math italics; they will be |
will prevent them from being typeset in the math italics; they will be |
14207 |
written @samp{\hbox@{@var{name}@}} in @TeX{} mode and |
written @samp{\hbox@{@var{name}@}} in @TeX{} mode and |
14208 |
@samp{\text@{@var{name}@}} in @LaTeX{} mode. The |
@samp{\text@{@var{name}@}} in La@TeX{} mode. The |
14209 |
@samp{\hbox@{ @}} and @samp{\text@{ @}} notations are ignored during |
@samp{\hbox@{ @}} and @samp{\text@{ @}} notations are ignored during |
14210 |
reading. If you use a negative prefix argument, such function names are |
reading. If you use a negative prefix argument, such function names are |
14211 |
written @samp{\@var{name}}, and function names that begin with @code{\} during |
written @samp{\@var{name}}, and function names that begin with @code{\} during |
14216 |
|
|
14217 |
During reading, text of the form @samp{\matrix@{ ...@: @}} is replaced |
During reading, text of the form @samp{\matrix@{ ...@: @}} is replaced |
14218 |
by @samp{[ ...@: ]}. The same also applies to @code{\pmatrix} and |
by @samp{[ ...@: ]}. The same also applies to @code{\pmatrix} and |
14219 |
@code{\bmatrix}. In @LaTeX{} mode this also applies to |
@code{\bmatrix}. In La@TeX{} mode this also applies to |
14220 |
@samp{\begin@{matrix@} ... \end@{matrix@}}, |
@samp{\begin@{matrix@} ... \end@{matrix@}}, |
14221 |
@samp{\begin@{bmatrix@} ... \end@{bmatrix@}}, |
@samp{\begin@{bmatrix@} ... \end@{bmatrix@}}, |
14222 |
@samp{\begin@{pmatrix@} ... \end@{pmatrix@}}, as well as |
@samp{\begin@{pmatrix@} ... \end@{pmatrix@}}, as well as |
14226 |
During output, matrices are displayed in @samp{\matrix@{ a & b \\ c & d@}} |
During output, matrices are displayed in @samp{\matrix@{ a & b \\ c & d@}} |
14227 |
format in @TeX{} mode and in |
format in @TeX{} mode and in |
14228 |
@samp{\begin@{pmatrix@} a & b \\ c & d \end@{pmatrix@}} format in |
@samp{\begin@{pmatrix@} a & b \\ c & d \end@{pmatrix@}} format in |
14229 |
@LaTeX{} mode; you may need to edit this afterwards to change to your |
La@TeX{} mode; you may need to edit this afterwards to change to your |
14230 |
preferred matrix form. If you invoke @kbd{d T} or @kbd{d L} with an |
preferred matrix form. If you invoke @kbd{d T} or @kbd{d L} with an |
14231 |
argument of 2 or -2, then matrices will be displayed in two-dimensional |
argument of 2 or -2, then matrices will be displayed in two-dimensional |
14232 |
form, such as |
form, such as |
14250 |
@end example |
@end example |
14251 |
|
|
14252 |
@noindent |
@noindent |
14253 |
While this wouldn't bother Calc, it is incorrect @LaTeX{}. |
While this wouldn't bother Calc, it is incorrect La@TeX{}. |
14254 |
(Similarly for @TeX{}.) |
(Similarly for @TeX{}.) |
14255 |
|
|
14256 |
Accents like @code{\tilde} and @code{\bar} translate into function |
Accents like @code{\tilde} and @code{\bar} translate into function |
14258 |
sequence is treated as an accent. The @code{\vec} accent corresponds |
sequence is treated as an accent. The @code{\vec} accent corresponds |
14259 |
to the function name @code{Vec}, because @code{vec} is the name of |
to the function name @code{Vec}, because @code{vec} is the name of |
14260 |
a built-in Calc function. The following table shows the accents |
a built-in Calc function. The following table shows the accents |
14261 |
in Calc, @TeX{}, @LaTeX{} and @dfn{eqn} (described in the next section): |
in Calc, @TeX{}, La@TeX{} and @dfn{eqn} (described in the next section): |
14262 |
|
|
14263 |
@iftex |
@iftex |
14264 |
@begingroup |
@begingroup |
14433 |
@end example |
@end example |
14434 |
|
|
14435 |
Note that, because these symbols are ignored, reading a @TeX{} or |
Note that, because these symbols are ignored, reading a @TeX{} or |
14436 |
@LaTeX{} formula into Calc and writing it back out may lose spacing and |
La@TeX{} formula into Calc and writing it back out may lose spacing and |
14437 |
font information. |
font information. |
14438 |
|
|
14439 |
Also, the ``discretionary multiplication sign'' @samp{\*} is read |
Also, the ``discretionary multiplication sign'' @samp{\*} is read |
14604 |
symbol (these are used to introduce spaces of various widths into |
symbol (these are used to introduce spaces of various widths into |
14605 |
the typeset output of @dfn{eqn}). |
the typeset output of @dfn{eqn}). |
14606 |
|
|
14607 |
As in @LaTeX{} mode, Calc's formatter omits parentheses around the |
As in La@TeX{} mode, Calc's formatter omits parentheses around the |
14608 |
arguments of functions like @code{ln} and @code{sin} if they are |
arguments of functions like @code{ln} and @code{sin} if they are |
14609 |
``simple-looking''; in this case Calc surrounds the argument with |
``simple-looking''; in this case Calc surrounds the argument with |
14610 |
braces, separated by a @samp{~} from the function name: @samp{sin~@{x@}}. |
braces, separated by a @samp{~} from the function name: @samp{sin~@{x@}}. |
15936 |
@TeX{} language mode (@kbd{d T}; @pxref{TeX and LaTeX Language Modes}). |
@TeX{} language mode (@kbd{d T}; @pxref{TeX and LaTeX Language Modes}). |
15937 |
|
|
15938 |
@item LaTeX |
@item LaTeX |
15939 |
@LaTeX{} language mode (@kbd{d L}; @pxref{TeX and LaTeX Language Modes}). |
La@TeX{} language mode (@kbd{d L}; @pxref{TeX and LaTeX Language Modes}). |
15940 |
|
|
15941 |
@item Eqn |
@item Eqn |
15942 |
@dfn{Eqn} language mode (@kbd{d E}; @pxref{Eqn Language Mode}). |
@dfn{Eqn} language mode (@kbd{d E}; @pxref{Eqn Language Mode}). |
28350 |
@cindex @samp{=>} operator |
@cindex @samp{=>} operator |
28351 |
The special algebraic symbol @samp{=>} is known as the @dfn{evaluates-to |
The special algebraic symbol @samp{=>} is known as the @dfn{evaluates-to |
28352 |
operator}. (It will show up as an @code{evalto} function call in |
operator}. (It will show up as an @code{evalto} function call in |
28353 |
other language modes like Pascal and @LaTeX{}.) This is a binary |
other language modes like Pascal and La@TeX{}.) This is a binary |
28354 |
operator, that is, it has a lefthand and a righthand argument, |
operator, that is, it has a lefthand and a righthand argument, |
28355 |
although it can be entered with the righthand argument omitted. |
although it can be entered with the righthand argument omitted. |
28356 |
|
|
30005 |
When Embedded mode ``activates'' a formula, i.e., when it examines |
When Embedded mode ``activates'' a formula, i.e., when it examines |
30006 |
the formula for the first time since the buffer was created or |
the formula for the first time since the buffer was created or |
30007 |
loaded, Calc tries to sense the language in which the formula was |
loaded, Calc tries to sense the language in which the formula was |
30008 |
written. If the formula contains any @LaTeX{}-like @samp{\} sequences, |
written. If the formula contains any La@TeX{}-like @samp{\} sequences, |
30009 |
it is parsed (i.e., read) in @LaTeX{} mode. If the formula appears to |
it is parsed (i.e., read) in La@TeX{} mode. If the formula appears to |
30010 |
be written in multi-line Big mode, it is parsed in Big mode. Otherwise, |
be written in multi-line Big mode, it is parsed in Big mode. Otherwise, |
30011 |
it is parsed according to the current language mode. |
it is parsed according to the current language mode. |
30012 |
|
|
30013 |
Note that Calc does not change the current language mode according |
Note that Calc does not change the current language mode according |
30014 |
to what it finds. Even though it can read a @LaTeX{} formula when |
to what it finds. Even though it can read a La@TeX{} formula when |
30015 |
not in @LaTeX{} mode, it will immediately rewrite this formula using |
not in La@TeX{} mode, it will immediately rewrite this formula using |
30016 |
whatever language mode is in effect. You must then type @kbd{d L} |
whatever language mode is in effect. You must then type @kbd{d L} |
30017 |
to switch Calc permanently into @LaTeX{} mode if that is what you |
to switch Calc permanently into La@TeX{} mode if that is what you |
30018 |
desire. |
desire. |
30019 |
|
|
30020 |
@tex |
@tex |
30035 |
|
|
30036 |
Plain formulas are preceded and followed by @samp{%%%} signs |
Plain formulas are preceded and followed by @samp{%%%} signs |
30037 |
by default. This notation has the advantage that the @samp{%} |
by default. This notation has the advantage that the @samp{%} |
30038 |
character begins a comment in @TeX{} and @LaTeX{}, so if your formula is |
character begins a comment in @TeX{} and La@TeX{}, so if your formula is |
30039 |
embedded in a @TeX{} or @LaTeX{} document its plain version will be |
embedded in a @TeX{} or La@TeX{} document its plain version will be |
30040 |
invisible in the final printed copy. @xref{Customizing |
invisible in the final printed copy. @xref{Customizing |
30041 |
Embedded Mode}, to see how to change the ``plain'' formula |
Embedded Mode}, to see how to change the ``plain'' formula |
30042 |
delimiters, say to something that @dfn{eqn} or some other |
delimiters, say to something that @dfn{eqn} or some other |
30326 |
@noindent |
@noindent |
30327 |
where the leading and trailing @samp{---} can be replaced by |
where the leading and trailing @samp{---} can be replaced by |
30328 |
any suitable strings (which must be the same on all three lines) |
any suitable strings (which must be the same on all three lines) |
30329 |
or omitted altogether; in a @TeX{} or @LaTeX{} file, @samp{%} would be a good |
or omitted altogether; in a @TeX{} or La@TeX{} file, @samp{%} would be a good |
30330 |
leading string and no trailing string would be necessary. In a |
leading string and no trailing string would be necessary. In a |
30331 |
C program, @samp{/*} and @samp{*/} would be good leading and |
C program, @samp{/*} and @samp{*/} would be good leading and |
30332 |
trailing strings. |
trailing strings. |