% environnement "ifactors" : decomposition en produit de facteurs premiers \begin{VerbatimOut}{pascours-ifactors.cxx} maple_mode(0); n:=read("n.val"); F:=ifactors(n); l:=size(F); T:=""; c:=0; for (k:=0;k=latex,declare function={f(\x)=\cmdPAS@graphsuite@function;}] \ifPAS@graphsuite@grid \draw[color=\cmdPAS@graphsuite@gridcolor,style=\cmdPAS@graphsuite@gridstyle] (\cmdPAS@graphsuite@xmin,\cmdPAS@graphsuite@ymin) grid[xstep=\cmdPAS@graphsuite@gridxstep,ystep=\cmdPAS@graphsuite@gridystep] (\cmdPAS@graphsuite@xmax,\cmdPAS@graphsuite@ymax); \fi \draw[thick,->] (\cmdPAS@graphsuite@xmin,0) -- (\cmdPAS@graphsuite@xmax,0); \draw[thick,->] (0,\cmdPAS@graphsuite@ymin) -- (0,\cmdPAS@graphsuite@ymax); \pgfmathparse{\cmdPAS@graphsuite@xmax-1}\let\xmaxgrad\pgfmathresult \pgfmathparse{\cmdPAS@graphsuite@ymax-1}\let\ymaxgrad\pgfmathresult \foreach \x in {\cmdPAS@graphsuite@xmin,...,\xmaxgrad} { \ifnum\x=0 \else \draw[thick] (\x,0.1) -- (\x,-0.1) node[below] {\x}; \fi } \foreach \y in {\cmdPAS@graphsuite@ymin,...,\ymaxgrad} { \ifnum\y=0 \else \draw[thick] (0.1,\y) -- (-0.1,\y) node[left] {\y}; \fi } \clip (\cmdPAS@graphsuite@xmin,\cmdPAS@graphsuite@ymin) rectangle (\cmdPAS@graphsuite@xmax,\cmdPAS@graphsuite@ymax); \ifnum\cmdPAS@graphsuite@xmin<\cmdPAS@graphsuite@ymin \let\min\cmdPAS@graphsuite@xmin \else \let\min\cmdPAS@graphsuite@ymin \fi \ifnum\cmdPAS@graphsuite@xmax<\cmdPAS@graphsuite@ymax \let\max\cmdPAS@graphsuite@ymax \else \let\max\cmdPAS@graphsuite@xmax \fi \draw (\min,\min) -- (\max,\max); \draw[color=\cmdPAS@graphsuite@colorfunction] plot[domain=\cmdPAS@graphsuite@xmin:\cmdPAS@graphsuite@xmax,samples=100] (\x,{f(\x)}); % Début de la construction \global\let\x\cmdPAS@graphsuite@u \draw[style=\cmdPAS@graphsuite@styleconstruction,color=\cmdPAS@graphsuite@colorconstruction] (\x,0) -- (\x,{f(\x)}); \global\let\xant\x\pgfmathparse{f(\x)}\global\let\x\pgfmathresult \foreach \f in {1,...,\cmdPAS@graphsuite@nmax} { \draw[style=\cmdPAS@graphsuite@styleconstruction,color=\cmdPAS@graphsuite@colorconstruction] (\xant,\x) -- (\x,\x) -- (\x,{f(\x)}); \global\let\xant\x\pgfmathparse{f(\x)}\global\let\x\pgfmathresult } \end{tikzpicture} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%%%Environnement xcas \newcommand{\executGiac}[1]{ \ifwindows \immediate\write18{giac #1 } \else \immediate\write18{giac <#1 } \fi } \begin{VerbatimOut}{xcas.in} maple_mode(0); Sortie:=fopen("xcas.tex"); read("xcas.out"); Resultat:=cat(latex(ans())); fprint(Sortie,Unquoted,Resultat); fclose(Sortie); \end{VerbatimOut} \newenvironment{xcas} {\VerbatimEnvironment\begin{VerbatimOut}{xcas.out}} {\end{VerbatimOut} \executGiac{xcas.in} \input{xcas.tex} }