Pour l'utilisation du code dans un document TeX il faut paramétrer ton éditeur pour ajouter l'option --enable-write18 aux compilateurs pdflatex et/ou latex.
\begin{texgraph}[name=dessin1, export=pgf, file]
% TeXgraph version 1.94
% Fenetre Xmin Xmax Ymin Ymax Xscale Yscale
100#-2.59459459459459#7.4054054054054#-3.91891891891892#6.08108108108107#1#1##
% Marges gauche droite haut bas cadre gestion_couleur comptgraph
101#0.5#0.5#0.5#0.5#0#1#9##
% Affectation des Variables theta et phi et type de perspective
18##[theta:=0.5236, phi:=1.0472,OriginalCoord(1),IdMatrix(),IdMatrix3D(),
ModelView(ortho)]##
% Déclaration des Macros
% Déclaration des Eléments graphiques
% Pmax (Courbe cartés.)
18##[Width:=20,Color:=16711680,NbPoints:=500,tMin:=-0.5,tMax:=10]##
21#Pmax#10/x#5##
% axe (Axes)
18##[Width:=15,Color:=0,Arrows:=1,xylabelpos:=0]##
1#axe#[0+i*(0),2+i*(2),2+i*(2)]#0#0##
% rectangle3 (Utilisateur)
18##[Width:=8,Color:=16776960,Arrows:=0,LineStyle:=1,NbPoints:=50,tMin:=-1.0541,tMax:=8.9459,DotScale:=1+i]##
14#rectangle3#Drectangle(0,3,1.73*i)#-1##
% T_Pmax (Label)
18##[Width:=4,Color:=16711680,AutoReCalc:=0,LineStyle:=0,TeXLabel:=1]##
8#T_Pmax#[ 6+2.8*i ]#\Large{$\mathcal{P}_{max} = u~i$}##
% Ctk (Courbe cartés.)
18##[Width:=10,Color:=255,AutoReCalc:=1,tMin:=-2.4324,tMax:=7.5676]##
21#Ctk#sqrt(x)#5##
% objet7 (Courbe cartés.)
18##[tMin:=-1,tMax:=0]##
21#objet7#0#5##
% objet8 (Courbe cartés.)
18##[tMin:=-2.5946,tMax:=-1]##
21#objet8#x+1#5##
% Intersec9 (Utilisateur)
18##[Width:=4,Color:=0,tMax:=7.4054,TeXLabel:=0]##
14#Intersec9#Point(Intersec(Ctk,rectangle3))#-1##
\end{texgraph}
texdoc texgraph
phil@dell:~$ texdoc -l texgraph
1 /home/phil/.texlive2009/texmf-var/doc/latex/TeXgraph/TeXgraph.pdf
2 /home/phil/.texlive2009/texmf-var/doc/latex/TeXgraph/Animation.pdf
3 /home/phil/.texlive2009/texmf-var/doc/latex/TeXgraph/CourbesNiv.pdf
\begin{texgraph}[name=essai3,export=pgf,file]
Cmd [Fenetre(-2.59459459459459+6.08108108108107*i,7.4054054054054-3.91891891891892*i,1+i), Marges(0.5,0.5,0.5,0.5),
Border(0)];
[OriginalCoord(1),IdMatrix()];
[theta:=0.5236, phi:=1.0472, IdMatrix3D(), ModelView(ortho)];
GrayScale(0);
Cmd [Width:=20,Color:=16711680,NbPoints:=500,tMin:=-0.5,tMax:=10];
Graph Pmax = Cartesienne(10/x,5);
Cmd [Width:=15,Color:=0,Arrows:=1,xylabelpos:=0];
Graph axe = Axes(0,2+2*i,2+2*i);
Cmd [Width:=8,Color:=16776960,Arrows:=0,LineStyle:=1,NbPoints:=50,tMin:=-1.0541,tMax:=8.9459,DotScale:=1+i];
Graph rectangle3 = Drectangle(0,3,1.73*i);
Cmd [Width:=4,Color:=16711680,AutoReCalc:=0,LineStyle:=0,TeXLabel:=1];
Graph T_Pmax = Label([ 6+2.8*i ],"\Large{$\mathcal{P}_{max} = u~i$}");
Cmd [Width:=10,Color:=255,AutoReCalc:=1,tMin:=-2.4324,tMax:=7.5676];
Graph Ctk = Cartesienne(sqrt(x),5);
Cmd [tMin:=-1,tMax:=0];
Graph objet7 = Cartesienne(0,5);
Cmd [tMin:=-2.5946,tMax:=-1];
Graph objet8 = Cartesienne(x+1,5);
Cmd [Width:=4,Color:=0,tMax:=7.4054,TeXLabel:=0];
Graph Intersec9 = Point(Intersec(Ctk,rectangle3));
\end{texgraph}
Karine Brunel a écrit:Je n'ai donc plus d'issue : je dois vraiment passer à la version 1.95 .
Ceci dit, j'utilise assez régulièrement des macros "inconnues" : comment dois-je faire pour que le code marche néanmoins ? Dois-je en particulier enregistrer les macros " inconnues" sous forme de fichier.mac que j'ajoute dans le dossier TeXgraphMac ?
Cela renvoie peut-être à l'ancien fil sur les macros et les modèles et la différence entre les deux ?
\begin{texgraph}[name=essai2,export=pgf, file]
Mac Msph = %1*[exp(i*%2)*sin(%3),cos(%3)];
Graph objet1 =
[view(-15,16,-8,11), size(20,1),
view3D(-15,15,-15,15,-10,10),
{Surfaces équipotentielles}
K1:=5,vphi1:=pi/2,Plabel1:=pi/6, N:=100,
C1:=rotCurve(Msph(K1*sqrt(cos(t)),t,vphi1),[Origin,vecK],0,pi,0,pi+(pi/6),50),
C4:=rotCurve(Msph(-K1*sqrt(cos(t)),t,vphi1),[Origin,vecK],0,pi,-pi -(pi/10),0,50),
R1:=5,R2:=10,R3:=15,vphid:=3*pi/4,
{point d'intersection Equipot et ligne de champ}
thetac:=51.82729238*pi/180,
Mc:=Msph(R1*sin(thetac),thetac,vphi1),
Build3D( bdLine([M(0,0,-0.5),M(0,0,0.5)],[arrows:=1,color:=red,width:=18,tube:=1]),
bdLine([Origin,Mc],[arrows:=0,color:=black,width:=8]),
bdCurve(Msph(K1*sqrt(cos(t)),t,vphi1),[t:=[0,2*pi],nbdot:=N,color:=blue,width:=12]),
bdCurve(Msph(-K1*sqrt(cos(t)),t,vphi1),[t:=[0,2*pi],nbdot:=N,color:=blue,width:=12]),
bdFacet(C1,[color:=cyan,opacity:=1,contrast:=0.25]),
bdFacet(C4,[color:=cyan,opacity:=1,contrast:=0.25]),
bdCurve(Msph(R1*sin(t),t,vphi1),[t:=[0,2*pi],nbdot:=N,color:=red,width:=12]),
bdCurve(Msph(R1*sin(t),t,-vphi1),[t:=[0,2*pi],nbdot:=N,color:=red,width:=12]),
bdCurve(Msph(R2*sin(t),t,vphi1),[t:=[0,2*pi],nbdot:=N,color:=orange,width:=12]),
bdCurve(Msph(R2*sin(t),t,-vphi1),[t:=[0,2*pi],nbdot:=N,color:=orange,width:=12]),
bdCurve(Msph(R3*sin(t),t,vphi1),[t:=[0,2*pi],nbdot:=N,color:=goldenrod,width:=12]),
bdCurve(Msph(R3*sin(t),t,-vphi1),[t:=[0,2*pi],nbdot:=N,color:=goldenrod,width:=12]),
bdCurve(Msph(R1*sin(t),t,vphid),[t:=[0,2*pi],nbdot:=N,color:=red,width:=12]),
bdCurve(Msph(R1*sin(t),t,-vphid),[t:=[0,2*pi],nbdot:=N,color:=red,width:=12]),
bdCurve(Msph(R2*sin(t),t,vphid),[t:=[0,2*pi],nbdot:=N,color:=orange,width:=12]),
bdCurve(Msph(R2*sin(t),t,-vphid),[t:=[0,2*pi],nbdot:=N,color:=orange,width:=12]),
bdCurve(Msph(R3*sin(t),t,vphid),[t:=[0,2*pi],nbdot:=N,color:=goldenrod,width:=12]),
bdCurve(Msph(R3*sin(t),t,-vphid),[t:=[0,2*pi],nbdot:=N,color:=goldenrod,width:=12]),
bdLabel(M(0,0,0.5),"$\overrightarrow{p}$",[labelpos:=[0.5,-1+0.1*i],color:=red]),
bdAxes([0,0],[arrows:=1,color:=gold]),
bdDot(Mc,[dotstyle:=cross,dotscale:=2]),
bdArc(M(0,0,0.5),Origin,Mc,2.5,1,[arrows:=1,labelarc("$\theta$")]),
bdLabel(Mc,"$r$",[labelpos:=[1,-1-i],color:=black]),
bdLabel(Mc,"$M$",[labelpos:=[1,1+i],color:=black]),
),
Display3D()];
\end{texgraph}
Par ailleurs, pour pouvoir utiliser facilement les fichiers.teg (version 1.94) dans un document Latex, est-ce qu'il suffira que je les ouvre avec la version 1.95 pour qu'ils soient enregistrés au nouveau format ?
\documentclass[12pt,a4paper]{article}
\usepackage{texgraph,pgf}
\begin{document}
\begin{texgraph}[name=surf1,export=pgf]
view(-7,7,-7,7),
Marges(0,0,0,0),
size(7.5),
FillStyle:=full, FillColor:=lightblue,
Dsurface( M(u,v,cos(u)+sin(v)), -5+5*i, -5+5*i, 25+25*i)
\end{texgraph}
\end{document}
\immediate\write18{\TeXgraphDir CmdTeXgraph \@ext\space \@nom}%
\def\TeXgraphDir{C:/TeXgraph1.95/TeXgraph/}%
\begin{texgraph}[file,call]
Mac
distance = [ {distance(A,B,"texte", vecteur decalage) }
SaveAttr(),
LineStyle:=dotted, Width:=6,
Ligne3D([%1,%1+%4,jump,%2,%2+%4],0),
LineStyle:=solid,
LabelSeg( Proj3D(%1+%4), Proj3D(%2+%4), %3,
[Arrows:=2, labelpos:=bottom, rotation:=0, labelsep:=0.15]),
RestoreAttr()
];
Graph objet1 = [
view(-8,12,-5,6), view3D(-8,8,-5,5,-5,5), Marges(0,0,0,0), size(15),
viewDir(20,70), ModelView(central), DistCam(35),
LabelSize:=scriptsize, Width:=8, SaveAttr(),
SetMatrix3D( matrix3d(shift3d(M,-4*vecJ)) ),
A:=M(0,0,5),O:=Origin,A1:=M(2,-2,0),A2:=M(2,2,0),A3:=M(-2,2,0),A4:=M(-2,-2,0),
HideStyle:=userdash, LineStyle:=userdash,
Ligne3D([A,B,jump,A1,A3,jump,A2,A4],0),
Color:=red, LabelSeg(Proj3D(O),Proj3D(A),"$x$",[rotation:=0]), Color:=black,
LineStyle:=solid, FillStyle:=full, FillColor:=pink,
angleD(Proj3D(A2),Proj3D(O),Proj3D(A),0.15),
angleD(Proj3D(A1),Proj3D(O),Proj3D(A),0.15),
FillOpacity:=0.3, Dpyramide([A1,A2,A3,A4],A,2),
FillOpacity:=1, FillStyle:=none,
markseg3d(A1,A2,2,0.1,0.2), markseg3d(A3,A2,2,0.1,0.2),
LabelDot3D(A,"$A$","N",0,0.15), LabelDot3D(O,"$B$","S",0,0.15),
distance(A1,A2,"$9$",1.5*vecI),
RestoreAttr(),
SetMatrix3D( matrix3d(shift3d(M,5*vecJ)) ),
A1:=M(3,-4,0),A2:=M(3,4,0),A3:=M(-3,4,0),A4:=M(-3,-4,0),
B1:=M(1,-1.5,2),B2:=M(1,1.5,2),B3:=M(-1,1.5,2),B4:=M(-1,-1.5,2),
FillStyle:=full, FillColor:=pink,
Dparallelep(A4,6*vecI,8*vecJ,2*vecK,1), Dparallelep(B4,2*vecI,3*vecJ,3*vecK,1),
FillStyle:=none,
distance(A1,A2,"$10$",1.5*vecI), distance(A2,A3,"$6$",vecJ),
distance(B2,B3,"$2$",vecJ), distance(B2,B1,"$3.5$",1.5*vecI),
distance(B1+3*vecK,B1,"$x$",-vecJ),
IdMatrix3D()
];
\end{texgraph}
Flag a écrit:PS : je ne suis pas forcément fan de la perspective cavalière mais en parcourant les figures ce n'est pas souvent le cas avec Texgraph, est-ce un choix du logiciel ?
Revenir vers TeXgraph dans LaTeX
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 15 invités