@noindent
Type @kbd{d B} to view the solutions in more readable notation.
-Type @w{@kbd{d C}} to view them in C language notation, and @kbd{d T}
-to view them in the notation for the @TeX{} typesetting system.
-Type @kbd{d N} to return to normal notation.
+Type @w{@kbd{d C}} to view them in C language notation, @kbd{d T}
+to view them in the notation for the @TeX{} typesetting system,
+and @kbd{d L} to view them in the notation for the @LaTeX{} typesetting
+system. Type @kbd{d N} to return to normal notation.
@noindent
Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas.
Calc has added annotations to the file to help it remember the modes
that were used for this formula. They are formatted like comments
-in the @TeX{} typesetting language, just in case you are using @TeX{}.
-(In this example @TeX{} is not being used, so you might want to move
-these comments up to the top of the file or otherwise put them out
-of the way.)
+in the @TeX{} typesetting language, just in case you are using @TeX{} or
+@LaTeX{}. (In this example @TeX{} is not being used, so you might want
+to move these comments up to the top of the file or otherwise put them
+out of the way.)
As an extra flourish, we can add an equation number using a
righthand label: Type @kbd{d @} (1) @key{RET}}.
Here things like powers, square roots, and quotients and fractions
are displayed in a two-dimensional pictorial form. Calc has other
-language modes as well, such as C mode, FORTRAN mode, and @TeX{} mode.
+language modes as well, such as C mode, FORTRAN mode, @TeX{} mode
+and @LaTeX{} mode.
@smallexample
@group
@example
@group
Z ` 0 t 1
- 1 @key{TAB}
+ 1 TAB
Z ( & s + 1 1 Z )
r 1
Z '
@kindex M-# 0
@pindex calc-reset
The @kbd{M-# 0} command (@code{calc-reset}; that's @kbd{M-#} followed
-by a zero) resets the Calculator to its default state. This clears
-the stack, resets all the modes, clears the caches (@pxref{Caches}),
-and so on. (It does @emph{not} erase the values of any variables.)
-With a numeric prefix argument, @kbd{M-# 0} preserves the contents
-of the stack but resets everything else.
+by a zero) resets the Calculator to its initial state. This clears
+the stack, resets all the modes to their initial values (the values
+that were saved with @kbd{m m} (@code{calc-save-modes})), clears the
+caches (@pxref{Caches}), and so on. (It does @emph{not} erase the
+values of any variables.) With an argument of 0, Calc will be reset to
+its default state; namely, the modes will be given their default values.
+With a positive prefix argument, @kbd{M-# 0} preserves the contents of
+the stack but resets everything else to its initial state; with a
+negative prefix argument, @kbd{M-# 0} preserves the contents of the
+stack but resets everything else to its default state.
@pindex calc-version
The @kbd{M-x calc-version} command displays the current version number
the stack contains the sole number 5, but after @kbd{2 @key{RET} 3 K +},
the stack contains the arguments and the result: @samp{2 3 5}.
-This works for all commands that take arguments off the stack. As
-another example, @kbd{K a s} simplifies a formula, pushing the
+With the exception of keyboard macros, this works for all commands that
+take arguments off the stack. (To avoid potentially unpleasant behavior,
+a @kbd{K} prefix before a keyboard macro will be ignored. A @kbd{K}
+prefix called @emph{within} the keyboard macro will still take effect.)
+As another example, @kbd{K a s} simplifies a formula, pushing the
simplified version of the formula onto the stack after the original
-formula (rather than replacing the original formula).
-
-Note that you could get the same effect by typing @kbd{@key{RET} a s},
-copying the formula and then simplifying the copy. One difference
-is that for a very large formula the time taken to format the
-intermediate copy in @kbd{@key{RET} a s} could be noticeable; @kbd{K a s}
-would avoid this extra work.
+formula (rather than replacing the original formula). Note that you
+could get the same effect by typing @kbd{@key{RET} a s}, copying the
+formula and then simplifying the copy. One difference is that for a very
+large formula the time taken to format the intermediate copy in
+@kbd{@key{RET} a s} could be noticeable; @kbd{K a s} would avoid this
+extra work.
Even stack manipulation commands are affected. @key{TAB} works by
popping two values and pushing them back in the opposite order,
@kbd{K ' sin($)}. @xref{Algebraic Entry}. Also, the @kbd{s s}
command is effectively the same as @kbd{K s t}. @xref{Storing Variables}.
-Keyboard macros may interact surprisingly with the @kbd{K} prefix.
-If you have defined a keyboard macro to be, say, @samp{Q +} to add
-one number to the square root of another, then typing @kbd{K X} will
-execute @kbd{K Q +}, probably not what you expected. The @kbd{K}
-prefix will apply to just the first command in the macro rather than
-the whole macro.
-
If you execute a command and then decide you really wanted to keep
the argument, you can press @kbd{M-@key{RET}} (@code{calc-last-args}).
This command pushes the last arguments that were popped by any command
@cindex Continuous memory
@cindex Saving mode settings
@cindex Permanent mode settings
-@cindex @file{.emacs} file, mode settings
-You can save all of the current mode settings in your @file{.emacs} file
-with the @kbd{m m} (@code{calc-save-modes}) command. This will cause
-Emacs to reestablish these modes each time it starts up. The modes saved
-in the file include everything controlled by the @kbd{m} and @kbd{d}
-prefix keys, the current precision and binary word size, whether or not
-the trail is displayed, the current height of the Calc window, and more.
-The current interface (used when you type @kbd{M-# M-#}) is also saved.
-If there were already saved mode settings in the file, they are replaced.
-Otherwise, the new mode information is appended to the end of the file.
+@cindex Calc init file, mode settings
+You can save all of the current mode settings in your Calc init file
+(the file given by the variable @code{calc-settings-file}, typically
+@file{~/.calc.el}) with the @kbd{m m} (@code{calc-save-modes}) command.
+This will cause Emacs to reestablish these modes each time it starts up.
+The modes saved in the file include everything controlled by the @kbd{m}
+and @kbd{d} prefix keys, the current precision and binary word size,
+whether or not the trail is displayed, the current height of the Calc
+window, and more. The current interface (used when you type @kbd{M-#
+M-#}) is also saved. If there were already saved mode settings in the
+file, they are replaced. Otherwise, the new mode information is
+appended to the end of the file.
@kindex m R
@pindex calc-mode-record-mode
@kindex m F
@pindex calc-settings-file-name
The @kbd{m F} (@code{calc-settings-file-name}) command allows you to
-choose a different place than your @file{.emacs} file for @kbd{m m},
-@kbd{Z P}, and similar commands to save permanent information.
+choose a different file than the current value of @code{calc-settings-file}
+for @kbd{m m}, @kbd{Z P}, and similar commands to save permanent information.
You are prompted for a file name. All Calc modes are then reset to
their default values, then settings from the file you named are loaded
if this file exists, and this file becomes the one that Calc will
use in the future for commands like @kbd{m m}. The default settings
-file name is @file{~/.emacs}. You can see the current file name by
+file name is @file{~/.calc.el}. You can see the current file name by
giving a blank response to the @kbd{m F} prompt. See also the
discussion of the @code{calc-settings-file} variable; @pxref{Installation}.
-If the file name you give contains the string @samp{.emacs} anywhere
-inside it, @kbd{m F} will not automatically load the new file. This
-is because you are presumably switching to your @file{~/.emacs} file,
-which may contain other things you don't want to reread. You can give
+If the file name you give is your user init file (typically
+@file{~/.emacs}), @kbd{m F} will not automatically load the new file. This
+is because your user init file may contain other things you don't want
+to reread. You can give
a numeric prefix argument of 1 to @kbd{m F} to force it to read the
-file no matter what its name. Conversely, an argument of @mathit{-1} tells
+file no matter what. Conversely, an argument of @mathit{-1} tells
@kbd{m F} @emph{not} to read the new file. An argument of 2 or @mathit{-2}
tells @kbd{m F} not to reset the modes to their defaults beforehand,
which is useful if you intend your new file to have a variant of the
@noindent
The commands in this section change Calc to use a different notation for
entry and display of formulas, corresponding to the conventions of some
-other common language such as Pascal or @TeX{}. Objects displayed on the
+other common language such as Pascal or @LaTeX{}. Objects displayed on the
stack or yanked from the Calculator to an editing buffer will be formatted
in the current language; objects entered in algebraic entry or yanked from
another buffer will be interpreted according to the current language.
and would have written the formula back with notations (like implicit
multiplication) which would not have been legal for a C program.
-As another example, suppose you are maintaining a C program and a @TeX{}
+As another example, suppose you are maintaining a C program and a @LaTeX{}
document, each of which needs a copy of the same formula. You can grab the
-formula from the program in C mode, switch to @TeX{} mode, and yank the
-formula into the document in @TeX{} math-mode format.
+formula from the program in C mode, switch to @LaTeX{} mode, and yank the
+formula into the document in @LaTeX{} math-mode format.
Language modes are selected by typing the letter @kbd{d} followed by a
shifted letter key.
@menu
* Normal Language Modes::
* C FORTRAN Pascal::
-* TeX Language Mode::
+* TeX and LaTeX Language Modes::
* Eqn Language Mode::
* Mathematica Language Mode::
* Maple Language Mode::
(except that Mathematica mode expects square brackets instead of
parentheses).
-@node C FORTRAN Pascal, TeX Language Mode, Normal Language Modes, Language Modes
+@node C FORTRAN Pascal, TeX and LaTeX Language Modes, Normal Language Modes, Language Modes
@subsection C, FORTRAN, and Pascal Modes
@noindent
convert to lower-case on input. With a negative prefix, these modes
convert to lower-case for display and input.
-@node TeX Language Mode, Eqn Language Mode, C FORTRAN Pascal, Language Modes
-@subsection @TeX{} Language Mode
+@node TeX and LaTeX Language Modes, Eqn Language Mode, C FORTRAN Pascal, Language Modes
+@subsection @TeX{} and @LaTeX{} Language Modes
@noindent
@kindex d T
@pindex calc-tex-language
@cindex TeX language
+@kindex d L
+@pindex calc-latex-language
+@cindex LaTeX language
The @kbd{d T} (@code{calc-tex-language}) command selects the conventions
-of ``math mode'' in the @TeX{} typesetting language, by Donald Knuth.
-Formulas are entered
-and displayed in @TeX{} notation, as in @samp{\sin\left( a \over b \right)}.
-Math formulas are usually enclosed by @samp{$ $} signs in @TeX{}; these
-should be omitted when interfacing with Calc. To Calc, the @samp{$} sign
-has the same meaning it always does in algebraic formulas (a reference to
-an existing entry on the stack).
+of ``math mode'' in Donald Knuth's @TeX{} typesetting language,
+and the @kbd{d L} (@code{calc-latex-language}) command selects the
+conventions of ``math mode'' in @LaTeX{}, a typesetting language that
+uses @TeX{} as its formatting engine. Calc's @LaTeX{} language mode can
+read any formula that the @TeX{} language mode can, although @LaTeX{}
+mode may display it differently.
+
+Formulas are entered and displayed in the appropriate notation;
+@texline @math{\sin(a/b)}
+@infoline @expr{sin(a/b)}
+will appear as @samp{\sin\left( a \over b \right)} in @TeX{} mode and
+@samp{\sin\left(\frac@{a@}@{b@}\right)} in @LaTeX{} mode.
+Math formulas are often enclosed by @samp{$ $} signs in @TeX{} and
+@LaTeX{}; these should be omitted when interfacing with Calc. To Calc,
+the @samp{$} sign has the same meaning it always does in algebraic
+formulas (a reference to an existing entry on the stack).
Complex numbers are displayed as in @samp{3 + 4i}. Fractions and
-quotients are written using @code{\over};
-binomial coefficients are written with @code{\choose}.
-Interval forms are written with @code{\ldots}, and
-error forms are written with @code{\pm}.
-Absolute values are written as in @samp{|x + 1|}, and the floor and
-ceiling functions are written with @code{\lfloor}, @code{\rfloor}, etc.
-The words @code{\left} and @code{\right} are ignored when reading
-formulas in @TeX{} mode. Both @code{inf} and @code{uinf} are written
-as @code{\infty}; when read, @code{\infty} always translates to
-@code{inf}.
+quotients are written using @code{\over} in @TeX{} mode (as in
+@code{@{a \over b@}}) and @code{\frac} in @LaTeX{} mode (as in
+@code{\frac@{a@}@{b@}}); binomial coefficients are written with
+@code{\choose} in @TeX{} mode (as in @code{@{a \choose b@}}) and
+@code{\binom} in @LaTeX{} mode (as in @code{\binom@{a@}@{b@}}).
+Interval forms are written with @code{\ldots}, and error forms are
+written with @code{\pm}. Absolute values are written as in
+@samp{|x + 1|}, and the floor and ceiling functions are written with
+@code{\lfloor}, @code{\rfloor}, etc. The words @code{\left} and
+@code{\right} are ignored when reading formulas in @TeX{} and @LaTeX{}
+modes. Both @code{inf} and @code{uinf} are written as @code{\infty};
+when read, @code{\infty} always translates to @code{inf}.
Function calls are written the usual way, with the function name followed
-by the arguments in parentheses. However, functions for which @TeX{} has
-special names (like @code{\sin}) will use curly braces instead of
-parentheses for very simple arguments. During input, curly braces and
-parentheses work equally well for grouping, but when the document is
-formatted the curly braces will be invisible. Thus the printed result is
+by the arguments in parentheses. However, functions for which @TeX{}
+and @LaTeX{} have special names (like @code{\sin}) will use curly braces
+instead of parentheses for very simple arguments. During input, curly
+braces and parentheses work equally well for grouping, but when the
+document is formatted the curly braces will be invisible. Thus the
+printed result is
@texline @math{\sin{2 x}}
@infoline @expr{sin 2x}
but
@texline @math{\sin(2 + x)}.
@infoline @expr{sin(2 + x)}.
-Function and variable names not treated specially by @TeX{} are simply
-written out as-is, which will cause them to come out in italic letters
-in the printed document. If you invoke @kbd{d T} with a positive numeric
-prefix argument, names of more than one character will instead be written
-@samp{\hbox@{@var{name}@}}. The @samp{\hbox@{ @}} notation is ignored
-during reading. If you use a negative prefix argument, such function
-names are written @samp{\@var{name}}, and function names that begin
-with @code{\} during reading have the @code{\} removed. (Note that
-in this mode, long variable names are still written with @code{\hbox}.
-However, you can always make an actual variable name like @code{\bar}
-in any @TeX{} mode.)
+Function and variable names not treated specially by @TeX{} and @LaTeX{}
+are simply written out as-is, which will cause them to come out in
+italic letters in the printed document. If you invoke @kbd{d T} or
+@kbd{d L} with a positive numeric prefix argument, names of more than
+one character will instead be enclosed in a protective commands that
+will prevent them from being typeset in the math italics; they will be
+written @samp{\hbox@{@var{name}@}} in @TeX{} mode and
+@samp{\text@{@var{name}@}} in @LaTeX{} mode. The
+@samp{\hbox@{ @}} and @samp{\text@{ @}} notations are ignored during
+reading. If you use a negative prefix argument, such function names are
+written @samp{\@var{name}}, and function names that begin with @code{\} during
+reading have the @code{\} removed. (Note that in this mode, long
+variable names are still written with @code{\hbox} or @code{\text}.
+However, you can always make an actual variable name like @code{\bar} in
+any @TeX{} mode.)
During reading, text of the form @samp{\matrix@{ ...@: @}} is replaced
by @samp{[ ...@: ]}. The same also applies to @code{\pmatrix} and
-@code{\bmatrix}. The symbol @samp{&} is interpreted as a comma,
+@code{\bmatrix}. In @LaTeX{} mode this also applies to
+@samp{\begin@{matrix@} ... \end@{matrix@}},
+@samp{\begin@{bmatrix@} ... \end@{bmatrix@}},
+@samp{\begin@{pmatrix@} ... \end@{pmatrix@}}, as well as
+@samp{\begin@{smallmatrix@} ... \end@{smallmatrix@}}.
+The symbol @samp{&} is interpreted as a comma,
and the symbols @samp{\cr} and @samp{\\} are interpreted as semicolons.
During output, matrices are displayed in @samp{\matrix@{ a & b \\ c & d@}}
-format; you may need to edit this afterwards to change @code{\matrix}
-to @code{\pmatrix} or @code{\\} to @code{\cr}.
+format in @TeX{} mode and in
+@samp{\begin@{pmatrix@} a & b \\ c & d \end@{pmatrix@}} format in
+@LaTeX{} mode; you may need to edit this afterwards to change to your
+preferred matrix form. If you invoke @kbd{d T} or @kbd{d L} with an
+argument of 2 or -2, then matrices will be displayed in two-dimensional
+form, such as
+
+@example
+\begin@{pmatrix@}
+a & b \\
+c & d
+\end@{pmatrix@}
+@end example
+
+@noindent
+This may be convenient for isolated matrices, but could lead to
+expressions being displayed like
+
+@example
+\begin@{pmatrix@} \times x
+a & b \\
+c & d
+\end@{pmatrix@}
+@end example
+
+@noindent
+While this wouldn't bother Calc, it is incorrect @LaTeX{}.
+(Similarly for @TeX{}.)
Accents like @code{\tilde} and @code{\bar} translate into function
calls internally (@samp{tilde(x)}, @samp{bar(x)}). The @code{\underline}
sequence is treated as an accent. The @code{\vec} accent corresponds
to the function name @code{Vec}, because @code{vec} is the name of
a built-in Calc function. The following table shows the accents
-in Calc, @TeX{}, and @dfn{eqn} (described in the next section):
+in Calc, @TeX{}, @LaTeX{} and @dfn{eqn} (described in the next section):
@iftex
@begingroup
@ignore
@starindex
@end ignore
+@tindex Acute
+@ignore
+@starindex
+@end ignore
@tindex bar
@ignore
@starindex
@end ignore
+@tindex Bar
+@ignore
+@starindex
+@end ignore
@tindex breve
@ignore
@starindex
@end ignore
+@tindex Breve
+@ignore
+@starindex
+@end ignore
@tindex check
@ignore
@starindex
@end ignore
+@tindex Check
+@ignore
+@starindex
+@end ignore
+@tindex dddot
+@ignore
+@starindex
+@end ignore
+@tindex ddddot
+@ignore
+@starindex
+@end ignore
@tindex dot
@ignore
@starindex
@end ignore
+@tindex Dot
+@ignore
+@starindex
+@end ignore
@tindex dotdot
@ignore
@starindex
@end ignore
+@tindex DotDot
+@ignore
+@starindex
+@end ignore
@tindex dyad
@ignore
@starindex
@ignore
@starindex
@end ignore
+@tindex Grave
+@ignore
+@starindex
+@end ignore
@tindex hat
@ignore
@starindex
@end ignore
+@tindex Hat
+@ignore
+@starindex
+@end ignore
@tindex Prime
@ignore
@starindex
@ignore
@starindex
@end ignore
+@tindex Tilde
+@ignore
+@starindex
+@end ignore
@tindex under
@ignore
@starindex
@end ignore
@tindex Vec
+@ignore
+@starindex
+@end ignore
+@tindex VEC
@iftex
@endgroup
@end iftex
@example
-Calc TeX eqn
----- --- ---
-acute \acute
-bar \bar bar
-breve \breve
-check \check
-dot \dot dot
-dotdot \ddot dotdot
-dyad dyad
-grave \grave
-hat \hat hat
-Prime prime
-tilde \tilde tilde
-under \underline under
-Vec \vec vec
+Calc TeX LaTeX eqn
+---- --- ----- ---
+acute \acute \acute
+Acute \Acute
+bar \bar \bar bar
+Bar \Bar
+breve \breve \breve
+Breve \Breve
+check \check \check
+Check \Check
+dddot \dddot
+ddddot \ddddot
+dot \dot \dot dot
+Dot \Dot
+dotdot \ddot \ddot dotdot
+DotDot \Ddot
+dyad dyad
+grave \grave \grave
+Grave \Grave
+hat \hat \hat hat
+Hat \Hat
+Prime prime
+tilde \tilde \tilde tilde
+Tilde \Tilde
+under \underline \underline under
+Vec \vec \vec vec
+VEC \Vec
@end example
The @samp{=>} (evaluates-to) operator appears as a @code{\to} symbol:
\evalto
@end example
-Note that, because these symbols are ignored, reading a @TeX{} formula
-into Calc and writing it back out may lose spacing and font information.
+Note that, because these symbols are ignored, reading a @TeX{} or
+@LaTeX{} formula into Calc and writing it back out may lose spacing and
+font information.
Also, the ``discretionary multiplication sign'' @samp{\*} is read
the same as @samp{*}.
@sp 2
@end iftex
-@node Eqn Language Mode, Mathematica Language Mode, TeX Language Mode, Language Modes
+@node Eqn Language Mode, Mathematica Language Mode, TeX and LaTeX Language Modes, Language Modes
@subsection Eqn Language Mode
@noindent
symbol (these are used to introduce spaces of various widths into
the typeset output of @dfn{eqn}).
-As in @TeX{} mode, Calc's formatter omits parentheses around the
+As in @LaTeX{} mode, Calc's formatter omits parentheses around the
arguments of functions like @code{ln} and @code{sin} if they are
``simple-looking''; in this case Calc surrounds the argument with
braces, separated by a @samp{~} from the function name: @samp{sin~@{x@}}.
of quotes in @dfn{eqn}, but it is good enough for most uses.
Accent codes (@samp{@var{x} dot}) are handled by treating them as
-function calls (@samp{dot(@var{x})}) internally. @xref{TeX Language
-Mode}, for a table of these accent functions. The @code{prime} accent
-is treated specially if it occurs on a variable or function name:
-@samp{f prime prime @w{( x prime )}} is stored internally as
-@samp{f'@w{'}(x')}. For example, taking the derivative of @samp{f(2 x)}
-with @kbd{a d x} will produce @samp{2 f'(2 x)}, which @dfn{eqn} mode
-will display as @samp{2 f prime ( 2 x )}.
+function calls (@samp{dot(@var{x})}) internally.
+@xref{TeX and LaTeX Language Modes}, for a table of these accent
+functions. The @code{prime} accent is treated specially if it occurs on
+a variable or function name: @samp{f prime prime @w{( x prime )}} is
+stored internally as @samp{f'@w{'}(x')}. For example, taking the
+derivative of @samp{f(2 x)} with @kbd{a d x} will produce @samp{2 f'(2
+x)}, which @dfn{eqn} mode will display as @samp{2 f prime ( 2 x )}.
Assignments are written with the @samp{<-} (left-arrow) symbol,
and @code{evalto} operators are written with @samp{->} or
-@samp{evalto ... ->} (@pxref{TeX Language Mode}, for a discussion
+@samp{evalto ... ->} (@pxref{TeX and LaTeX Language Modes}, for a discussion
of this). The regular Calc symbols @samp{:=} and @samp{=>} are also
recognized for these operators during reading.
FORTRAN language mode (@kbd{d F}).
@item TeX
-@TeX{} language mode (@kbd{d T}; @pxref{TeX Language Mode}).
+@TeX{} language mode (@kbd{d T}; @pxref{TeX and LaTeX Language Modes}).
+
+@item LaTeX
+@LaTeX{} language mode (@kbd{d L}; @pxref{TeX and LaTeX Language Modes}).
@item Eqn
@dfn{Eqn} language mode (@kbd{d E}; @pxref{Eqn Language Mode}).
Selections show deep structure (@kbd{j b}; @pxref{Making Selections}).
@item Save
-Record modes in @file{~/.emacs} (@kbd{m R}; @pxref{General Mode Commands}).
+Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
@item Local
Record modes in Embedded buffer (@kbd{m R}).
@kindex u p
@pindex calc-permanent-units
-@cindex @file{.emacs} file, user-defined units
+@cindex Calc init file, user-defined units
The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined
-units in your @file{.emacs} file, so that the units will still be
-available in subsequent Emacs sessions. If there was already a set of
-user-defined units in your @file{.emacs} file, it is replaced by the
-new set. (@xref{General Mode Commands}, for a way to tell Calc to use
-a different file instead of @file{.emacs}.)
+units in your Calc init file (the file given by the variable
+@code{calc-settings-file}, typically @file{~/.calc.el}), so that the
+units will still be available in subsequent Emacs sessions. If there
+was already a set of user-defined units in your Calc init file, it
+is replaced by the new set. (@xref{General Mode Commands}, for a way to
+tell Calc to use a different file for the Calc init file.)
@node Store and Recall, Graphics, Units, Top
@chapter Storing and Recalling
@pindex calc-permanent-variable
@cindex Storing variables
@cindex Permanent variables
-@cindex @file{.emacs} file, variables
+@cindex Calc init file, variables
The @kbd{s p} (@code{calc-permanent-variable}) command saves a
-variable's value permanently in your @file{.emacs} file, so that its
-value will still be available in future Emacs sessions. You can
-re-execute @w{@kbd{s p}} later on to update the saved value, but the
-only way to remove a saved variable is to edit your @file{.emacs} file
+variable's value permanently in your Calc init file (the file given by
+the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so
+that its value will still be available in future Emacs sessions. You
+can re-execute @w{@kbd{s p}} later on to update the saved value, but the
+only way to remove a saved variable is to edit your calc init file
by hand. (@xref{General Mode Commands}, for a way to tell Calc to
-use a different file instead of @file{.emacs}.)
+use a different file for the Calc init file.)
If you do not specify the name of a variable to save (i.e.,
@kbd{s p @key{RET}}), all Calc variables with defined values
The variables are written with the prefix @code{var-} in the form of
Lisp @code{setq} commands
which store the values in string form. You can place these commands
-in your @file{.emacs} buffer if you wish, though in this case it
+in your Calc init file (or @file{.emacs}) if you wish, though in this case it
would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i}
omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference
is that @kbd{s i} will store the variables in any buffer, and it also
@cindex @samp{=>} operator
The special algebraic symbol @samp{=>} is known as the @dfn{evaluates-to
operator}. (It will show up as an @code{evalto} function call in
-other language modes like Pascal and @TeX{}.) This is a binary
+other language modes like Pascal and @LaTeX{}.) This is a binary
operator, that is, it has a lefthand and a righthand argument,
although it can be entered with the righthand argument omitted.
(@code{calc-assign}) [@code{assign}] command which takes a variable
and value from the stack and replaces them with an assignment.
-@xref{TeX Language Mode}, for the way @samp{=>} appears in
+@xref{TeX and LaTeX Language Modes}, for the way @samp{=>} appears in
@TeX{} language output. The @dfn{eqn} mode gives similar
treatment to @samp{=>}.
@vindex calc-gnuplot-name
If you have GNUPLOT installed on your system but Calc is unable to
find it, you may need to set the @code{calc-gnuplot-name} variable
-in your @file{.emacs} file. You may also need to set some Lisp
+in your Calc init file or @file{.emacs}. You may also need to set some Lisp
variables to show Calc how to run GNUPLOT on your system; these
are described under @kbd{g D} and @kbd{g O} below. If you are
using the X window system, Calc will configure GNUPLOT for you
The @TeX{} and La@TeX{} math delimiters @samp{$ $}, @samp{$$ $$},
@samp{\[ \]}, and @samp{\( \)};
@item
-Lines beginning with @samp{\begin} and @samp{\end};
+Lines beginning with @samp{\begin} and @samp{\end} (except matrix delimiters);
@item
Lines beginning with @samp{@@} (Texinfo delimiters).
@item
When Embedded mode ``activates'' a formula, i.e., when it examines
the formula for the first time since the buffer was created or
loaded, Calc tries to sense the language in which the formula was
-written. If the formula contains any @TeX{}-like @samp{\} sequences,
-it is parsed (i.e., read) in @TeX{} mode. If the formula appears to
+written. If the formula contains any @LaTeX{}-like @samp{\} sequences,
+it is parsed (i.e., read) in @LaTeX{} mode. If the formula appears to
be written in multi-line Big mode, it is parsed in Big mode. Otherwise,
it is parsed according to the current language mode.
Note that Calc does not change the current language mode according
-to what it finds. Even though it can read a @TeX{} formula when
-not in @TeX{} mode, it will immediately rewrite this formula using
-whatever language mode is in effect. You must then type @kbd{d T}
-to switch Calc permanently into @TeX{} mode if that is what you
+to what it finds. Even though it can read a @LaTeX{} formula when
+not in @LaTeX{} mode, it will immediately rewrite this formula using
+whatever language mode is in effect. You must then type @kbd{d L}
+to switch Calc permanently into @LaTeX{} mode if that is what you
desire.
@tex
Plain formulas are preceded and followed by @samp{%%%} signs
by default. This notation has the advantage that the @samp{%}
-character begins a comment in @TeX{}, so if your formula is
-embedded in a @TeX{} document its plain version will be
+character begins a comment in @TeX{} and @LaTeX{}, so if your formula is
+embedded in a @TeX{} or @LaTeX{} document its plain version will be
invisible in the final printed copy. @xref{Customizing
Embedded Mode}, to see how to change the ``plain'' formula
delimiters, say to something that @dfn{eqn} or some other
@noindent
where the leading and trailing @samp{---} can be replaced by
any suitable strings (which must be the same on all three lines)
-or omitted altogether; in a @TeX{} file, @samp{%} would be a good
+or omitted altogether; in a @TeX{} or @LaTeX{} file, @samp{%} would be a good
leading string and no trailing string would be necessary. In a
C program, @samp{/*} and @samp{*/} would be good leading and
trailing strings.
Two more mode-recording modes selectable by @kbd{m R} are @code{Save}
(which works even outside of Embedded mode), in which mode settings
-are recorded permanently in your Emacs startup file @file{~/.emacs}
+are recorded permanently in your Calc init file (the file given by the
+variable @code{calc-settings-file}, typically @file{~/.calc.el})
rather than by annotating the current document, and no-recording
mode (where there is no symbol like @code{Save} or @code{Local} in
the mode line), in which mode-changing commands do not leave any
You can modify Embedded mode's behavior by setting various Lisp
variables described here. Use @kbd{M-x set-variable} or
@kbd{M-x edit-options} to adjust a variable on the fly, or
-put a suitable @code{setq} statement in your @file{~/.emacs}
-file to set a variable permanently. (Another possibility would
+put a suitable @code{setq} statement in your Calc init file (or
+@file{~/.emacs}) to set a variable permanently. (Another possibility would
be to use a file-local variable annotation at the end of the
file; @pxref{File Variables, , Local Variables in Files, emacs, the
Emacs manual}.)
@pindex calc-user-define-permanent
@cindex Storing user definitions
@cindex Permanent user definitions
-@cindex @file{.emacs} file, user-defined commands
+@cindex Calc init file, user-defined commands
The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key
binding permanent so that it will remain in effect even in future Emacs
sessions. (It does this by adding a suitable bit of Lisp code into
-your @file{.emacs} file.) For example, @kbd{Z P s} would register
-our @code{sincos} command permanently. If you later wish to unregister
-this command you must edit your @file{.emacs} file by hand.
-(@xref{General Mode Commands}, for a way to tell Calc to use a
-different file instead of @file{.emacs}.)
+your Calc init file; that is, the file given by the variable
+@code{calc-settings-file}, typically @file{~/.calc.el}.) For example,
+@kbd{Z P s} would register our @code{sincos} command permanently. If
+you later wish to unregister this command you must edit your Calc init
+file by hand. (@xref{General Mode Commands}, for a way to tell Calc to
+use a different file for the Calc init file.)
The @kbd{Z P} command also saves the user definition, if any, for the
command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user
:"n * myfact(n-1)"
@end example
+A good place to put your @code{defmath} commands is your Calc init file
+(the file given by @code{calc-settings-file}, typically
+@file{~/.calc.el}), which will not be loaded until Calc starts.
If a file named @file{.emacs} exists in your home directory, Emacs reads
and executes the Lisp forms in this file as it starts up. While it may
-seem like a good idea to put your favorite @code{defmath} commands here,
+seem reasonable to put your favorite @code{defmath} commands there,
this has the unfortunate side-effect that parts of the Calculator must be
loaded in to process the @code{defmath} commands whether or not you will
-actually use the Calculator! A better effect can be had by writing
+actually use the Calculator! If you want to put the @code{defmath}
+commands there (for example, if you redefine @code{calc-settings-file}
+to be @file{.emacs}), a better effect can be had by writing
@example
(put 'calc-define 'thing '(progn
@defvar calc-mode-save-hook
This hook is called by the @code{calc-save-modes} command,
after Calc's own mode features have been inserted into the
-@file{.emacs} buffer and just before the ``End of mode settings''
+Calc init file and just before the ``End of mode settings''
message is inserted.
@end defvar
Another variable you might want to set is @code{calc-settings-file},
which holds the file name in which commands like @kbd{m m} and @kbd{Z P}
store ``permanent'' definitions. The default value for this variable
-is @code{"~/.emacs"}. If @code{calc-settings-file} does not contain
-@code{".emacs"} as a substring, and if the variable
+is @code{"~/.calc.el"}. If @code{calc-settings-file} is not your user
+init file (typically @file{~/.emacs}) and if the variable
@code{calc-loaded-settings-file} is @code{nil}, then Calc will
automatically load your settings file (if it exists) the first time
Calc is invoked.
@r{ @: d O @: @: 50 @:calc-flat-language@:}
@r{ @: d P @: @: 50 @:calc-pascal-language@:}
@r{ @: d T @: @: 50 @:calc-tex-language@:}
+@r{ @: d L @: @: 50 @:calc-latex-language@:}
@r{ @: d U @: @: 50 @:calc-unformatted-language@:}
@r{ @: d W @: @: 50 @:calc-maple-language@:}
corresponding Lisp variable.
The remaining variables are Lisp variables suitable for @code{setq}ing
-in your @file{.emacs} file.
+in your Calc init file or @file{.emacs} file.
@printindex vr