home *** CD-ROM | disk | FTP | other *** search
/ Lighthouse Design Suite / LIGHTHOUSE.mdf / FrameMaker_3.2 / FrameExtras / framein.m < prev    next >
Text File  |  1994-07-07  |  2KB  |  65 lines

  1. (* This files contains definitions for bringing FrameMaker ascii equations
  2.    into Mathematica.
  3.    Execute this file from Mathematica and then select a FrameMaker math 
  4.    equation as an object in FrameMaker. (Control Click)
  5.    Paste the equation into Mathematica, execute, and 
  6.    then run FrameConvert[%]
  7.    *)
  8.  
  9.  
  10. (* Alot of things can be converted with just aliases *)
  11. plus ::= Plus
  12. times ::= Times
  13. cos ::= Cos
  14. cosh ::= Cosh
  15. acos ::= ArcCos
  16. sin ::= Sin
  17. sinh ::= Sinh
  18. asin ::= ArcSin
  19. tan ::= Tan
  20. tanh ::= Tanh
  21. atan ::= ArcTan
  22. cot ::= Cot
  23. coth ::= Coth
  24. csc ::= Csc
  25. csch ::= Csch
  26. sec ::= Sec
  27. sech ::= Sech
  28. power ::= Power
  29. minus ::= Minus
  30. equal ::= Set
  31. div ::= Divide
  32. over ::= Divide
  33. abs ::= Abs
  34. bullet ::= Dot
  35. log ::= Log
  36.  
  37. FrameConvert[st_] :=
  38.     Block[ {FFFu}, FFFu = st;
  39.         FFFu = FFFu //. char[e] -> E;
  40.         FFFu = FFFu //. char[iota] -> I;
  41.         FFFu = FFFu //. char[infty] -> Infinity;
  42.         FFFu = FFFu //. char[pi] -> Pi;
  43.         FFFu = FFFu //. prompt[] -> X;    (* missing input in Frame*)
  44.         FFFu = FFFu //. id[x_] -> x;
  45.         FFFu = FFFu //. num[x_,y_] -> x;
  46.         FFFu = FFFu //. char[x_] -> x;
  47.         (* Just an alias won't do for sqrt 
  48.                because we may have 1 or 2 params *)
  49.         FFFu = FFFu //. sqrt[x_,p_:2] -> Power[x,1/p];
  50.         (* FFFu = FFFu //. sum[f_,imin_:1,imax_:1] ->  Sum[f,{i,imin,imax}];   not done *)
  51.         (* FFFu = FFFu //. prod[f_,imin_:1,imax_:1] -> Product[f,{i,imin,imax}];  not done *)
  52.         FFFu = FFFu //. int[f_,x_] -> Integrate[f,x];
  53.         FFFu = FFFu //. int[f_,x_,min_,max_] -> Integrate[f,{x,min,max}];
  54.         FFFu = FFFu //. var[f_] -> Null;
  55.         FFFu = FFFu //. lim[f_,l_] -> Limit[f,x->l];
  56.         FFFu = FFFu //. cdot[x_,y_] -> Times[x,y];
  57.         FFFu = FFFu //. lim[f_,l_] -> Limit[f,x->l];
  58.         FFFu = FFFu //. function[optotal[x_,p_:1],f_] -> Derivative[p,x][f];
  59.         FFFu = FFFu //. function[oppartial[x_],f_] -> D[f,x];
  60.         FFFu = FFFu //. function[oppartial[x_,p_],f_] -> D[f,{x,p}];
  61.                 
  62.         Print[InputForm[FFFu]];
  63.         ]
  64. "Done Loading FrameMaker Input Functions"
  65.