Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
composition:illustrations:dessiner_avec_tex [2018/12/02 22:31] – jejust | 3_composition:illustrations:dessiner_avec_tex [2022/10/04 12:52] (Version actuelle) – [Avec l'extension “TikZ”] Ajout de lien vers TeX4ht dbitouze | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== | + | ====== |
+ | Il existe de nombreux logiciels permettant de faire des dessins directement dans (La)TeX (plutôt que d' | ||
- | There are many packages to do pictures in (La)TeX itself (rather than | + | ===== Avec les commandes de base ===== |
- | importing graphics created externally), | + | |
- | LaTeX '' | + | |
- | '' | + | |
- | sophisticated (but slow) drawing with PicTeX. Depending on your type | + | |
- | of drawing, and setup, here are a few systems you may consider: | + | |
- | | + | |
- | - The '' | + | L' |
- | drawing capabilities (anything requiring more than linear | + | à moins qu'une police de caractères ne puisse vous venir en aide. Cet environnement dispose de sa propre définition de la commande |
- | calculations is excluded, unless a font can come to your help). | + | comme unité de mesure de base. Cette fonctionnalité pouvant être gênante, l'extension |
- | | + | si une longueur est citée sous forme de nombre ou de longueur et agit en conséquence. |
- | basic measurement in a diagram, may be avoided by use of the | + | |
- | [[ctanpkg> | + | |
- | as a number or as a length, and acts accordingly. | + | |
- | - [[ctanpkg> | + | |
- | '' | + | |
- | [[ctanpkg> | + | |
- | '' | + | |
- | '' | + | |
- | business, far less efficiently. | + | |
- | - [[ctanpkg> | + | |
- | [[FAQ-latex-books|the LaTeX manual]], but didn't appear for nearly | + | |
- | ten years after publication of the book! It removes all the petty | + | |
- | restrictions that surround the use of the '' | + | |
- | environment. | + | |
- | eccentric drawing language of the environment, | + | |
- | useful tool than the original environment has ever been. (Note that | + | |
- | [[ctanpkg> | + | |
- | | + | |
- | - PicTeX is a venerable, and very powerful, system, that draws | + | |
- | by placing dots on the page to give the effect of a line or curve. | + | |
- | this has the potential of great power, it is (of course) much slower | + | |
- | than any of the other established packages. | + | |
- | are problems with its [[FAQ-docpictex|documentation]]. | + | |
- | - [[ctanpkg> | + | |
- | PostScript via a set of TeX macros, which talk to PostScript using | + | |
- | [[FAQ-specials|'' | + | |
- | pretty powerful programming language, many astounding things can in | + | |
- | principle be achieved using [[ctanpkg> | + | |
- | contributed packages, ranging from world mapping to lens design | + | |
- | diagrams, is available). | + | |
- | [[ctanpkg> | + | |
- | by default specific to '' | + | |
- | a [[ctanpkg> | + | |
- | operate under XeTeX. | + | |
- | which (like [[ctanpkg> | + | |
- | [[FAQ-pdftexgraphics|pdfLaTeX graphics]]) generates | + | |
- | PDF files using an auxiliary program, from [[ctanpkg> | + | |
- | commands ([[ctanpkg> | + | |
- | the [[ctanpkg> | + | |
- | | + | |
- | There is a [[ctanpkg> | + | Voici un exemple d'utilisation |
- | (<a href=" | + | |
- | [[https:// | + | |
- | just browse the | + | |
- | [[https:// | + | |
- | - [[ctanpkg> | + | |
- | convenient from " | + | |
- | pretty tiresome: if you | + | |
- | simply want the graphical capabilities, | + | |
- | its " | + | |
- | bet for you. While PDF has (in essence) the same graphical | + | |
- | capabilities as PostScript, it isn't programmable; | + | |
- | LaTeX commands that will utilise the graphical capabilities of | + | |
- | both PostScript and PDF equally. | + | |
- | mathematical support, which allows it to rival [[ctanpkg> | + | |
- | use of the computation engine within PostScript. | + | |
- | The [[ctanpkg> | + | |
- | allows the user to get a feel for the capabilities of the system, is | + | |
- | available at <http:// | + | |
- | - MetaPost; you liked MetaFont, but never got to grips with font files? | + | |
- | Try [[FAQ-MP|MetaPost]] --- | + | |
- | all the power of MetaFont, but it generates PostScript figures; MetaPost | + | |
- | is nowadays part of most serious (La)TeX distributions. | + | |
- | uses it for all his work... | + | |
- | | + | |
- | Note that you can | + | <WRAP column 45ex> |
- | | + | <code latex> |
- | keep it in-line with your LaTeX code). | + | \setlength\unitlength{1mm} |
- | - You liked MetaFont | + | \begin{picture}(32,40)(-2,-2) |
- | '' | + | \put(0,0){\circle{1}} |
- | | + | \put(25, |
- | of MetaFont or MetaPost, but a friendlier interface, and with MetaPost output | + | \put(12,26){\circle*{15}} |
- | the results can be used equally well in either LaTeX or pdfLaTeX. | + | \qbezier(5,5)(30,40)(25,0) |
- | - You liked PicTeX but don't have enough memory or time? Look | + | \end{picture} |
- | at the late Eitan Gurari' | + | </ |
- | but is an entirely new implementation which is not as hard on | + | </WRAP> |
- | | + | <WRAP column 30ex> |
- | as well as in the author' | + | < |
- | " | + | \documentclass{article} |
- | which remains available from on-line booksellers. | + | |
- | In addition, there are several means of generating code for your | + | \begin{document} |
- | graphics application | + | \setlength\unitlength{1mm} |
- | MetaPost, at least) in-line in your document, and then have them | + | \begin{picture}(32,40)(-2,-2) |
- | processed in a command spawned from your (La)TeX run. For details, | + | \put(0,0){\circle{1}} |
- | see [[FAQ-inlgrphapp|question]]. | + | \put(25,0){\line(-1,2){10}} |
+ | \put(12,26){\circle*{15}} | ||
+ | \qbezier(5,5)(30, | ||
+ | \end{picture} | ||
+ | \end{document} | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear /> | ||
+ | ===== Avec les extensions “epic”, “eepic” et '' | ||
- | --- | + | L' |
+ | ===== Avec l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Voici des courbes de Bézier (quadratique et cubique) avec [[ctanpkg> | ||
+ | |||
+ | <code latex> | ||
+ | \documentclass{article} | ||
+ | \usepackage{ifpdf} | ||
+ | \ifpdf | ||
+ | \usepackage[pdftex]{pict2e} | ||
+ | \else | ||
+ | \usepackage[dvips]{pict2e} | ||
+ | \fi | ||
+ | \usepackage{color} | ||
+ | |||
+ | \newcommand*\FPOINT{ | ||
+ | \begingroup | ||
+ | \setlength\unitlength{.8pt} | ||
+ | \circle*{5} | ||
+ | \endgroup | ||
+ | } | ||
+ | |||
+ | \newcommand*\OPOINT{ | ||
+ | \begingroup | ||
+ | \setlength\unitlength{.8pt} | ||
+ | \circle{5} | ||
+ | \endgroup | ||
+ | } | ||
+ | |||
+ | \begin{document} | ||
+ | \setlength\unitlength{.007\linewidth} | ||
+ | |||
+ | \begin{picture}(100, | ||
+ | \put(-50, | ||
+ | \color{green} | ||
+ | \qbezier[0](-40, | ||
+ | \qbezier[0](0, | ||
+ | \put(-40, | ||
+ | \put(0, | ||
+ | \put(30, | ||
+ | \color{black} | ||
+ | \cbezier[0](-40, | ||
+ | \put(-40, | ||
+ | \put(20, | ||
+ | \end{picture} | ||
+ | \end{document} | ||
+ | </ | ||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Vous avez aimé PicTeX mais il a été trop gourmand en mémoire ou en temps ? Testez l' | ||
+ | |||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | En voici un exemple : | ||
+ | |||
+ | <code latex> | ||
+ | \documentclass{report} | ||
+ | \usepackage{xy} | ||
+ | |||
+ | \begin{document} | ||
+ | \begin{xy} | ||
+ | (0,0)*+{A}; (20, | ||
+ | (0,20)*+{C} **\dir2{~} | ||
+ | \end{xy} | ||
+ | \end{document} | ||
+ | </ | ||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | [[ctanpkg> | ||
+ | |||
+ | Les commandes '' | ||
+ | |||
+ | Il existe une liste de diffusion en anglais traitant de [[ctanpkg> | ||
+ | |||
+ | Voici un exemple de dessin réalisé avec [[ctanpkg> | ||
+ | |||
+ | <code latex> | ||
+ | \documentclass{report} | ||
+ | \usepackage{pstricks} | ||
+ | |||
+ | \begin{document} | ||
+ | \psset{unit=3pt} | ||
+ | \begin{pspicture}(-10, | ||
+ | \psline[linewidth=1, | ||
+ | {*-> | ||
+ | \psline[linewidth=1pt, | ||
+ | (-10, | ||
+ | \pspolygon(30, | ||
+ | \pscircle*[linewidth=5pt, | ||
+ | \pswedge*[linecolor=blue](40, | ||
+ | \psarc*[linecolor=green](40, | ||
+ | \psbezier{*-*}(0, | ||
+ | \psellipse(40, | ||
+ | \end{pspicture} | ||
+ | \end{document} | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | Alors que l' | ||
+ | son utilisation avec '' | ||
+ | à étudier pour faire des dessins. Il est conçu avec des // | ||
+ | qui lui donnent une grande souplesse. L' | ||
+ | Mais il est possible d' | ||
+ | Grâce aux interfaces dorsales, il fonctionne avec < | ||
+ | avec [[ctanpkg> | ||
+ | ce qui lui permet de rivaliser avec l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | <WRAP column 45ex> | ||
+ | <code latex> | ||
+ | \documentclass{article} | ||
+ | \usepackage{tikz} | ||
+ | \usetikzlibrary{snakes} | ||
+ | \usetikzlibrary{trees} | ||
+ | |||
+ | \begin{document} | ||
+ | \tikzstyle{level 1}=[% | ||
+ | sibling angle=120] | ||
+ | \tikzstyle{level 2}=[% | ||
+ | sibling angle=60] | ||
+ | \tikzstyle{level 3}=[% | ||
+ | sibling angle=30] | ||
+ | \tikzstyle{every node}=[fill] | ||
+ | \tikzstyle{edge from parent}=[% | ||
+ | snake=expanding waves,% | ||
+ | segment length=1mm, | ||
+ | segment angle=10, | ||
+ | |||
+ | \tikz [grow cyclic, | ||
+ | very thick, | ||
+ | level distance=13mm, | ||
+ | \node {} child [color=\A] | ||
+ | foreach \A in {red, | ||
+ | { node {} child [color=\A!50!\B] | ||
+ | foreach \B in {red, | ||
+ | { node {} child [% | ||
+ | | ||
+ | | ||
+ | | ||
+ | { node {} } | ||
+ | } | ||
+ | }; | ||
+ | \end{document} | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP column 45ex> | ||
+ | < | ||
+ | \documentclass{article} | ||
+ | \usepackage{tikz} | ||
+ | \usetikzlibrary{snakes} | ||
+ | \usetikzlibrary{trees} | ||
+ | \pagestyle{empty} | ||
+ | \begin{document} | ||
+ | \tikzstyle{level 1}=[sibling angle=120] | ||
+ | \tikzstyle{level 2}=[sibling angle=60] | ||
+ | \tikzstyle{level 3}=[sibling angle=30] | ||
+ | \tikzstyle{every node}=[fill] | ||
+ | \tikzstyle{edge from parent}=[snake=expanding waves, | ||
+ | | ||
+ | |||
+ | \tikz [grow cyclic, | ||
+ | level distance=13mm, | ||
+ | \node {} child [color=\A] | ||
+ | foreach \A in {red, | ||
+ | { node {} child [color=\A!50!\B] | ||
+ | foreach \B in {red, | ||
+ | { node {} child [color=\A!50!\B!50!\C] | ||
+ | | ||
+ | { node {} } | ||
+ | } | ||
+ | }; | ||
+ | \end{document} | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear /> | ||
+ | |||
+ | Si le [[texdoc> | ||
+ | * le // | ||
+ | * // | ||
+ | * // | ||
+ | |||
+ | ===== Avec Metapost ===== | ||
+ | |||
+ | À la différence des solutions précédentes, | ||
+ | mais un programme et un langage développé par John B. Hobby. Il met à votre disposition toute la puissance de '' | ||
+ | pour générer des graphiques '' | ||
+ | comme évoqué dans la question «[[3_composition/ | ||
+ | |||
+ | De nombreuses documentations et exemples sont disponibles sur Internet : | ||
+ | * la [[https:// | ||
+ | * la [[http:// | ||
+ | * le [[http:// | ||
+ | * le [[http:// | ||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | L' | ||
+ | du code < | ||
+ | est produit. Après avoir compilé le fichier obtenu avec Metafont ('' | ||
+ | |||
+ | <code latex> | ||
+ | \documentclass{article} | ||
+ | \usepackage{mfpic} | ||
+ | \begin{document} | ||
+ | \opengraphsfile{pics} | ||
+ | \begin{mfpic}[20]{-3}{3}{-3}{3} | ||
+ | \axes | ||
+ | \function{-2, | ||
+ | \tcaption{\raggedright{\it Fig. :} | ||
+ | Fonction dans un repère orthonormal.} | ||
+ | \end{mfpic} | ||
+ | \closegraphsfile | ||
+ | \end{document} | ||
+ | </ | ||
+ | |||
+ | [[ctanpkg> | ||
+ | |||
+ | ===== Avec du code d' | ||
+ | |||
+ | Il existe plusieurs moyens de générer du code pour votre application graphique ('' | ||
+ | avec du code placé dans votre document < | ||
+ | «[[3_composition: | ||
+ | |||
+ | ----- | ||
//Source:// [[faquk> | //Source:// [[faquk> | ||
- | {{htmlmetatags> | + | {{htmlmetatags> |
- | metatag-og: | + | metatag-og: |
metatag-og: | metatag-og: | ||
}} | }} | ||
- |