{"id":7419,"date":"2026-05-25T00:37:03","date_gmt":"2026-05-24T22:37:03","guid":{"rendered":"https:\/\/entropie.org\/3615\/?p=7419"},"modified":"2026-05-25T01:28:39","modified_gmt":"2026-05-24T23:28:39","slug":"circuit-en-latex-avec-circuitikz","status":"publish","type":"post","link":"https:\/\/entropie.org\/3615\/index.php\/2026\/05\/25\/circuit-en-latex-avec-circuitikz\/","title":{"rendered":"Circuit en LaTeX avec circuitikz"},"content":{"rendered":"<p><a href=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2026\/05\/circuit-parallele-1b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2026\/05\/circuit-parallele-1b.png\" alt=\"\" width=\"771\" height=\"367\" class=\"alignnone size-full wp-image-7424\" srcset=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2026\/05\/circuit-parallele-1b.png 771w, https:\/\/entropie.org\/3615\/wp-content\/uploads\/2026\/05\/circuit-parallele-1b-300x143.png 300w, https:\/\/entropie.org\/3615\/wp-content\/uploads\/2026\/05\/circuit-parallele-1b-768x366.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<pre>\r\n\\documentclass[border=10pt]{standalone}\r\n\\usepackage{circuitikz}\r\n\\ctikzset{resistor=european}\r\n\r\n\\begin{document}\r\n\\begin{circuitikz}[scale=1.2]\r\n  % === une grille pour s'aider ===\r\n  % \\draw [help lines] (-2,-1) grid (9,5);\r\n\r\n  % === Source \u00e0 gauche (bornes invers\u00e9es) ===\r\n  \\draw (0,3) to[battery1] (0,0);\r\n\r\n  % === Fl\u00e8che tension U \u00e0 gauche du g\u00e9n\u00e9rateur, pointant vers le haut ===\r\n  \\draw[->, thick] (-0.6,0.4) -- (-0.6,2.6) node[midway, left] {$U$};\r\n\r\n  % === Fil bas de la source ===\r\n  \\draw (0,0) -- (6,0);\r\n\r\n  % === Fil sup\u00e9rieur gauche avec courant I ===\r\n  \\draw (0,3) to[short, i=$I$] (3,3);\r\n\r\n  % === Courant I1 sur le fil avant R1, puis R1 centr\u00e9 sur la branche ===\r\n  \\draw (3,3) to[short, i=$I_1$] (3.6,3);\r\n  \\draw (3.6,3) to[R, l_=$R_1$] (5.4,3);\r\n  \\draw (5.4,3) -- (6,3);\r\n  \\draw[->, thick] (5.4,3.55) -- (3.6,3.55) node[midway, above] {$U_1$};\r\n\r\n  % === Fils verticaux gauche et droit du bloc parall\u00e8le ===\r\n  \\draw (3,3) -- (3,1.5);\r\n  \\draw (6,3) -- (6,1.5);\r\n\r\n  % === Courant I2 sur le fil vertical gauche descendant vers R2 ===\r\n  \\draw (3,3) to[short, i_=$I_2$] (3,1.5);\r\n\r\n  % === Branche basse : R2 + R3 en s\u00e9rie ===\r\n  \\draw (3,1.5) to[R, l=$R_2$] (4.5,1.5)\r\n                to[R, l=$R_3$] (6,1.5);\r\n  \\draw[->, thick] (4.3,1.0) -- (3.2,1.0) node[midway, below] {$U_2$};\r\n  \\draw[->, thick] (5.8,1.0) -- (4.7,1.0) node[midway, below] {$U_3$};\r\n\r\n  % === Fermeture droite du circuit ===\r\n  \\draw (6,3) -- (8,3) -- (8,0) -- (6,0);\r\n\r\n\\end{circuitikz}\r\n\\end{document}\r\n<\/pre>\n<p>Texmaker g\u00e9n\u00e8re un pdf, mais on peut aussi utiliser en ligne de commande :<\/p>\n<pre>\r\npdflatex circuit.tex\r\n<\/pre>\n<p>Pour obtenir une image svg \u00e0 int\u00e9grer dans LibreOffice :<\/p>\n<pre>\r\nsudo apt-get install pdf2svg\r\npdf2svg circuit.pdf circuit.svg\r\n<\/pre>\n<p>Un fichier bash circuit.sh pour automatiser tout \u00e7a :<\/p>\n<pre>\r\n#!\/bin\/bash\r\n\r\n# V\u00e9rification de l'argument\r\nif [ $# -ne 1 ]; then\r\n  echo \"Usage : $0 fichier.tex\"\r\n  exit 1\r\nfi\r\n\r\nFICHIER=\"$1\"\r\n\r\n# V\u00e9rification que le fichier existe\r\nif [ ! -f \"$FICHIER\" ]; then\r\n  echo \"Erreur : fichier '$FICHIER' introuvable.\"\r\n  exit 1\r\nfi\r\n\r\n# Nom sans extension\r\nNOM=\"${FICHIER%.tex}\"\r\n\r\n# Compilation LaTeX\r\necho \"Compilation LaTeX...\"\r\npdflatex -interaction=nonstopmode \"$FICHIER\"\r\n\r\nif [ $? -ne 0 ]; then\r\n  echo \"Erreur lors de la compilation LaTeX.\"\r\n  exit 1\r\nfi\r\n\r\n# Conversion en SVG\r\necho \"Conversion en SVG...\"\r\npdf2svg \"${NOM}.pdf\" \"${NOM}.svg\"\r\n\r\nif [ $? -ne 0 ]; then\r\n  echo \"Erreur lors de la conversion en SVG.\"\r\n  exit 1\r\nfi\r\n\r\n# Nettoyage des fichiers temporaires\r\nrm -f \"${NOM}.aux\" \"${NOM}.log\"\r\n\r\necho \"Termin\u00e9 : ${NOM}.pdf et ${NOM}.svg g\u00e9n\u00e9r\u00e9s.\"\r\n\r\n<\/pre>\n<p>Utilisation :<\/p>\n<pre>\r\nchmod +x circuit.sh\r\n.\/circuit.sh circuit.tex\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\\documentclass[border=10pt]{standalone} \\usepackage{circuitikz} \\ctikzset{resistor=european} \\begin{document} \\begin{circuitikz}[scale=1.2] % === une grille pour s&rsquo;aider === % \\draw [help lines] (-2,-1) grid (9,5); % === Source \u00e0 gauche (bornes invers\u00e9es) === \\draw (0,3) to[battery1] (0,0); % === Fl\u00e8che tension U \u00e0 gauche du g\u00e9n\u00e9rateur, pointant vers le haut === \\draw[->, thick] (-0.6,0.4) &#8212; (-0.6,2.6) node[midway, left] {$U$}; % === &hellip; <a href=\"https:\/\/entropie.org\/3615\/index.php\/2026\/05\/25\/circuit-en-latex-avec-circuitikz\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Circuit en LaTeX avec circuitikz&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,14,57],"tags":[],"class_list":["post-7419","post","type-post","status-publish","format-standard","hentry","category-bash","category-electronique","category-latex"],"_links":{"self":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/7419"}],"collection":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/comments?post=7419"}],"version-history":[{"count":10,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/7419\/revisions"}],"predecessor-version":[{"id":7432,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/7419\/revisions\/7432"}],"wp:attachment":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/media?parent=7419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/categories?post=7419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/tags?post=7419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}