{"id":2303,"date":"2020-05-02T16:13:59","date_gmt":"2020-05-02T14:13:59","guid":{"rendered":"https:\/\/www.mathweb.fr\/euclide\/?p=2303"},"modified":"2024-06-09T16:57:32","modified_gmt":"2024-06-09T14:57:32","slug":"creer-une-arborescence-avec-python-et-latex","status":"publish","type":"post","link":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/","title":{"rendered":"Cr\u00e9er une arborescence avec Python et LaTeX"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Dans cet article, nous parlerons d&rsquo;une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l&rsquo;aide de Python. Nous allons parler d&rsquo;arbre informatique pour obtenir un r\u00e9sultat comme celui-ci:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"125\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png\" alt=\"\" class=\"wp-image-2304\"\/><figcaption class=\"wp-element-caption\">Arborescence cr\u00e9\u00e9e en \\(\\LaTeX\\) \u00e0 l&rsquo;aide de Python<\/figcaption><\/figure>\n<\/div>\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Au menu sur cette page...<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#Arborescence_en_LaTeX_parlons_classe_en_Python\" >Arborescence en LaTeX: parlons classe en Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#Une_fonction_pour_construire_larbre\" >Une fonction pour construire l&rsquo;arbre<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#Construction_du_fichier_LaTeX\" >Construction du fichier \\(\\LaTeX\\)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#Les_icones\" >Les ic\u00f4nes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#Telechargez_le_script\" >T\u00e9l\u00e9chargez le script<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Arborescence_en_LaTeX_parlons_classe_en_Python\"><\/span>Arborescence en LaTeX: parlons classe en Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nous allons commencer par le script Python : c&rsquo;est lui qui va g\u00e9n\u00e9rer le fichier \\(\\LaTeX\\).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">En Python, os.walk (du module os) permet de parcourir une arborescence. Nous allons nous en servir dans une classe \u00ab\u00a0Node\u00a0\u00bb. Cette classe aura pour but de construire un arbre correspondant \u00e0 notre arborescence.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Node:\n    def __init__(self,nodeValue):\n        self.subNodes = []\n        self.value = nodeValue\n\n    def addSubNode(self,node):\n        self.subNodes.append(node)\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Le constructeur de cette classe d\u00e9finit une liste (initialement vide) nomm\u00e9e <em>subNodes<\/em>, qui contiendra les n\u0153uds-fils, ainsi qu&rsquo;une variable nomm\u00e9e <em>value<\/em> qui, on s&rsquo;en doute, contiendra la valeur du n\u0153ud.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On d\u00e9finit ensuite une m\u00e9thode <em>addSubNode<\/em> qui, comme son nom l&rsquo;indique, ajoute \u00e0 la liste <em>subNodes<\/em> les n\u0153uds-fils d&rsquo;un n\u0153ud.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00c0 cela, on doit ajouter une autre m\u00e9thode qui aura pour mission de construire le fichier \\(\\LaTeX\\). C&rsquo;est l\u00e0 que \u00e7a devient compliqu\u00e9.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Vous pourrez t\u00e9l\u00e9charger le script complet via le lien \u00e0 la fin de l&rsquo;article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Une_fonction_pour_construire_larbre\"><\/span>Une fonction pour construire l&rsquo;arbre<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Une fois la classe d\u00e9finie, il nous faut construire l&rsquo;arbre:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def getDirectoryNode(path):\n    node = Node(os.path.split(path)[1])\n    \n    if os.path.isdir(path):\n        for itemName in os.listdir(path):\n            fullPathName = os.path.join(path,itemName)\n            node.addSubNode(getDirectoryNode(fullPathName))\n    return node<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Cette fonction permet de d\u00e9finit un arbre. Par exemple:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tree = getDirectoryNode(\"exemple\")<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">d\u00e9finit un arbre correspondant \u00e0 l&rsquo;arborescence d&rsquo;un dossier nomm\u00e9 \u00ab\u00a0exemple\u00a0\u00bb. Il ne reste plus qu&rsquo;\u00e0 construire le fichier \\(\\LaTeX\\):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tree.construct()<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Construction_du_fichier_LaTeX\"><\/span>Construction du fichier \\(\\LaTeX\\)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Pour \u00eatre honn\u00eate, la m\u00e9thode construct() de mon fichier ne fait que d\u00e9finir une cha\u00eene de caract\u00e8res (nomm\u00e9e <em>affichage<\/em>) contenant le code \\(\\LaTeX\\) principal. La construction m\u00eame du fichier TEX est faite par la fonction suivante:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def create_latex(filename):\n    document = \"\\\\documentclass{standalone}\\n\"\n    document += \"\\\\usepackage{tikz}\\\\usetikzlibrary{calc,decorations.pathmorphing}\\n\"\n    document += \"\\\\begin{document}\\n\"\n    document += \"\\\\newsavebox{\\\\arbor}%\\n\"\n    document += \"\\\\begin{lrbox}{\\\\arbor}%\\n\"\n    document += affichage\n    document += \"\\\\end{tikzpicture}\\n\"\n    document += \"\\\\end{lrbox}%\\n\"\n    document += \"\\\\begin{tikzpicture}\\n\"\n    document += \"\\\\node[inner sep=0pt,outer sep=0pt,fill=yellow!25,draw,thick,decorate, decoration={random steps,segment length=3pt,amplitude=1pt}] {\\\\usebox{\\\\arbor}};\\n\"\n    document += \"\\\\end{tikzpicture}\\n\"\n    document += \"\\\\end{document}\"\n    \n    if os.path.isfile(filename+\".tex\"):\n        os.remove(filename+\".tex\")\n    \n    fichier = open(filename+\".tex\",\"x\")\n    fichier.write(document)\n    fichier.close()\n\n    # compilation PdfLaTeX dans le r\u00e9pertoire courant\n\n    cmd = \"pdflatex  --shell-escape -synctex=1 -interaction=nonstopmode \"+filename+\".tex\"\n    os.system(cmd)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Les_icones\"><\/span>Les ic\u00f4nes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Vous avez sans doute remarqu\u00e9 sur l&rsquo;image que les ic\u00f4nes variaient suivant le type de fichier rencontr\u00e9. C&rsquo;est gr\u00e2ce au dictionnaire suivant:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dico_ext = { 'png' : 'img' , 'jpg' : 'img' , 'gif' : 'img' , 'tiff' : 'img' , 'pdf' : 'pdf' }<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">o\u00f9 les cl\u00e9s sont les extensions et les valeurs, le nom de l&rsquo;ic\u00f4ne. Pour simplifier les choses, je n&rsquo;ai souhait\u00e9 afficher qu&rsquo;une ic\u00f4ne pour les fichiers images; c&rsquo;est pour cela que les fichiers png, jpg, gif et tiff sont associ\u00e9s \u00e0 l&rsquo;icone \u00ab\u00a0img.png\u00a0\u00bb (une ic\u00f4ne est une image que j&rsquo;ai mise au format png). Mais gr\u00e2ce \u00e0 ce dictionnaire, vous pouvez mettre autant d&rsquo;ic\u00f4nes que vous le souhaitez !<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Telechargez_le_script\"><\/span>T\u00e9l\u00e9chargez le script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Vous trouverez le fichier <em>arborescence.zip<\/em> contenant le script Python ainsi que les dossiers exemples ci-dessous:<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter um_article\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.zip\">arborescence<\/a><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.zip\" class=\"wp-block-file__button wp-element-button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Dans cet article, nous parlerons d&rsquo;une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l&rsquo;aide de Python. Nous allons parler d&rsquo;arbre informatique pour obtenir un r\u00e9sultat comme celui-ci:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1,5],"tags":[204],"class_list":["post-2303","post","type-post","status-publish","format-standard","hentry","category-informatique","category-latex","category-python","tag-arbre"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr<\/title>\n<meta name=\"description\" content=\"Nous parlerons d&#039;une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l&#039;aide de Python. Nous allons parler d&#039;arbre informatique.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr\" \/>\n<meta property=\"og:description\" content=\"Nous parlerons d&#039;une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l&#039;aide de Python. Nous allons parler d&#039;arbre informatique.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/\" \/>\n<meta property=\"og:site_name\" content=\"Mathweb.fr\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-02T14:13:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-09T14:57:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Pasquet\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Pasquet\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/\"},\"author\":{\"name\":\"St\u00e9phane Pasquet\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"headline\":\"Cr\u00e9er une arborescence avec Python et LaTeX\",\"datePublished\":\"2020-05-02T14:13:59+00:00\",\"dateModified\":\"2024-06-09T14:57:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/\"},\"wordCount\":440,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/arborescence.png\",\"keywords\":[\"arbre\"],\"articleSection\":[\"Informatique\",\"LaTeX\",\"Python\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/\",\"name\":\"Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/arborescence.png\",\"datePublished\":\"2020-05-02T14:13:59+00:00\",\"dateModified\":\"2024-06-09T14:57:32+00:00\",\"description\":\"Nous parlerons d'une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l'aide de Python. Nous allons parler d'arbre informatique.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/arborescence.png\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/arborescence.png\",\"width\":125,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/05\\\/02\\\/creer-une-arborescence-avec-python-et-latex\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cr\u00e9er une arborescence avec Python et LaTeX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\",\"name\":\"Mathweb.fr\",\"description\":\"Math\u00e9matiques, LaTeX et Python\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\",\"name\":\"St\u00e9phane Pasquet\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"width\":74,\"height\":77,\"caption\":\"St\u00e9phane Pasquet\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr","description":"Nous parlerons d'une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l'aide de Python. Nous allons parler d'arbre informatique.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/","og_locale":"fr_FR","og_type":"article","og_title":"Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr","og_description":"Nous parlerons d'une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l'aide de Python. Nous allons parler d'arbre informatique.","og_url":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/","og_site_name":"Mathweb.fr","article_published_time":"2020-05-02T14:13:59+00:00","article_modified_time":"2024-06-09T14:57:32+00:00","og_image":[{"url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png","type":"","width":"","height":""}],"author":"St\u00e9phane Pasquet","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"St\u00e9phane Pasquet","Dur\u00e9e de lecture estim\u00e9e":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#article","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/"},"author":{"name":"St\u00e9phane Pasquet","@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"headline":"Cr\u00e9er une arborescence avec Python et LaTeX","datePublished":"2020-05-02T14:13:59+00:00","dateModified":"2024-06-09T14:57:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/"},"wordCount":440,"commentCount":0,"publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png","keywords":["arbre"],"articleSection":["Informatique","LaTeX","Python"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/","url":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/","name":"Cr\u00e9er une arborescence avec Python et LaTeX - Mathweb.fr","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#primaryimage"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png","datePublished":"2020-05-02T14:13:59+00:00","dateModified":"2024-06-09T14:57:32+00:00","description":"Nous parlerons d'une fa\u00e7on de construire une arborescence en LaTeX \u00e0 l'aide de Python. Nous allons parler d'arbre informatique.","breadcrumb":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#primaryimage","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/05\/arborescence.png","width":125,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/05\/02\/creer-une-arborescence-avec-python-et-latex\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.mathweb.fr\/euclide\/"},{"@type":"ListItem","position":2,"name":"Cr\u00e9er une arborescence avec Python et LaTeX"}]},{"@type":"WebSite","@id":"https:\/\/www.mathweb.fr\/euclide\/#website","url":"https:\/\/www.mathweb.fr\/euclide\/","name":"Mathweb.fr","description":"Math\u00e9matiques, LaTeX et Python","publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mathweb.fr\/euclide\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":["Person","Organization"],"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69","name":"St\u00e9phane Pasquet","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","width":74,"height":77,"caption":"St\u00e9phane Pasquet"},"logo":{"@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp"}}]}},"_links":{"self":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/2303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/comments?post=2303"}],"version-history":[{"count":0,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/2303\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media?parent=2303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/categories?post=2303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/tags?post=2303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}