]> code.delx.au - gnu-emacs/blobdiff - man/calc.texi
(TeX Language Mode): Add mention of LaTeX mode, and change name to
[gnu-emacs] / man / calc.texi
index c4affa649f3699e472b02335542a3d2de08f9e6e..9912d1a81c1240c23b3ecc10a2a20e1249a38fcd 100644 (file)
@@ -734,9 +734,10 @@ these equations for the variables @expr{x} and @expr{y}.
 
 @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.
@@ -1119,10 +1120,10 @@ is
 
 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}}.
@@ -2331,9 +2332,8 @@ key.  If you type a prefix key by accident, you can press @kbd{C-g}
 to cancel it.  (In fact, you can press @kbd{C-g} to cancel almost
 anything in Emacs.)  To get help on a prefix key, press that key
 followed by @kbd{?}.  Some prefixes have several lines of help,
-so you need to press @kbd{?} repeatedly to see them all.  This may
-not work under Lucid Emacs, but you can also type @kbd{h h} to
-see all the help at once.
+so you need to press @kbd{?} repeatedly to see them all.  
+You can also type @kbd{h h} to see all the help at once.
 
 Try pressing @kbd{t ?} now.  You will see a line of the form,
 
@@ -2666,7 +2666,7 @@ fit on a typical screen, either, so you will have to use horizontal
 scrolling to see them all.  Press @kbd{<} and @kbd{>} to scroll the
 stack window left and right by half its width.  Another way to view
 something large is to press @kbd{`} (back-quote) to edit the top of
-stack in a separate window.  (Press @kbd{M-# M-#} when you are done.)
+stack in a separate window.  (Press @kbd{C-c C-c} when you are done.)
 
 You can enter non-decimal numbers using the @kbd{#} symbol, too.
 Let's see what the hexadecimal number @samp{5FE} looks like in
@@ -5217,7 +5217,8 @@ One more mode that makes reading formulas easier is Big mode.
 
 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
@@ -5588,8 +5589,8 @@ having to retype it.
 @end smallexample
 
 To edit a variable, type @kbd{s e} and the variable name, use regular
-Emacs editing commands as necessary, then type @kbd{M-# M-#} or
-@kbd{C-c C-c} to store the edited value back into the variable.
+Emacs editing commands as necessary, then type @kbd{C-c C-c} to store
+the edited value back into the variable. 
 You can also use @w{@kbd{s e}} to create a new variable if you wish.
 
 Notice that the first time you use each rule, Calc puts up a ``compiling''
@@ -5859,15 +5860,7 @@ is one or more non-sum terms separated by @samp{+} or @samp{-} signs,
 so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
 @xref{Rewrites Answer 5, 5}. (@bullet{})
 
-(@bullet{}) @strong{Exercise 6.}  Calc considers the form @expr{0^0}
-to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite
-mode is not enabled).  Some people prefer to define @expr{0^0 = 1},
-so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}.
-Find a way to make Calc follow this convention.  What happens if you
-now type @kbd{m i} to turn on Infinite mode?
-@xref{Rewrites Answer 6, 6}. (@bullet{})
-
-(@bullet{}) @strong{Exercise 7.}  A Taylor series for a function is an
+(@bullet{}) @strong{Exercise 6.}  A Taylor series for a function is an
 infinite series that exactly equals the value of that function at
 values of @expr{x} near zero.
 
@@ -5913,9 +5906,12 @@ on the stack, we want to be able to type @kbd{*} and get the result
 rearranged or if @kbd{a s} needs to be typed after rewriting.  (This one
 is rather tricky; the solution at the end of this chapter uses 6 rewrite
 rules.  Hint:  The @samp{constant(x)} condition tests whether @samp{x} is
-a number.)  @xref{Rewrites Answer 7, 7}. (@bullet{})
+a number.)  @xref{Rewrites Answer 6, 6}. (@bullet{})
+
+Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
+What happens?  (Be sure to remove this rule afterward, or you might get
+a nasty surprise when you use Calc to balance your checkbook!)
 
-@c [fix-ref Rewrite Rules]
 @xref{Rewrite Rules}, for the whole story on rewrite rules.
 
 @node Programming Tutorial, Answers to Exercises, Algebra Tutorial, Tutorial
@@ -5929,9 +5925,6 @@ system.  But Lisp and rewrite rules take a while to master, and often
 all you want to do is define a new function or repeat a command a few
 times.  Calc has features that allow you to do these things easily.
 
-(Note that the programming commands relating to user-defined keys
-are not yet supported under Lucid Emacs 19.)
-
 One very limited form of programming is defining your own functions.
 Calc's @kbd{Z F} command allows you to define a function name and
 key sequence to correspond to any formula.  Programming commands use
@@ -5993,8 +5986,9 @@ which in algebraic notation is written like @samp{ninteg(f(t), t, 0, x)}
 with any integrand @samp{f(t)}.  Define a @kbd{z s} command and
 @code{Si} function that implement this.  You will need to edit the
 default argument list a bit.  As a test, @samp{Si(1)} should return
-0.946083.  (Hint:  @code{ninteg} will run a lot faster if you reduce
-the precision to, say, six digits beforehand.)
+0.946083. (If you don't get this answer, you might want to check that
+Calc is in Radians mode.  Also, @code{ninteg} will run a lot faster if
+you reduce the precision to, say, six digits beforehand.)
 @xref{Programming Answer 1, 1}. (@bullet{})
 
 The simplest way to do real ``programming'' of Emacs is to define a
@@ -6333,55 +6327,56 @@ then enter the real one in the edit command.
 
 @smallexample
 @group
-1:  3                   1:  3           Keyboard Macro Editor.
-    .                       .           Original keys: 1 @key{RET} 2 +
+1:  3                   1:  3           Calc Macro Edit Mode.
+    .                       .           Original keys: 1 <return> 2 +
 
-                                        type "1\r"
-                                        type "2"
-                                        calc-plus
+                                        1                          ;; calc digits
+                                        RET                        ;; calc-enter
+                                        2                          ;; calc digits
+                                        +                          ;; calc-plus
 
 C-x ( 1 @key{RET} 2 + C-x )    Z K h @key{RET}      Z E h
 @end group
 @end smallexample
 
 @noindent
-This shows the screen display assuming you have the @file{macedit}
-keyboard macro editing package installed, which is usually the case
-since a copy of @file{macedit} comes bundled with Calc.
-
 A keyboard macro is stored as a pure keystroke sequence.  The
-@file{macedit} package (invoked by @kbd{Z E}) scans along the
+@file{edmacro} package (invoked by @kbd{Z E}) scans along the
 macro and tries to decode it back into human-readable steps.
-If a key or keys are simply shorthand for some command with a
-@kbd{M-x} name, that name is shown.  Anything that doesn't correspond
-to a @kbd{M-x} command is written as a @samp{type} command.
+Descriptions of the keystrokes are given as comments, which begin with
+@samp{;;}, and which are ignored when the edited macro is saved.
+Spaces and line breaks are also ignored when the edited macro is saved.
+To enter a space into the macro, type @code{SPC}.  All the special
+characters @code{RET}, @code{LFD}, @code{TAB}, @code{SPC}, @code{DEL},
+and @code{NUL} must be written in all uppercase, as must the prefixes
+@code{C-} and @code{M-}.
 
 Let's edit in a new definition, for computing harmonic numbers.
-First, erase the three lines of the old definition.  Then, type
+First, erase the four lines of the old definition.  Then, type
 in the new definition (or use Emacs @kbd{M-w} and @kbd{C-y} commands
-to copy it from this page of the Info file; you can skip typing
-the comments that begin with @samp{#}).
+to copy it from this page of the Info file; you can of course skip
+typing the comments, which begin with @samp{;;}).
 
 @smallexample
-calc-kbd-push         # Save local values (Z `)
-type "0"              # Push a zero
-calc-store-into       # Store it in variable 1
-type "1"
-type "1"              # Initial value for loop
-calc-roll-down        # This is the @key{TAB} key; swap initial & final
-calc-kbd-for          # Begin "for" loop...
-calc-inv              #   Take reciprocal
-calc-store-plus       #   Add to accumulator
-type "1"
-type "1"              #   Loop step is 1
-calc-kbd-end-for      # End "for" loop
-calc-recall           # Now recall final accumulated value
-type "1"
-calc-kbd-pop          # Restore values (Z ')
+Z`                      ;; calc-kbd-push     (Save local values)
+0                       ;; calc digits       (Push a zero onto the stack)
+st                      ;; calc-store-into   (Store it in the following variable)
+1                       ;; calc quick variable  (Quick variable q1)
+1                       ;; calc digits       (Initial value for the loop) 
+TAB                     ;; calc-roll-down    (Swap initial and final)
+Z(                      ;; calc-kbd-for      (Begin the "for" loop)
+&                       ;; calc-inv          (Take the reciprocal)
+s+                      ;; calc-store-plus   (Add to the following variable)
+1                       ;; calc quick variable  (Quick variable q1)
+1                       ;; calc digits       (The loop step is 1)
+Z)                      ;; calc-kbd-end-for  (End the "for" loop)
+sr                      ;; calc-recall       (Recall the final accumulated value)
+1                       ;; calc quick variable (Quick variable q1)
+Z'                      ;; calc-kbd-pop      (Restore values)
 @end smallexample
 
 @noindent
-Press @kbd{M-# M-#} to finish editing and return to the Calculator.
+Press @kbd{C-c C-c} to finish editing and return to the Calculator.
 
 @smallexample
 @group
@@ -6392,21 +6387,18 @@ Press @kbd{M-# M-#} to finish editing and return to the Calculator.
 @end group
 @end smallexample
 
-If you don't know how to write a particular command in @file{macedit}
-format, you can always write it as keystrokes in a @code{type} command.
-There is also a @code{keys} command which interprets the rest of the
-line as standard Emacs keystroke names.  In fact, @file{macedit} defines
-a handy @code{read-kbd-macro} command which reads the current region
-of the current buffer as a sequence of keystroke names, and defines that
-sequence on the @kbd{X} (and @kbd{C-x e}) key.  Because this is so
-useful, Calc puts this command on the @kbd{M-# m} key.  Try reading in
-this macro in the following form:  Press @kbd{C-@@} (or @kbd{C-@key{SPC}}) at
+The @file{edmacro} package defines a handy @code{read-kbd-macro} command
+which reads the current region of the current buffer as a sequence of
+keystroke names, and defines that sequence on the @kbd{X} 
+(and @kbd{C-x e}) key.  Because this is so useful, Calc puts this
+command on the @kbd{M-# m} key.  Try reading in this macro in the
+following form:  Press @kbd{C-@@} (or @kbd{C-@key{SPC}}) at 
 one end of the text below, then type @kbd{M-# m} at the other.
 
 @example
 @group
 Z ` 0 t 1
