Ma 375 - PowerPoint PPT Presentation

About This Presentation
Title:

Ma 375

Description:

Ma 375 A course in Communicating Mathematics with Maple and LaTeX given by Paul Eakin and Carl Eberhart Department of Mathematics University of Kentucky – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 145
Provided by: carl
Learn more at: https://www.ms.uky.edu
Category:
Tags: donald | knuth

less

Transcript and Presenter's Notes

Title: Ma 375


1
Ma 375
  • A course in Communicating Mathematics with Maple
    and LaTeX
  • given by
  • Paul Eakin and Carl Eberhart
  • Department of Mathematics
  • University of Kentucky

2
Class 1 The Tools
  • Maple
  • LaTeX
  • Chisel CD

3
What are Maple and LaTeX?
  • Maple is a language for posing, investigating,
    and solving mathematical problems.
  • LaTeX is a language for preparing Mathematical
    documents for publication.
  • A knowledge of these languages equips you to
    communicate mathematics both with yourself and
    with the outside world.

4
More on Maple
  • Worksheet Environment -- like a sheet of paper
  • Use it like a graphing calculator
  • Use it to make 3d movies
  • You can do algebra in a Maple worksheet
  • Maple has a large mathematical vocabulary
  • You can extend the vocabulary
  • You have to buy it (think its a book)

5
More on LaTeX
  • You dont have to buy it
  • Based on TeX, a mathematical typesetting
    language invented by Donald Knuth
  • LaTeX is used extensively by the scientific
    community at the university level.
  • Use it to write math texts.
  • Maple worksheets can be exported to LaTeX.

6
The Chisel CD
  • Has a complete LaTeX system on it called MiKTeX.
    This can be run right off the CD.
  • Contains a large database of existing LaTeX
    source documents, from quizzes to books.
  • Has a MapleV4 demo worksheet reader with
    subsistence computational ability
  • Contains a large database of Maple worksheets,
    arranged into books.

7
Installing Chisel
  • Get the CD from http//www.ms.uky.edu/chisel
  • Stick it in your Cdrom drive
  • Initially you may want to choose a minimal
    installation.
  • After installation, you have a Chisel icon on
    your desktop. Click It.

8
Searching the Chisel
  • Pick a word, like function, and see where it
    occurs on the Chisel disk
  • The disk contains mws , tex, dvi, and ps files..
    These are read by MapleV4, Wordpad, yap, and
    gsview32 respectively.

9
Nextime
  • We will go through this again in more detail

10
Class 2 -- Hello, World! in LaTeX
11
The Editing Cycle
  • edit file.tex
  • latex file.tex
  • yap file.dvi
  • dvips file
  • gsview32 file.ps

12
edit file.tex
latex file.tex
yap file.dvi
gsview32 file.ps
dvips file
13
A Sample LaTex file
  • \documentclassslides\usepackagecolor,graph
    icx\begindocumentHello World!\colorredHel
    lo world!\ (xy)3 3x1 \\includegraphicsh
    eight2in,width3in,angle90cross201.eps\end
    document

14
Never start from scratch
  • To make an exam, start with an exam.
  • There are plenty on the Chisel disk.
  • Use the edit cycle to learn LaTex.
  • Try your ideas out to see if they work.
  • Of course, reference books are nice.
  • Browse LaTeX books for ideas.

15
Homework Assignment
  • Starting with a practice skills test in Calculus
    I on the Chisel Disk, modify it to a test key
    with color and graphics. You can change any
    problems you dont like.

16
Class 3 -- Modify an old tex document
17
Some things to watch for.
  • Version of LaTeX?
  • Macros. Any missing?
  • Learn LaTeX from context.
  • Read the error messages from LaTeX

