12.4 Source file syntax

In that second example, the file that is really sent to the program is:

                TeXgraph#  
                Cmd Marges(0,0,0,0); size(7.5);  
                Include "PolyedresII.mac";  
                Var A = M(3,0,0);  
                Mac f = M(%1,%2,sin(%1)+cos(%2));  
                Graph objet1 = [  
                  background(full,lightgray),  
                  ColorL:=slategray, StyleL:=12,  
                 CubeAdc(Origin, A,C,T1,T2,Ar),  
                 Build3D(C,T1,T2,Ar,  
                     bdSurf(f(u,v),  
                       [color:=steelblue,  
                        u:=[-pi,pi],v:=u,  
                        contrast:=0.125]),  
                     bdAxes(Origin,  
                       [color:=forestgreen,arrows:=1])  
                     ),  
                  Display3D()];

Some rules:

  1. The first line is mandatory.
  2. There can be several parts Cmd, Include, Var, Mac and Graph.
  3. The differents part do not have to follow a particular order. The only thing is to remember that a global variable (or a macro) only exists after its declaration.