Making Math Textbooks and Materials with T EX + K ETpic + - - PowerPoint PPT Presentation

making math textbooks and materials with t ex k etpic
SMART_READER_LITE
LIVE PREVIEW

Making Math Textbooks and Materials with T EX + K ETpic + - - PowerPoint PPT Presentation

TUG2013 conference Making Math Textbooks and Materials with T EX + K ETpic + hyperlink Yoshifumi Maeda Masataka Kaneko KAKENHI(24501075) Contents 1. K ETpic framework 2. Features of K ETpic 3. Generation of T EX commands 4.


slide-1
SLIDE 1

TUG2013 conference

Making Math Textbooks and Materials with T EX + K ETpic + hyperlink

Yoshifumi Maeda Masataka Kaneko

KAKENHI(24501075)

slide-2
SLIDE 2

Contents

  • 1. K

ETpic framework

  • 2. Features of K

ETpic

  • 3. Generation of T

EX commands

  • 4. Generation of many similar pages in materials
  • 5. Simultaneous use of “hyperref” package in materials
slide-3
SLIDE 3
  • 1. K

ETpic framework

K ETpic is

  • 1. a macro package of CAS (computer algebra systems)
  • 2. for generating T

EX readable (tpic specials or pict2e) codes of CAS graphical outputs

  • 3. freely downloadable from

http://ketpic.com

slide-4
SLIDE 4
  • 1. K

ETpic framework

\input compilation mod. CAS plot data Tpic file T EX doc PDF K ETpic Step 1 Step 2 Step 3 Product Next

The procedure is summarized in K ETpic diagram

slide-5
SLIDE 5
  • 1. K

ETpic framework

diagram

Step 1 Setwindow([-% pi/2,5*% pi/2],[-1.2,1.2]); P1=Plotdata(’sin(x)’,’x=[0,2*% pi]’); P2=Plotdata(’cos(x)’,’x=[0,2*% pi]’);

slide-6
SLIDE 6
  • 1. K

ETpic framework

diagram

Step 2 Openfile(’Folder/fig.tex’); Beginpicture(’1cm’); Drwline(P1); Dashline(P2); Endpicture(1); Closefile();

slide-7
SLIDE 7
  • 1. K

ETpic framework

diagram

Step 3 \usepackage{ketpic} \begin{document} The graphs of functions $y=\sin x$ and $y=\cos x$ are as follows: \input{fig.tex} \end{document}

slide-8
SLIDE 8
  • 1. K

ETpic framework

diagram

Product The graphs of functions y = sin x and y = cos x are as follows: x y O

slide-9
SLIDE 9
  • 2. Features of K

ETpic

y = 2 √π e−x2 1 2 3 x y O 1 2 3 1 ∫ x 2 √π e−t2dt x y O

  • 1. 2D complicated figures with precise shape and length
slide-10
SLIDE 10
  • 2. Features of K

ETpic

y = 2 √π e−x2 1 2 3 x y O 1 2 3 1 ∫ x 2 √π e−t2dt x y O

Accessories

  • 1. 2D complicated figures with precise shape and length
slide-11
SLIDE 11
  • 2. Features of K

ETpic

y = 2 √π e−x2 1 2 3 x y O 1 2 3 1 ∫ x 2 √π e−t2dt x y O

Accessories Mathematical Expressions

  • 1. 2D complicated figures with precise shape and length
slide-12
SLIDE 12
  • 2. Features of K

ETpic

z = cos x sin y + e−(x2+y2)/0.3

  • 2. 3D-graphics with precise shape and rich perspective
slide-13
SLIDE 13
  • 2. Features of K

ETpic

z = cos x sin y + e−(x2+y2)/0.3

  • 2. 3D-graphics with precise shape and rich perspective
slide-14
SLIDE 14
  • 2. Features of K

ETpic

2 2 2 2 1.0 0.5 0.0 0.5 1.0

  • 2. 3D-graphics with precise shape and rich perspective
slide-15
SLIDE 15
  • 2. Features of K

ETpic

  • 3. Flexible use of tables (using Tabledata command)

P(x) = P(x) = 0 P(x) > 0 y = P(x) D > 0 a(x − α)(x − β) x = α, β x < α, β < x α β D = 0 a(x − α)2 x = α x < α, α < x α D < 0 all x

slide-16
SLIDE 16
  • 2. Features of K

ETpic

  • 3. Flexible use of tables (using Tabledata command)

L1=list(20,26,26,26); L2=list(6,[6,1,4],6,6,26); Tb=Tabledata(L1,L2); DG1=Diagcelldata(Tb,4,[2,4]); Openfile(’Foler/table.tex’); Beginpicture(’1mm’); Drwline(Tb(1),DG1(2)); PutcoL(Tb,1,"c","","$P(x)=$","$P(x)=0$","$P(x)>0$","$y=P(x)$"); PutcoL(Tb,2,"c","$D>0$","$a(x-\alpha)(x-\beta)$",

・ ・ ・

,"\input{fig1}"); PutcoL(Tb,3,"c","$D=0$","$a(x-\alpha)^2$",・

・ ・,"\input{fig2}");