18
Versions of LaTeX
  • LaTeX2.09
  • LaTeX2e
  • Using LaTeX2e help on the Chisel
    Disk.(//chisel/local/texmf/doc/latex/help/)

19
Get a skills test off the Chisel Disk
  • Choose your document
  • Open it to your hard-drive(click on ZIP, and
    choose open)
  • See if the tex file will latex

20
Start the Edit Cycle
  • Lets make a key to the exam

21
Homework Assignment
  • (Due Friday) email to carl_at_ms.uky.eduConstruct
    a 2 question, 1 page quizon solving quadratic
    equations.Provide a key.

22
Class 4 -- Getting Graphics
23
5 ways to make pictures in LaTeX
  • Use LaTeX picture commands
  • Use MS Paint to draw bw .bmp files
  • Use Maple to generate color .eps files
  • Use Paint Shop Pro to draw color .eps files
  • Use commands from the PSTricks package

24
LaTeX picture commands
  • Here is a sample picture drawn with picture
    commands in LaTeX.
  • setlength\unitlength.5in
  • \beginpicture(7,4)
  • \put(0,0)\vector(1,5)3
  • \put(2,2)\sqrt2
  • \endpicture

25
MS Paint
  • Launch the Paint from Accessories
  • Set the size to something like 4 by 2.4 inches
  • Make a drawing
  • Save as monochrome bmp (say pic.bmp) in the
    right directory
  • include graphicx in your list of packages
  • put
  • \includegraphicsheight4in,width2.4inpic.bmp
  • in your tex file

26
Maple To graph sin(x) and x3
  • Launch Maple (release 4 or 5)
  • Then in a worksheet issue these commands
  • plotsetup(ps,plotoutputpic.eps,plotoptionscol
    or)
  • plot(sin(x),x3,x-Pi..Pi)
  • get the file pic.eps into the right directory
  • proceed as above with MS Paint

27
The PSTricks Package
  • Think of this as a huge extension of the picture
    environment. Among other things you can write
    along a curve with Pstricks.
  • The style files and documentation are freely
    available from the TeX archives

28
Paint Shop Pro
  • Think of this as a better paint program
  • Its main advantage over paint is that you can
    save in the color eps format
  • It is inexpensive but high quality shareware

29
Class 5 -- Review and extend knowledge of LaTeX
30
What have we done?
  • Intro to Chisel Disk and its data
  • Intro to LaTeX(2e), with color and graphics
  • Tiny intro to Maple (for its graphics)
  • Made first homework assignment

31
A quiz template
  • \documentclass12ptarticle
  • \textheight 9in
  • \textwidth 6.5in
  • \begindocument
  • \begincenter
  • \bf\large Quiz 1
  • \endcenter
  • \beginenumerate
  • \item first question
  • \vfill
  • \item second question
  • \vfill
  • \endenumerate
  • \enddocument

Use this style for quizzes
put the quiz questions here
32
Many ways to carry out editing cycle
  • Have TexShell, editor, and yap or gsview32
    windows all open to cycle between.

Texshell
yap/gsview32
editor
33
A short article template
  • \documentclassarticle
  • \begindocument
  • \sectionIntroduction Introductory
    material
  • \sectionThe main body
  • \subsectionIdea one.
  • Here is the first idea.
  • \subsectionIdea two Here is the second idea.
  • \enddocument

Let LaTeX do the placement. You can work on what
to say.
34
Notes on graphics.
  • Use \beginpicture commands when possible
  • Leave room for Paint drawings and draw later.
  • Use the plotting packages in Maple

35
Class 6 -- Making a problem set
36
Problem Set Making
  • Making new problem sets is one of a teachers
    jobs. It is nice to have the tools to do it in
    a professional manner. Usually, there will be
    typeset math and graphics of some sort.

37
A Problem Set template
  • \documentclass12ptarticle
  • \textheight 9in
  • \textwidth 6.5in
  • \newtheoremproblemProblem
  • \begindocument
  • \begincenter
  • \bf\large Problem Set 1
  • \endcenter
  • \beginproblem
  • first question
  • \endproblem
  • \vfill
  • \beginproblem second question
  • \vfill
  • \enddocument

38
Some new LaTeX Commands
  • \newtheoremproblemProblem
  • Putting this in the preamble allows you to
  • \beginproblem
  • \endproblem
  • in the body

39
Another LaTeX command
  • To make a nice table, put this in your tex
  • document
  • \begintabular.5inl l l \hline
  • ksks stuff more stuff \\ \hline
  • akks yet more Stuff More stuff \\ \hline
  • \endtabular

40
More on Graphics.
  • Use \multiput to draw repetitively in the
    picture mode
  • the package graphpap is handy to draw quadrille
    paper.

41
Homework assignment
  • due Monday, Feb 9
  • Work up a new problem set, with three problems on
    two pages.
  • Use graphics and color. Supply your solutions
    commented out.
  • The topic can be anything related to or requiring
    mathematics in the solution.

42
Class 7 -- Making a problem set key
43
Class 8 Getting Graphics from Maple
44
Editing Cycle for Maple graphics
  • 1. Plot in Maple worksheet sample.mws
  • 2. Export worksheet to sample.tex
  • 3. Include sample01.eps in your tex file
  • 4. LaTeX - dvips - gsview32 your tex file
  • 5. If not satisfied, go back to 1,
  • else print it.

45
3 little Maple drawing words
  • plot Use this word for functions of 1
    variable, parametric plots, piecewise defined
    plots, animated plots (cant be exported to tex),
    and the like.
  • plot3d Use this word for functions of 2
    variables, parametric plots, and so forth.
  • plotsdisplay Use this word to overlay several
    plots together.

46
Two words fromThe plots package
  • plotspolygonplot Use this too draw filled in
    polygons
  • plotspolygonplot3d
  • Use this to draw boxes and the like.

47
3 words from the plottools pkg
  • plottoolscylinder
  • plottoolssphere
  • plottoolsdodecahedron

48
Homework for Monday 2/16
  • Make up a problem set with two geometry
    problems, one two dimensional and the second
    three dimensional. Include a picture drawn with
    Maple for each problem

49
Class 9 Root files -- A way to organize work
50
Using root files in LaTeX
  • A root file is a tex file which contains the
    formatting information and one or more include or
    input statements which will include separate
    files containting the text to be typeset. Root
    files provide a useful way to organize larger
    documents, such as a book, test archive, problem
    bank, or the like.

51
Sample rootfile--A quiz archive
  • \documentclass12ptarticle
  • \textheight 9in
  • \textwidth 6.5in
  • \begindocument
  • \includequiz1
  • \includequiz2
  • \enddocument

This command inserts the file quiz1.tex
The document quiz1.tex should not have a
\begindocument or \enddocument
52
\includeonly
  • If you have several include statements in a root
    file and you just want to see two of them,
  • say quiz12 and quiz14, put an
  • \includeonlyquiz12,quiz14 above
  • \begindocument

53
Rootfile for a book
  • Title page
  • Table of Contents
  • Chapter files
  • Problem Set files
  • Index

54
There are several books on the Chisel disk, each
of which has a rootfile which controls its
organization. These can be found in 1. The
development directories for Calculus I and
Calculus II and 2. The all directories for
The Handbook for Calculus Students and
Visual Problem Solving
55
Homework for Monday 2/23
  • Make a handout on a mathematics topic of your
    choice, with a titlepage, a 1 or 2 page
    discussion, and a problem set. Organize the
    handout with a rootfile. Include graphics in
    your document.

56
Class 10 Root files II -- Adventures with
Algebra
57
Most math teachers, at one time or another, have
thought about writing a math book. We can do
that now. Today, we start a book on Algebra. We
will build the root file, and begin to outline
the book there. Then we will start writing some
of the chapters. We learn more of how to
typeset mathematics.
58
\documentclassbook \titlea little algebra
book \authorwee willie wonder \begindocument
\frontmatter \maketitle \tableofcontents \mainmatt
er \includethought1 \includethought2 \backmatt
er \includeindex \enddocument
A rootfile for a little algebra book. Note the
new words \title, \author \tableofcontents \fron
tmatter \mainmatter \backmatter
59
Labeling and referencing equations
  • \beginequation\labeleq1
  • xy3
  • \endequation
  • .
  • Look at equation \refeq1 for a moment.

60
Typesetting Problem Illustrate Pascals triangle
  • \
  • \beginarrayccc
  • (xy)0 1\\
  • xy xy\\
  • \left (xy\right )2 x22\,xyy2
    \\
  • \endarray
  • \

61
Typesetting Problem Make a macro for a
binomial symbol
  • A solution
  • \newcommand\binom2
  • \left(
  • \beginarrayc 1 \\ 2
  • \endarray\right)

62
A good way to learn LaTeX
  • Have something you want to typeset (it can be in
    your head.)
  • Approach the task as a series of typesetting
    problems.
  • Have a reference handy. Be willing to ask
    someone before you give up.

63
Class 11 Bibliographies, Indices and Letters
64
Today, we will put a bibliography and an index in
our book, Adventures in Algebra. Then, we
will construct a letterhead for correspondence
dealing with our class. A letter writing
assignment is made for next Monday.
65
To make a bibliography, put your references
in a file, say biblio.tex, and include it in the
root file. \beginthebibliography99 \bibitem
huck Huckleberry Finn, by Mark
Twain. . \endthebibliography To cite a
reference in your book, put a citation at
appropriate spot \citehuck.
66
Indexing involves several steps !. Put the
\indexindex marks index marks in your text like
so. 2. Put the command \makeindex in the
preamble of your rootfile. 3. After Latex once,
use the command makeindex adalg.idx to produce
a file adalg.ind 4. copy adalg.ind to index.tex
and include this in your root file. 5. Latex
again to get the index in.
67
The letter class is very nice
  • \begindocumentclassletter
  • \addressSan Fran\\California
  • \nameBill Smith (sender)
  • \beginletterJack Lantern\\Montana
  • \openingDear Jack
  • I dont have much to say.
  • \closingYours truly,
  • \endletter

68
Assignment for Monday, March 2
  • Write a letter to a friend in which you tell
    about a favorite theorem.
  • Include some typeset mathematics,
  • and some colorful graphics to aid
  • with your discussion of the theorem.

69
Class 12--Homework, spell checking, textwrap, etc
70
today we look at some recent homework, do some
spell checking, make some global changes in
files, wrap some text around a picture, and
frame a picture with some text, among other things
71
Spell-checking 1. Use Word if you have it.
Copy the text into a word document and make
suggested changes in the original. 2. Use
ispell on the Chisel disk. It must be activated.
Install the gnu tools on your harddrive and add
these lines to the file chisel\local\djgpp\djgpp.
env ispell ISPELL_HOMEDJDIR/lib ISPELL_DICT
DIRDJDIR/lib ISPELL_COLORS0x1e.0x74 LINES40
Also change the setting LFNN to LFNY in
djgpp.env
72
Wraptext A nice style document to have
  • This enables one to wrap text around a picture
    in a very professional looking manner. It works
    best near the top of a chapter or section.

73
Using Perl to make global changes in many
files 1st. Install Perl on your harddrive from
the Chisel menu. (click the link
Perl3.13) 2nd. To replace all occurences of
oldword to newword in file1.tex and file2.tex,
issue the following command from the prompt in
TexShell perl -ip.bak -e s/oldword/newword/g
file1.tex file2.tex
74
PSTRICKS A very nice set of styles
  • 1. You can write along a curve!
  • 2. Draw a nice grid with
  • \beginpspicture(0,0)(20,20)
  • \showgrid
  • \endpspicture
  • 3. The pspicture environment is much better than
    the picture environment

75
To use wraptext
  • download the zipfile containing
  • the style file and follow the example
  • in number.tex

76
To use Pstricks
  • install tex on your harddrive
  • download the zipfile pstricks and unzip it
  • use windows explorer to copy the
    directoriespstricks\dvips to
    chisel\local\texmf\dvips\pstpstricks\generic to
    chisel\local\texmf\tex\generic\pstpstricks\latex
    to chisel\local\texmf\latex\pst
  • Follow the example of friend.tex and see
    pstricks\origdoc for more documentation.

77
Class 13 Using Maple to investigate polynomials
78
Polynomials are fundamental tools in mathematics.
They are used from the very beginning in
first year algebra. They make a good place to
start learning how to use Maple as a symbolic
manipulator
79
Some terminology Monomial in
x expressions like w5x2 Degree in x
2, the exponent of x Coefficient of x2
w5 Polynomial in x a sum of monomials in x,
for example, ax2 bx c Degree
2 Coefficients of the polynomial a,b, and c
80
Maple words to work with polynomials
  • poly 4x2 3x -2
  • degree(poly,x) returns 2, the degee of poly
  • coeff(poly,x) returns 3, the coefficient of
  • the x-term of poly
  • op(poly) returns the three operands of poly,
  • 4x2, 3x, and -2.

81
More Maple words for working with polynomials
  • Subs(xwt,poly) replaces x with wt throughout
  • subsop(2w) replaces 2nd term with w
  • expand(poly) removes parentheses
  • factor(poly) tries to write as product
  • divide(poly,factor) returns true if
  • factor divides poly, false if not.
  • rem(poly,factor,x) returns remainder.

82
Add to Assignment for 3/9/98
  • Work on the problems in the
  • worksheet. Make some progress.
  • Email your worksheet to me,
  • unexecuted.

83
Class 14 More polynomials, plus procedures
84
We are going to spend the day investigating the
remainder question posed last time. While we
are at it we will learn how to add to the Maple
vocabulary by defining new words in a worksheet.
85
To define a new word in a
Maple worksheet 1. Name the inputs and give
them values. 2. Develop the procedure in one
or more input cells using the input values
you have chosen. 3. Copy the appropriate
input cells into a new cell. 4. At the top of
this cell, add a proc line, where you
name the procedure, and show the inputs. 5. At
the bottom of the cell, add a line with the
word end on it. 6. Execute the cell. If
everything is ok, your definition will
appear nicely formatted at the bottom.
7. Test your definition out on some values you
know.
86
A couple of words, er, procedures
  • 1. basic functions
  • f x -gt sin(x21)
  • now f(4) returns sin(5)
  • 2. A procedure to compute the nth term
  • of the fibonaci sequence.
  • fibo proc(n) if n 1 or n2 then 1
    else
  • fibo(n-1)fibo(n-2) fi end now
    fibo(10) returns 55

87
Vocabulary building
  • for j from 1 to 10 do
  • print(j2sin(j)) od
  • seq(j2 sin(j),j1..10)
  • evalf(sin(10))
  • if a gt 0 then a3 else a5 fi
  • lists vs expression sequences vs sets

88
Class 15 Polynomials, pistons and animations
89
Today, we continue to investigate polynomials,
and learn to use animation in a Maple
worksheet. We will also discuss the
piston problem.
90
plotsanimate can be used
to study how the graph of a function f(x) as a
parameter in the rule for f changes. plotsanimate
3d is like plotsanimate, except it works with
functions of two variable f(x,y). Much more can
be done with animations. If you have any
sequence of named plots, then they can be
displayed with the option insequencetrue to
produce a movie.
91
Sample animations
  • plotsanimate(x2ax1,x-5..5,a0..4)
  • As you play this movie, you see the parabola
    slide down a parabolic? hill.
  • plotsanimate3d(x3mxn,x-3..2,n0..7,m0..4)
  • This movie shows the effect of changing the two
    parameters in the cubic.

92
A piston problem
Suppose a wheel with center on the x-axis
revolving with constant angular speed is tied at
a point on its circumference to a rod which is
tied at the other end to a piston constrained
to move back and forth along the x-axis. Study
the velocity and acceleration of the piston as a
function of the length of the rod with an eye to
finding the best length for the rod.
93
Class 16 Animations -- Pistons and basketballs
94
Today we want to model how a piston works.
Also, we will get a good start on a March Madness
theme.
95
Animations An animation
consists simply of a list of plots which are
displayed with the option insequence true
chosen. gtmovie plotsdisplay(plot1,plot2,plo
t3, insequence
true) gtmovie Then push the play
button. Plot1, plot2, etc, can be displays of
plots.
96
A Model of a Piston
  • The frames of a piston moving are displays of
  • several plots, 3 of which are
  • 1. A constant plot of the wheel
  • 2. A plot of the connecting rod (this will move)
  • 3. A plot of the piston (this will also move.)

97
A model of a basketball court
  • The frames of a basketball shot are
  • displays of several plots, some of which
  • are constant
  • court, basket, rim, paint, key
  • and one of which moves
  • ball

98
Assignment
  • Work on the 5 problems in the
  • class16 worksheet. Make progress.
  • Submit a worksheet with comments
  • on the Monday after Spring Break.

99
Class 17 Building books of worksheets with Perl
scripts
100
Today we will show how use hyperlinks and
bookmarks to make a book of worksheets, and
also show how to use two perl
scripts, mkcontents.pl and mkindex.pl to build a
table of contents worksheet and an index
worksheet.
101
A book of worksheets is a
set of worksheets which are connected by
hyperlinks. You can think of a directed graph
where the vertices are the worksheets and the
edges are the hyperlinks. There are many forms
such a graph might take
A linear (circular?) book of worksheets
A rooted book of worksheets
102
  • Since hyperlinks can get you to a bookmark in a
    worksheet your vertices have to be thought of as
    fat

worksheet 1
worksheet 2
worksheet 3
bookmark
hyperlink
103
To construct a table of contents worksheet
by hand, simply open a new worksheet and insert a
hyperlink to each worksheet in your book
of worksheets. To construct one with the perl
script mkcontents.pl 1. put the names of the
worksheets in the book in a file, one name to a
line. Put in the .mws suffix. 2. From the
TeXShell, execute the perl script with the
command perl -S mkcontents toc.mws
fileofworksheets where toc.mws is the name you
want for the table of contents worksheet and
fileofworksheets is the name of the file
containing the names of the worksheets.
104
To make an index worksheet, 1. bookmark all
of the items in all of the worksheets in
your book. You can only put one bookmark per
paragraph. 2. From a TexShell, issue the
command perl -S mkindex index.mws toc.mws
fileofworksheets where index.mws is the name of
your index worksheet toc.mws is the name of your
table of contents worksheet and fileofworksheets
is the file where you have listed the names of
the worksheets in the book.
105
Homework Assignment due Monday, March
30 Take a collection of three or more worksheets
from the Chisel disk, and bookmark them
and otherwise modify them however you want
to. Then construct a table of contents
worksheet, either by hand or with mkcontents.pl
and construct an index worksheet with mkindex.pl.
Finally, put in a hyperlink back to the table
of contents worksheet from each worksheet in your
book. Send me an email when you have completed
the task, describing what you did and any
difficulties you had in carrying out the task.
106
Class 18 A little bit of Perl
107
Today we will spend the hour using perl to make
global substitutions in multiple files.
108

Perl means Practical Extraction and Report
Language. You can use it to extract lines
or pieces of lines from files, by using pattern
matching. It can be used as an editing tool, to
make substitutions in files, because it has
really good pattern matching abilities. This is
what we will use it for mostly.
109
Class 19 -- LaTeX Images of books of worksheet
110
In todays class, we will go back over the steps
in making a book of worksheets, using mkindex.pl
and mkcontents.pl We will also go over the steps
in making a latex image of the book, using
mknotes.pl
111

Problem Make a book of worksheets out of the
first three worksheets in the handbook for
calculus students on the chisel disk. Then make
a LaTeX image of the book.
1. copy the worksheets hand1.mws, hand2.mws,
and hand3.mws into a directory in
chisel\tmpdir 2. make a file, say mwsfiles,
containing these names, one to a line. Also
throw in an index worksheet, even if it doesnt
exist yet. hand1.mws hand2.mws hand3.mws index.mws
112
3. Use mkcontents to make toc.mws with the
command perl -S mkcontents tocs.mws
mwsfiles After you have made the table of
contents, add links in each worksheet back to it.
Now insert (additional) bookmarks you want in
the index worksheet. 4. Use mkindex.pl to make
an index.mws with the command perl -S mkindex
index.mws toc.mws mwsfiles At this point, your
book of worksheets is done.
113
To make a Latex image of the book of worksheets
1. Export each worksheet to LaTeX, give it the
name name.tex if the worksheets name is name.mws.
2. Make a file, say texfiles, containing the
names of the worksheets exported to tex, one to
a line. In our case the names would be
hand1.tex, hand2.tex, hand3.tex. 3. Use
mknotes.pl, to make a rootfile, say part1.tex,
and massage the texfiles with the command perl
-S mknotes part1.tex texfiles
114
4. If you want a table of contents, open
the rootfile with an editor and insert the
command \tableofcontents just after the
\begindocument. 5. LaTeX the rootfile twice
(to get the numbers right). 6. To make an
index, if you have inserted index items in the
worksheets, give the command makeindex
rootfile.ind in a TeXshell, where rootfile is
part1 in our case. 7. LaTeX the rootfile
again, then dvips it, and use gsview32 to view
and maybe print it. At this point, you have a
LaTeX image of the book of worksheets
115
Color Postscript For color postscript, use
mkcolor.pl in place of mknotes.pl, and clreps.pl
to recolorize the eps files perl -S mkcolor
part1.tex texfiles perl -S clreps part1.tex
texfiles Note The version of clreps.pl
supplied last time does not work for release 4
of Maple. Use the version supplied with the class
19 zipfile. Put it in chisel/bin with the
other scripts.
116
Class 20 More on using and modifying perl scripts
117
Today we admire some home work. Mostly, we spend
more time learning how to use and modify our
perl scripts. A homework assignment is made.
118

Perl Problem 1 Add some colors to
clreps.pl Solution Define a color in Maple,
say gt macro(burntredCOLOR(RGB,
.9,.3,.2)) plot something in burntred, and
export the worksheet and examine the plot to see
that burntred converts to 0.467255 G, so in
clreps.pl insert the line s/0.467255 G/.9 .3
.2 C/ burntred
119
  • Perl Problem 2 Which style files are usedwhen
    LaTeXing a root file created by mknotes.pl (or
    mkcolor.pl)?
  • Solution Modify mknotes.pl (or mkcolor.pl)
  • by inserting the line
  • print MASTER \\listfiles\n
  • above the line print MASTER \\begin\doc ...
  • Then look in the file root.log (where root is the
  • name of your rootfile) after you LaTeX your
  • rootfile to see what files are used.

120
Perl Problem 3 Change the default font family
from sans serif to roman. Also change the page
width to 6in. Solution In the script
mknotes.pl (or mkcolor.pl) remove the line that
starts print MASTER \\renewcommand\cmss\\n
To change the width, replace textwidth
6.5in with textwidth 6in.
121
Homework (Due April 13) 1. Add at least two
colors to clreps.pl. 2. Make an exam in a Maple
worksheet, with a plot using your colors,
and export it to tex. Massage it with
mkcolor.pl and email the postscript file to
me.
122
Class 21 Making exams with Maple
123
Today we are going to investigate the ins and
outs of exam making in a Maple worksheet. We
will also solve some Perl problems that arise
when exporting to LaTeX.
124

Three reasons to use Maple to write exams. 1.
It is easier to check your answers. 2. Makes
it easier to archive and share tests. 3. You
can modify old exams more easily. Notes a)
Inline mathematics can be typeset and toggled
using the leftmost buttons on the context bar. b)
graphics can be resized with the mouse.
125
  • Two reasons for Exporting exams to LaTeX
  • 1. Formatting is easier. One page quizzes
  • are ok in Maple, but long exams take a
  • long time to paginate.
  • 2. Input cells can be suppressed more easily.
  • Use mkcolor.pl with the -i option.