-    1 @key{TAB}
+    1 TAB
     Z (  & s + 1  1 Z )
     r 1
 Z '
@@ -6645,8 +6637,7 @@ This section includes answers to all the exercises in the Calc tutorial.
 * Rewrites Answer 3::      Rewriting opt(a) + opt(b) x
 * Rewrites Answer 4::      Sequence of integers
 * Rewrites Answer 5::      Number of terms in sum
-* Rewrites Answer 6::      Defining 0^0 = 1
-* Rewrites Answer 7::      Truncated Taylor series
+* Rewrites Answer 6::      Truncated Taylor series
 * Programming Answer 1::   Fresnel's C(x)
 * Programming Answer 2::   Negate third stack element
 * Programming Answer 3::   Compute sin(x) / x, etc.
@@ -9096,48 +9087,9 @@ Here we have taken advantage of the fact that earlier rules always
 match before later rules; @samp{nterms(x)} will only be tried if we
 already know that @samp{x} is not a sum.
 
-@node Rewrites Answer 6, Rewrites Answer 7, Rewrites Answer 5, Answers to Exercises
+@node Rewrites Answer 6, Programming Answer 1, Rewrites Answer 5, Answers to Exercises
 @subsection Rewrites Tutorial Exercise 6
 
-Just put the rule @samp{0^0 := 1} into @code{EvalRules}.  For example,
-before making this definition we have:
-
-@smallexample
-@group
-2:  [-2, -1, 0, 1, 2]                1:  [1, 1, 0^0, 1, 1]
-1:  0                                    .
-    .
-
-    v x 5 @key{RET}  3 -  0                    V M ^
-@end group
-@end smallexample
-
-@noindent
-But then:
-
-@smallexample
-@group
-2:  [-2, -1, 0, 1, 2]                1:  [1, 1, 1, 1, 1]
-1:  0                                    .
-    .
-
-    U  ' 0^0:=1 @key{RET} s t EvalRules @key{RET}    V M ^
-@end group
-@end smallexample
-
-Perhaps more surprisingly, this rule still works with Infinite mode
-turned on.  Calc tries @code{EvalRules} before any built-in rules for
-a function.  This allows you to override the default behavior of any
-Calc feature:  Even though Calc now wants to evaluate @expr{0^0} to
-@code{nan}, your rule gets there first and evaluates it to 1 instead.
-
-Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
-What happens?  (Be sure to remove this rule afterward, or you might get
-a nasty surprise when you use Calc to balance your checkbook!)
-
-@node Rewrites Answer 7, Programming Answer 1, Rewrites Answer 6, Answers to Exercises
-@subsection Rewrites Tutorial Exercise 7
-
 @noindent
 Here is a rule set that will do the job:
 
