Exporting as maple input format to export a worksheet

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n qbinom.m. > read "qbinom.m"; Now expr has its value again. > expr; (1 − q 7 ) (1 − q 8 ) (1 − q 9 ) (1 − q 10 ) (1 − q ) (1 − q 2 ) (1 − q 3 ) (1 − q 4 ) For more information on the read command, see 8.1 Reading Files. A Converting to LTEX Format A TEX is a program for typesetting mathematics, and L TEX is a macro package for TEX. The latex command converts Maple expressions to A A L TEX format. You can perform conversion to L TEX by using the latex command. Thus, you can use Maple to solve a problem, then convert the A A result to L TEX code that can be included in a L TEX document. Use the latex command in the following manner. latex( expr, "filename " ) • expr can be any mathematical expression. Maple-specific expressions, such as procedures, are not translatable • filename is optional, and specifies that Maple writes the translated output to the file you specified. If you do not specify a filename, Maple writes the output to the default output stream (your session) A • latex writes the L TEX code corresponding to the Maple expression expr to the file filename. If filename exists, latex overwrites it. If you 8.2 Writing Data to a File • 285 A omit filename, latex prints the L TEX code on the screen. You can A cut and paste from the output into your L TEX document. > latex( a/b ); {\frac {a}{b}} > latex( Limit( int(f(x), x=-n..n), n=infinity ) ); \lim _{n\rightarrow \infty }\int _{-n}^{n}\!f \left( x \right) {dx} The latex command: A • Produces code suitable for L TEX math mode. However, it does not produce the command for entering and leaving math mode, and it does not attempt any line breaking or alignment. • Can translate most types of mathematical expressions, including integrals, limits, sums, products, and matrices. You can expand the capabilities of latex by defining procedures with names of the form ‘latex/functionname ‘. Such a procedure formats calls to the function called functionname. You must produce the output of such formatting functions with the printf command. • Uses the writeto command to redirect the output when you specify a filename. A • Does not generate the commands that L TEX requires to put the typesetting system into mathematics mode (for example, $...$). A The following example shows the generation of L TEX for an equation for an integral and its value. Note: Int, the inert form of int, prevents the evaluation of the left-hand side of the equation that Maple is formatting. > Int(1/(x^4+1),x) = int(1/(x^4+1),x); √ √ 1√ x2 + x 2 + 1 1√ 1 √ dx = 2 ln( )+ 2 arctan(x 2 + 1) 4+1 x 8 4 x2 − x 2 + 1 √ √ 1 + 2 arctan(x 2 − 1) 4 286 • Chapter 8: Input and Output > latex(%); \int \! \left( {x}^{4}+1 \right) ^{-1}{dx}=1/8 \,\sqrt {2}\ln \left( {\frac {{x}^{2}+x\sqrt {2}+1}{{x}^{2}-x\sqrt {2}+1}} \right) +1/4\, \sqrt {2}\arctan \left( x\sqrt {2}+1 \right) + 1/4\,\sqrt {2}\arctan \left( x\sqrt {2}-1 \right) Section 8.3 Exporting Worksheets describe...
View Full Document

This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online