126
Perl Problem 1 I want the diagrams to be
bigger. Solution Train mkcolor.pl to Replace
\mapleplot with \includegraphicswidth4in,height
6in, angle-90 (or whatever dimensions you
like) Perl Problem 2 I want to add tex
comments to my worksheet. Solution Make a
paragraph style comment in the maple worksheet
(Format menu) and train mkcolor.pl to
comment these out.
127
Perl Problem 3 I want to suppress the input
cells when I latex an exam Solution Use the -i
option with mkcolor. The most recent mkcolor.pl
has these changes added to it.
128
Class 22 Modifying Large Documents from Chisel
129
Today, we will colorize the text Visual
Problem Solving, which is on the chisel disk, and
add a worksheet to it.
130

To colorize the text 1. open the development
directory all to your hard drive. 2. open
the table of contents worksheet in Maple and
successively export each worksheet to LaTeX. 3.
As you do this, massage each worksheet with
mkcolor.pl. If necessary, remove empty maple
outputs and empty maple plots, and reexport.
131
  • 4. After each worksheet has been exported
  • and prepped with mkcolor, create a file
    (texfiles)
  • with the names of the exported worksheets,
  • one name to a line. Also create an info file
  • containing title, author, and frontpiece.
  • 5. Make the rootfile for the book with
  • perl -S mkcolor -t bookname.tex texfiles info
  • 6. Latex twice, and then use makeindex to
  • convert bookname.idx to bookname.ind. Then
  • move that to index.tex and include this in the
  • rootfile.