@@ -9210,7 +9162,7 @@ for a way to do this in Calc, although for something as involved as
 this it would probably be better to write the formatting routine
 in Lisp.)
 
-@node Programming Answer 1, Programming Answer 2, Rewrites Answer 7, Answers to Exercises
+@node Programming Answer 1, Programming Answer 2, Rewrites Answer 6, Answers to Exercises
 @subsection Programming Tutorial Exercise 1
 
 @noindent
@@ -10031,11 +9983,16 @@ height of the Calc window.
 @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
@@ -11714,7 +11671,13 @@ or formula.)  A variable's name is normally composed of letters and digits.
 Calc also allows apostrophes and @code{#} signs in variable names.
 (The Calc variable @code{foo} corresponds to the Emacs Lisp variable
 @code{var-foo}, but unless you access the variable from within Emacs
-Lisp, you don't need to worry about it.)
+Lisp, you don't need to worry about it.  Variable names in algebraic
+formulas implicitly have @samp{var-} prefixed to their names.  The
+@samp{#} character in variable names used in algebraic formulas
+corresponds to a dash @samp{-} in the Lisp variable name.  If the name
+contains any dashes, the prefix @samp{var-} is @emph{not} automatically
+added.  Thus the two formulas @samp{foo + 1} and @samp{var#foo + 1} both
+refer to the same variable.)
 
 In a command that takes a variable name, you can either type the full
 name of a variable, or type a single digit to use one of the special
@@ -11727,14 +11690,6 @@ To push a variable itself (as opposed to the variable's value) on the
 stack, enter its name as an algebraic expression using the apostrophe
 (@key{'}) key.
 
-xxx
-  Variable names in algebraic formulas implicitly have
-@samp{var-} prefixed to their names.  The @samp{#} character in variable
-names used in algebraic formulas corresponds to a dash @samp{-} in the
-Lisp variable name.  If the name contains any dashes, the prefix @samp{var-}
-is @emph{not} automatically added.  Thus the two formulas @samp{foo + 1}
-and @samp{var#foo + 1} both refer to the same variable.
-
 @kindex =
 @pindex calc-evaluate
 @cindex Evaluation of variables in a formula
@@ -11886,10 +11841,10 @@ an infix operator preferentially (modulo, in this case), so you would
 need to write @samp{(5%)-2} to get the former interpretation.
 
 @cindex Function call notation
-A function call is, e.g., @samp{sin(1+x)}.  Function names follow the same
-rules as variable names except that the default prefix @samp{calcFunc-} is
-used (instead of @samp{var-}) for the internal Lisp form.
-Most mathematical Calculator commands like
+A function call is, e.g., @samp{sin(1+x)}.  (The Calc algebraic function
+@code{foo} corresponds to the Emacs Lisp function @code{calcFunc-foo},
+but unless you access the function from within Emacs Lisp, you don't
+need to worry about it.)  Most mathematical Calculator commands like
 @code{calc-sin} have function equivalents like @code{sin}.
 If no Lisp function is defined for a function called by a formula, the
 call is left as it is during algebraic manipulation: @samp{f(x+y)} is
@@ -12061,13 +12016,11 @@ regular Emacs commands.  With a numeric prefix argument, it edits the
 specified number of stack entries at once.  (An argument of zero edits
 the entire stack; a negative argument edits one specific stack entry.)
 
-When you are done editing, press @kbd{M-# M-#} to finish and return
+When you are done editing, press @kbd{C-c C-c} to finish and return
 to Calc.  The @key{RET} and @key{LFD} keys also work to finish most
 sorts of editing, though in some cases Calc leaves @key{RET} with its
 usual meaning (``insert a newline'') if it's a situation where you
-might want to insert new lines into the editing buffer.  The traditional
-Emacs ``finish'' key sequence, @kbd{C-c C-c}, also works to finish
-editing and may be easier to type, depending on your keyboard.
+might want to insert new lines into the editing buffer.
 
 When you finish editing, the Calculator parses the lines of text in
 the @samp{*Calc Edit*} buffer as numbers or formulas, replaces the
@@ -12075,18 +12028,18 @@ original stack elements in the original buffer with these new values,
 then kills the @samp{*Calc Edit*} buffer.  The original Calculator buffer
 continues to exist during editing, but for best results you should be
 careful not to change it until you have finished the edit.  You can
-also cancel the edit by pressing @kbd{M-# x}.
+also cancel the edit by killing the buffer with @kbd{C-x k}.
 
 The formula is normally reevaluated as it is put onto the stack.
 For example, editing @samp{a + 2} to @samp{3 + 2} and pressing
-@kbd{M-# M-#} will push 5 on the stack.  If you use @key{LFD} to
+@kbd{C-c C-c} will push 5 on the stack.  If you use @key{LFD} to
 finish, Calc will put the result on the stack without evaluating it.
 
-If you give a prefix argument to @kbd{M-# M-#} (or @kbd{C-c C-c}),
+If you give a prefix argument to @kbd{C-c C-c},
 Calc will not kill the @samp{*Calc Edit*} buffer.  You can switch
 back to that buffer and continue editing if you wish.  However, you
 should understand that if you initiated the edit with @kbd{`}, the
-@kbd{M-# M-#} operation will be programmed to replace the top of the
+@kbd{C-c C-c} operation will be programmed to replace the top of the
 stack with the new edited value, and it will do this even if you have
 rearranged the stack in the meanwhile.  This is not so much of a problem
 with other editing commands, though, such as @kbd{s e}
@@ -12235,16 +12188,18 @@ arguments from the stack.  For example, after @kbd{2 @key{RET} 3 +},
 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,
@@ -12257,13 +12212,6 @@ original argument you could use either @kbd{' sin($1)} or
 @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
@@ -12301,16 +12249,18 @@ the @emph{appearance} or @emph{interpretation} of the stack's contents.
 @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
@@ -12322,22 +12272,22 @@ options are available; @pxref{Mode Settings in Embedded 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
@@ -13972,7 +13922,7 @@ left or right as you prefer.
 @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.
@@ -13997,10 +13947,10 @@ the brackets in @samp{a[1]} and @samp{a[2]}, would not have known that
 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.
@@ -14008,7 +13958,7 @@ 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::
@@ -14118,7 +14068,7 @@ all four modes, and unformatted notation works in any 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
@@ -14193,72 +14143,122 @@ modes will use upper-case letters exclusively for display, and will
 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
@@ -14272,26 +14272,58 @@ in Calc, @TeX{}, and @dfn{eqn} (described in the next section):
 @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
@@ -14300,10 +14332,18 @@ in Calc, @TeX{}, and @dfn{eqn} (described in the next section):
 @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
@@ -14312,30 +14352,50 @@ in Calc, @TeX{}, and @dfn{eqn} (described in the next section):
 @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:
@@ -14372,8 +14432,9 @@ reading is:
 \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{*}.
@@ -14501,7 +14562,7 @@ $$ \pmatrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
 @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
@@ -14543,7 +14604,7 @@ treated the same as a space in @dfn{eqn} mode, as is the @samp{~}
 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@}}.
@@ -14557,17 +14618,17 @@ are treated the same as curly braces: @samp{sqrt "1+x"} is equivalent to
 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.
 
@@ -15266,8 +15327,8 @@ unrelated to the syntax tables described in the Emacs manual.)
 The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the
 syntax table for the current language mode.  If you want your
 syntax to work in any language, define it in the Normal language
-mode.  Type @kbd{M-# M-#} to finish editing the syntax table, or
-@kbd{M-# x} to cancel the edit.  The @kbd{m m} command saves all
+mode.  Type @kbd{C-c C-c} to finish editing the syntax table, or
+@kbd{C-x k} to cancel the edit.  The @kbd{m m} command saves all
 the syntax tables along with the other mode settings;
 @pxref{General Mode Commands}.
 
@@ -15872,7 +15933,10 @@ Pascal language mode (@kbd{d P}).
 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}).
@@ -15926,7 +15990,7 @@ No line breaking (@kbd{d b}).
 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}).
@@ -21811,7 +21875,7 @@ The @kbd{j D} command is implemented using rewrite rules.
 @xref{Selections with Rewrite Rules}.  The rules are stored in
 the Calc variable @code{DistribRules}.  A convenient way to view
 these rules is to use @kbd{s e} (@code{calc-edit-variable}) which
-displays and edits the stored value of a variable.  Press @kbd{M-# M-#}
+displays and edits the stored value of a variable.  Press @kbd{C-c C-c}
 to return from editing mode; be careful not to make any actual changes
 or else you will affect the behavior of future @kbd{j D} commands!
 
@@ -23587,7 +23651,7 @@ on variables, but you can use the @kbd{a b} (@code{calc-substitute})
 command to substitute actual values for function calls like @samp{as(3)}.
 
 The @kbd{s G} (@code{calc-edit-GenCount}) command is a convenient
-way to create or edit this variable.  Press @kbd{M-# M-#} to finish.
+way to create or edit this variable.  Press @kbd{C-c C-c} to finish.
 
 If you have not stored a value in @code{GenCount}, or if the value
 in that variable is not a positive integer, the regular
@@ -27813,13 +27877,14 @@ possible to create user-defined temperature units.
 
 @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
@@ -28091,7 +28156,7 @@ value of a variable without ever putting that value on the stack
 or simplifying or evaluating the value.  It prompts for the name of
 the variable to edit.  If the variable has no stored value, the
 editing buffer will start out empty.  If the editing buffer is
-empty when you press @kbd{M-# M-#} to finish, the variable will
+empty when you press @kbd{C-c C-c} to finish, the variable will
 be made void.  @xref{Editing Stack Entries}, for a general
 description of editing.
 
@@ -28204,14 +28269,15 @@ names rather than prompting for the variable name.
 @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
@@ -28230,7 +28296,7 @@ the values of all Calc variables into a specified buffer.
 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
@@ -28284,7 +28350,7 @@ since the evaluation step will also evaluate @code{pi}.
 @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.
 
@@ -28399,7 +28465,7 @@ operators in Algebraic mode, or by using the @kbd{s :}
 (@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{=>}.
 
@@ -28417,7 +28483,7 @@ Software Foundation's machine @samp{prep.ai.mit.edu}.)
 @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
@@ -28938,7 +29004,7 @@ dumb terminals will be
 @texline @math{80\times24}
 @infoline 80x24
 characters.  The graph is displayed in
-an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit
+an Emacs ``recursive edit''; type @kbd{q} or @kbd{C-c C-c} to exit
 the recursive edit and return to Calc.  Note that the @code{dumb}
 device is present only in GNUPLOT 3.0 and later versions.
 
@@ -29802,7 +29868,7 @@ understands are:
 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
@@ -29939,16 +30005,16 @@ you haven't done anything with this formula yet.
 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
@@ -29969,8 +30035,8 @@ version.
 
 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
@@ -30118,7 +30184,7 @@ by holding down Shift and Meta and alternately typing two keys.)
 The @kbd{M-# `} (@code{calc-embedded-edit}) command edits the
 embedded formula at the current point as if by @kbd{`} (@code{calc-edit}).
 Embedded mode does not have to be enabled for this to work.  Press
-@kbd{M-# M-#} to finish the edit, or @kbd{M-# x} to cancel.
+@kbd{C-c C-c} to finish the edit, or @kbd{C-x k} to cancel.
 
 @node Assignments in Embedded Mode, Mode Settings in Embedded Mode, More About Embedded Mode, Embedded Mode
 @section Assignments in Embedded Mode
@@ -30260,7 +30326,7 @@ a few lines that look like this:
 @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.
@@ -30472,7 +30538,8 @@ on it in order to get it to notice the new annotation.
 
 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
@@ -30488,8 +30555,8 @@ for @code{Save} have no effect.
 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}.)
@@ -30727,30 +30794,30 @@ key we defined above.
 @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
 key could invoke a command, which in turn calls an algebraic function,
 which might have one or more special display formats.  A single @kbd{Z P}
 command will save all of these definitions.
-
-To save a command or function without its key binding (or if there is
-no key binding for the command or function), type @kbd{'} (the apostrophe)
-when prompted for a key.  Then, type the function name, or backspace
-to change the @samp{calcFunc-} prefix to @samp{calc-} and enter a
-command name.  (If the command you give implies a function, the function
-will be saved, and if the function has any display formats, those will
-be saved, but not the other way around:  Saving a function will not save
-any commands or key bindings associated with the function.)
+To save an algebraic function, type @kbd{'} (the apostrophe)
+when prompted for a key, and type the function name.  To save a command
+without its key binding, type @kbd{M-x} and enter a function name.  (The
+@samp{calc-} prefix will automatically be inserted for you.)
+(If the command you give implies a function, the function will be saved,
+and if the function has any display formats, those will be saved, but
+not the other way around:  Saving a function will not save any commands
+or key bindings associated with the function.) 
 
 @kindex Z E
 @pindex calc-user-define-edit
@@ -30832,33 +30899,19 @@ Once you have bound your keyboard macro to a key, you can use
 
 @cindex Keyboard macros, editing
 The @kbd{Z E} (@code{calc-user-define-edit}) command on a key that has
-been defined by a keyboard macro tries to use the @code{edit-kbd-macro}
-command to edit the macro.  This command may be found in the
-@file{macedit} package, a copy of which comes with Calc.  It decomposes
-the macro definition into full Emacs command names, like @code{calc-pop}
-and @code{calc-add}.  Type @kbd{M-# M-#} to finish editing and update
-the definition stored on the key, or, to cancel the edit, type
-@kbd{M-# x}.
-
-If you give a negative numeric prefix argument to @kbd{Z E}, the keyboard
-macro is edited in spelled-out keystroke form.  For example, the editing
-buffer might contain the nine characters @w{@samp{1 @key{RET} 2 +}}.  When you press
-@kbd{M-# M-#}, the @code{read-kbd-macro} feature of the @file{macedit}
-package is used to reinterpret these key names.  The
-notations @code{RET}, @code{LFD}, @code{TAB}, @code{SPC}, @code{DEL}, and
-@code{NUL} must be written in all uppercase, as must the prefixes @code{C-}
-and @code{M-}.  Spaces and line breaks are ignored.  Other characters are
+been defined by a keyboard macro tries to use the @code{edmacro} package
+edit the macro.  Type @kbd{C-c C-c} to finish editing and update 
+the definition stored on the key, or, to cancel the edit, kill the
+buffer with @kbd{C-x k}.
+The special characters @code{RET}, @code{LFD}, @code{TAB}, @code{SPC},
+@code{DEL}, and @code{NUL} must be entered as these three character
+sequences, written in all uppercase, as must the prefixes @code{C-} and
+@code{M-}.  Spaces and line breaks are ignored.  Other characters are
 copied verbatim into the keyboard macro.  Basically, the notation is the
 same as is used in all of this manual's examples, except that the manual
-takes some liberties with spaces:  When we say @kbd{' [1 2 3] @key{RET}}, we take
-it for granted that it is clear we really mean @kbd{' [1 @key{SPC} 2 @key{SPC} 3] @key{RET}},
-which is what @code{read-kbd-macro} wants to see.
-
-If @file{macedit} is not available, @kbd{Z E} edits the keyboard macro
-in ``raw'' form; the editing buffer simply contains characters like
-@samp{1^M2+} (here @samp{^M} represents the carriage-return character).
-Editing in this mode, you will have to use @kbd{C-q} to enter new
-control characters into the buffer.
+takes some liberties with spaces: When we say @kbd{' [1 2 3] @key{RET}},
+we take it for granted that it is clear we really mean 
+@kbd{' [1 @key{SPC} 2 @key{SPC} 3] @key{RET}}.
 
 @kindex M-# m
 @pindex read-kbd-macro
@@ -30866,7 +30919,6 @@ The @kbd{M-# m} (@code{read-kbd-macro}) command reads an Emacs ``region''
 of spelled-out keystrokes and defines it as the current keyboard macro.
 It is a convenient way to define a keyboard macro that has been stored
 in a file, or to define a macro without executing it at the same time.
-The @kbd{M-# m} command works only if @file{macedit} is present.
 
 @node Conditionals in Macros, Loops in Macros, Naming Keyboard Macros, Keyboard Macros
 @subsection Conditionals in Keyboard Macros
@@ -31190,9 +31242,11 @@ If you want to give the formula a long-style name only, you can press
 @kbd{Z F @key{RET} spam @key{RET}} defines the new command as
 @kbd{M-x calc-spam}, with no keyboard equivalent.
 
-The third prompt is for a function name.  The default is to use the same
-name as the command name but with @samp{calcFunc-} in place of
-@samp{calc-}.  This is the name you will use if you want to enter your
+The third prompt is for an algebraic function name.  The default is to
+use the same name as the command name but without the @samp{calc-}
+prefix.  (If this is of the form @samp{User-m}, the hyphen is removed so
+it won't be taken for a minus sign in algebraic formulas.)
+This is the name you will use if you want to enter your 
 new function in an algebraic formula.  Suppose we enter @kbd{yow @key{RET}}.
 Then the new function can be invoked by pushing two numbers on the
 stack and typing @kbd{z m} or @kbd{x spam}, or by entering the algebraic
@@ -31251,8 +31305,9 @@ by a @kbd{Z F} command.
 
 The @kbd{Z E} (@code{calc-user-define-edit}) command on a key that has
 been defined by a formula uses a variant of the @code{calc-edit} command
-to edit the defining formula.  Press @kbd{M-# M-#} to finish editing and
-store the new formula back in the definition, or @kbd{M-# x} to
+to edit the defining formula.  Press @kbd{C-c C-c} to finish editing and
+store the new formula back in the definition, or kill the buffer with
+@kbd{C-x k} to
 cancel the edit.  (The argument list and other properties of the
 definition are unchanged; to adjust the argument list, you can use
 @kbd{Z G} to grab the function onto the stack, edit with @kbd{`}, and
@@ -31463,12 +31518,17 @@ step of @code{myfact} could have been written
 :"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
@@ -34421,7 +34481,7 @@ text.  (In fact it may still have leftover text from a previous
 @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
 
@@ -34564,8 +34624,8 @@ the same side, best if you plan to be binding single-sided pages.
 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.
@@ -35032,6 +35092,7 @@ keystrokes are not listed in this summary.
 @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@:}
 
@@ -35726,9 +35787,9 @@ Variable name may be a single digit or a full name.
 
 @c 30
 @item
-Editing occurs in a separate buffer.  Press @kbd{M-# M-#} (or @kbd{C-c C-c},
-@key{LFD}, or in some cases @key{RET}) to finish the edit, or press
-@kbd{M-# x} to cancel the edit.  The @key{LFD} key prevents evaluation
+Editing occurs in a separate buffer.  Press @kbd{C-c C-c} (or 
+@key{LFD}, or in some cases @key{RET}) to finish the edit, or kill the
+buffer with @kbd{C-x k} to cancel the edit.  The @key{LFD} key prevents evaluation
 of the result of the edit.
 
 @c 31
@@ -35912,7 +35973,7 @@ as Calc variables.  Add a @samp{var-} prefix to get the name of the
 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