PutcoL(Tb,4,"c","$D<0$","","","all $x$","\input{fig3}"); Endpicture(0); Closefile();

slide-17
SLIDE 17
  • 2. Features of K

ETpic

Graphics and other contents can be located at the preferred position.

  • 4. Flexible page layouts (using ketlayer.sty)

\usepackage{ketpic,ketlayer} \begin{document} \begin{layer}{180}{0} \putnotec{150}{25}{\input{fig.tex}} \end{layer} \end{document}

slide-18
SLIDE 18
  • 2. Features of K

ETpic

Graphics and other contents can be located at the preferred position.

  • 4. Flexible page layouts (using ketlayer.sty)

\usepackage{ketpic,ketlayer} \begin{document} \begin{layer}{180}{0} \putnotec{150}{25}{\input{fig.tex}} \end{layer} \end{document}

slide-19
SLIDE 19

biseki2f1 : 2013/8/16(13:55)

72

第 3 章 重積分

O a −a a −a x y z O a −a a −a a x y z

問9

xy 平面上の円 x2 + y2 = a2 を底面とし,母線が z 軸に平行な直円柱

の z ≧ 0 の部分を V とするとき, 次の問いに答えよ.ただし,a は 正の定数とする.

(1) V が 2 つの平面 z = 0, z = y

によって切り取られる立体の 体積を求めよ.

(2)

曲面 z = √a2 − x2 と xy 平面 でできる半円柱を W とする と,W は母線が y 軸に平行な 直円柱の z ≧ 0 の部分になる.

V と W が交わってできる立

体の体積を求めよ.

From “Calculus II” Dainippon Tosyo Publisher

slide-20
SLIDE 20
  • 3. Generation of T

EX commands

CAS(Scilab) T EX commands (macro package) K ETpic

slide-21
SLIDE 21
  • 3. Generation of T

EX commands

CAS(Scilab) T EX commands (macro package) K ETpic Computation Programmability

slide-22
SLIDE 22
  • 3. Generation of T

EX commands

CAS(Scilab) T EX commands (macro package) K ETpic

  • 1. Definition of new T

EX commands

  • 2. Generation of graphical T

EX symbols

  • 3. Conditional branching
  • 4. Loop structure
slide-23
SLIDE 23
  • 3. Generation of T

EX commands

  • 1. Definition of new T

EX commands Openfile("Folder/mean.sty"); Texnewcmd("\mean",2); Texsetctr(1,"#1+#2/2"); Texcom("${\bf MEAN}(#1,#2)="+Texthectr(1)+"$"); Texend(); Closefile();

slide-24
SLIDE 24
  • 3. Generation of T

EX commands

This command line is written out honestly to the style file

  • 1. Definition of new T

EX commands Openfile("Folder/mean.sty"); Texnewcmd("\mean",2); Texsetctr(1,"#1+#2/2"); Texcom("${\bf MEAN}(#1,#2)="+Texthectr(1)+"$"); Texend(); Closefile();

slide-25
SLIDE 25
  • 3. Generation of T

EX commands

  • 1. Definition of new T