132
  • 7. LaTeX one more time to get the
  • index in.
  • 8. Use clreps.pl to colorize the exported eps
    plots.
  • 9. Use dvips to form the color postscript
    version of the text.

Now to insert a new worksheet, process it as you
did the previous worksheets.
133
Final Project
  • Write a book of worksheets with at least 3
    chapters (worksheets), and a index and table of
    contents. The topic can be anything
    mathematical. Make a color LaTeX image of the
    book, and give me a
  • zipped copy of the development directory in which
  • you wrote your book.
  • This project is due during final week.

134
Class 23 Modifying Large documents Part II
135
Today, we are going to see how to modify the
Calculus books on the Chisel disk by adding Maple
worksheets. We also look at an interesting
style files from the TeX archive, the crossword
style file.
136

Problem You have a book with LaTeX source which
you would like to add Maple worksheets to. It
has its own rootfile which can only be added to.
How to add the worksheets? Solution To the
rootfile, add \usepackagemaple2e,color \Defin
eParaStyleBullet Item . all needed paragraph
styles and process the individual worksheets
with mkcolor.pl and clreps.pl. Then include
these in the root file.
137
  • The crossword style file can be obtained
  • from the TeX archives located at
  • http//ctan.unsw.edu.au/tex-archive/help/Catalogue
    /cthier.html
  • In addition to its designed use a crossword
  • puzzle formatter, it can be used to format
  • tiling puzzles and other puzzles such as the
  • 15 puzzle.

