File: tortue.tex

package info (click to toggle)
giac 1.9.0.93%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 117,732 kB
  • sloc: cpp: 404,272; ansic: 205,462; python: 30,548; javascript: 28,788; makefile: 17,997; yacc: 2,690; lex: 2,464; sh: 705; perl: 314; lisp: 216; asm: 62; java: 41; xml: 36; sed: 16; csh: 7; pascal: 6
file content (92 lines) | stat: -rw-r--r-- 2,123 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
\documentclass{article}
%\oddsidemargin 5 mm
%\evensidemargin 5 mm
%\textwidth 16cm
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{times}
\usepackage{ifpdf}
\usepackage{makeidx}
\usepackage{graphicx}
\ifpdf
 \usepackage[pdftex,colorlinks]{hyperref}
\else
 \usepackage[ps2pdf,breaklinks=true,colorlinks=true,linkcolor=red,citecolor=green]{hyperref}
 \fi

\newtheorem{rem}{Remark}
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\N}{{\mathbb{N}}}
\newcommand{\Q}{{\mathbb{Q}}}
\newcommand{\faux}{$\square\;$}
\newcommand{\vrai}{$\square\;$}
%\newcommand{\vrai}{$\boxtimes\;$}
%\newcommand{\item}{\item \faux}
%\newcommand{\item}{\item \faux}
\newtheorem{thm}{Theorem}

\newtheorem{exo}{Exercice}[section]
\input{giacfr.tex}
\giacmathjax
%HEVEA\renewcommand{\footertext}{}

\title{Faire interagir \LaTeX\ avec Xcas}

\author{Bernard Parisse\\Institut Fourier\\UMR 5582 du
  CNRS\\Universit\'e de Grenoble I}
\date{2018}

%\bibliographystyle{plain}

\begin{document}
\begin{giacjshere}
\giacpython
%\makeindex

\tableofcontents
%\printindex

Exemples de commande Xcas dans un fichier \LaTeX\, deux formats de sortie
sont possibles~: 
\begin{itemize}
\item HTML5 avec \verb|hevea2mml|. Le lecteur peut ex\'ecuter des
commandes saisies par l'auteur, en les modifiant \'eventuellement. 
\item PDF avec \verb|icas|. Les commandes Xcas sont extraites
du fichier tex, exe\'ecut\'ees et leurs r\'esultats sont ins\'er\'es
dans un fichier temporaire qui est alors compil\'e avec \verb|pdflatex|.
\end{itemize}

\section{Graphes}

\giacinput{plot(sin(x))}

\section{Tortue logo}
\begin{giaconload}
def polyg(n,l):
  for j in range(n):
    avance l
    tourne_gauche 360/n
\end{giaconload}
% \giacinput{
% efface;
% for n from 3 to 10 do polyg(n,20) od;
% }
\begin{giaconloadhide}
for n from 5 to 10 do polyg(n,30) od;
\end{giaconloadhide}
\begin{giacprog}
#
efface
for n in range(2,11):
  polyg(n,20)
\end{giacprog}

\end{giacjshere}
\end{document}