EX commands \newcommand{\mean}[2]{% \setcounter{ketpicctra}{#1}% \addtocounter{ketpicctra}{#2}% \divide\value{ketpicctra} by 2% ${\bf MEAN}(#1,#2)=\theketpicctra$% }%

slide-26
SLIDE 26
  • 3. Generation of T

EX commands

  • 1. Definition of new T

EX commands \usepackage{ketpic,ketlayer,mean} \begin{document} The mean value of 6 and 8 is presented as \begin{center} \mean{6}{8} \end{center} \end{document}

slide-27
SLIDE 27
  • 3. Generation of T

EX commands

  • 1. Definition of new T

EX commands The mean value of 6 and 8 is presented as MEAN(6, 8) = 7

slide-28
SLIDE 28
  • 3. Generation of T

EX commands

  • 2. Generation of graphical T

EX symbols Texnewcmd("\cnum",1); Setwindow([0,5],[0,5]); Beginpicture("1mm"); C1=Circledata([2.5,2.5],2.5); Drwline(C1); Texletter([2.5,2.5],"c","#1"); Endpicture(0); Texend();

slide-29
SLIDE 29
  • 3. Generation of T

EX commands

  • 2. Generation of graphical T

EX symbols \[ \frac{d^2x}{dt^2}-2\frac{dt}{dx}+x=0\quad \cnum{D} \] The characteristic equation of \cnum{D} is \[ \lambda^2-2\lambda+1=0\quad \cnum{C} \]

slide-30
SLIDE 30
  • 3. Generation of T

EX commands

  • 2. Generation of graphical T

EX symbols d2x dt2 − 2 dt dx + x = 0 D The characteristic equation of D is λ2 − 2λ + 1 = 0 C

slide-31
SLIDE 31
  • 3. Generation of T

EX commands

  • 2. Generation of graphical T

EX symbols Texnewcmd("\lefthand"); Setwindow([0,5],[0,5]); Beginpicture("5mm"); Sp1=Splinedata(PL); Drwline(Sp1); Endpicture(0); Texend();

slide-32
SLIDE 32
  • 3. Generation of T

EX commands

  • 2. Generation of graphical T

EX symbols \lefthand

slide-33
SLIDE 33
  • 3. Generation of T

EX commands

  • 3. Conditional branching

Texnewcmd("\parity",1); Texcom("#1"); Texsetctr(1,"#1/2"); Texsetctr(2,"#1+1/2"); Texif(Texthectr(1)+"="+Texthectr(2)); Texcom("\ is even"); Texelse() Texcom("\ is odd"); Texendif(); Texend();

slide-34
SLIDE 34
  • 3. Generation of T

EX commands

  • 3. Conditional branching

\parity{125} \parity{264} 125 is odd 264 is even

slide-35
SLIDE 35
  • 3. Generation of T

EX commands

  • 4. Loop structure

Texnewcmd("\repeated",2); Texfor(1,1,"#2"); Texcom("\noindent"); Texcom("#1"); Texcom("\\"); Texendfor(1); Texend();

slide-36
SLIDE 36
  • 3. Generation of T

EX commands

  • 4. Loop structure

\repeated{Hello!}{5} Hello! Hello! Hello! Hello! Hello!

slide-37
SLIDE 37
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-38
SLIDE 38
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-39
SLIDE 39
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-40
SLIDE 40
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-41
SLIDE 41
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-42
SLIDE 42
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-43
SLIDE 43
  • 4. Generation of many similar pages

1 2 3 4 5

Prototype (Determinant of a matrix)

slide-44
SLIDE 44
  • 4. Generation of many similar pages

Start 1 2 3 4 5

Prototype (Determinant of a matrix)

slide-45
SLIDE 45

for p=1:1:5 for q=1:1:5 if q==p then continue; else for r=1:1:5 if r==p then continue; elseif r==q then continue; else

・ ・ ・ ・ ・ ・ ・ ・ ・ ・

Texcom("\sameslide"); Texcom("\begin{layer}{130}{0}"); Texcom("\lineseg[32]{30}{30}{60}{-90}"); Texcom("\lineseg[32]{90}{30}{60}{-90}"); Texcom("\boxframe{35}{31}{50}{10}{\cnum{"+string(p)+"}}"); Texcom("\boxframe{35}{43}{50}{10}{\cnum{"+string(q)+"}}"); Texcom("\boxframe{35}{55}{50}{10}{\cnum{"+string(r)+"}}"); Texcom("\boxframe{35}{67}{50}{10}{\cnum{"+string(s)+"}}"); Texcom("\boxframe{35}{79}{50}{10}{\cnum{"+string(t)+"}}"); Texcom("\end{layer}");

・ ・ ・ ・ ・ ・ ・ ・ ・ ・

end; end; end; end; end;

slide-46
SLIDE 46

Loop program

  • f Scilab

for p=1:1:5 for q=1:1:5 if q==p then continue; else for r=1:1:5 if r==p then continue; elseif r==q then continue; else

・ ・ ・ ・ ・ ・ ・ ・ ・ ・

Texcom("\sameslide"); Texcom("\begin{layer}{130}{0}"); Texcom("\lineseg[32]{30}{30}{60}{-90}"); Texcom("\lineseg[32]{90}{30}{60}{-90}"); Texcom("\boxframe{35}{31}{50}{10}{\cnum{"+string(p)+"}}"); Texcom("\boxframe{35}{43}{50}{10}{\cnum{"+string(q)+"}}"); Texcom("\boxframe{35}{55}{50}{10}{\cnum{"+string(r)+"}}"); Texcom("\boxframe{35}{67}{50}{10}{\cnum{"+string(s)+"}}"); Texcom("\boxframe{35}{79}{50}{10}{\cnum{"+string(t)+"}}"); Texcom("\end{layer}");

・ ・ ・ ・ ・ ・ ・ ・ ・ ・

end; end; end; end; end;

slide-47
SLIDE 47
  • 5. Use of “hyperref” package

Example (Exponential of complex number) Insertion (by Texcom) of \hypertarget \hyperlink (at specified position) into Loop program

slide-48
SLIDE 48
  • 5. Use of “hyperref” package

Materials with many linkages between pages which allow students to intuitively appreciate mathematical concepts Example (Exponential of complex number) Insertion (by Texcom) of \hypertarget \hyperlink (at specified position) into Loop program

slide-49
SLIDE 49
  • 5. Use of “hyperref” package

Example (Exponential of complex number)

Sample 3