138
Notes on the final assignment. 1. Due final
week. 2. Submit a description of your project By
Friday, April 24, by email. 3. A preliminary
version can be submitted for comments during dead
week.
139
Class 24 Cleaning up from last time
140
Today, we are going to see how to modify the
Calculus books on the Chisel disk by adding Maple
worksheets. We will also discuss the final
project and how to submit it by ftp.
141

Problem You have a book with LaTeX source which
you would like to add Maple worksheets to. How
to do it? Solution To the rootfile, add
\usepackagemaple2e,color \DefineParaStyleBul
let Item . all needed paragraph styles and
process the individual worksheets with mkcolor.pl
and clreps.pl. Then include in the root file.
142
  • Suggestions on the final project
  • You should submit a preliminary version
  • (by ftp) of your final project by April 24.
  • 1. Possible topic Learn to use 4 or more
  • words from a package in Maple such as
  • the plots package and construct worksheets which
    make use of the words.
  • 2. Another possible topic Take 4 or more word
    problems from an algebra book and solve them in a
    series of Maple worksheets. Make up related
    problems to solve.

143
To submit your assignment by ftp 1. Develop
your project in one directory. so that all the
mws, tex, eps, and ps files will be in one place.
2. When you are ready to send it in, zip the
files in the directory with the command zip
name.zip where name is a random 8 character
string you have chosen. 3. Make an internet
connection, then use the command ftp
ftp.ms.uky.edu to connect to the ftp site you
will be asked to log in. Answer with ftp Then
give your email as the password.

144
4. After you have logged in, give the
commands cd incoming bin put name.zip this will
place your file where I can get it. 5. Send me
an email giving the name of the file you have
placed by ftp. 6. I will confirm receipt within
the day.
Write a Comment
User Comments (0)
About PowerShow.com