www.delorie.com/gnu/docs/calc/calc_174.html   search  
Buy the book!

GNU Emacs Calc 2.02 Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.8 Language Modes

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 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.

The current language has no effect on things written to or read from the trail buffer, nor does it affect numeric entry. Only algebraic entry is affected. You can make even algebraic entry ignore the current language and use the standard notation by giving a numeric prefix, e.g., C-u '.

For example, suppose the formula `2*a[1] + atan(a[2])' occurs in a C program; elsewhere in the program you need the derivatives of this formula with respect to `a[1]' and `a[2]'. First, type d C to switch to C notation. Now use C-u M-# g to grab the formula into the Calculator, a d a[1] RET to differentiate with respect to the first variable, and M-# y to yank the formula for the derivative back into your C program. Press U to undo the differentiation and repeat with a d a[2] RET for the other derivative.

Without being switched into C mode first, Calc would have misinterpreted the brackets in `a[1]' and `a[2]', would not have known that atan was equivalent to Calc's built-in arctan function, 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 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.

Language modes are selected by typing the letter d followed by a shifted letter key.

7.8.1 Normal Language Modes  
7.8.2 C, FORTRAN, and Pascal Modes  
7.8.3 TeX Language Mode  
7.8.4 Eqn Language Mode  
7.8.5 Mathematica Language Mode  
7.8.6 Maple Language Mode  
7.8.7 Compositions  
7.8.8 Syntax Tables  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003