我用 circuitikz 做过电路,效果很好。但是自从我在笔记本电脑上安装了 beamer(在 Linux 上)后,每行都有上百万个错误……
以下是代码:
\documentclass{article}
% Package langue
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
%Packages mathématiques
\usepackage{amsmath} %Equations
\usepackage{hyperref}
%Packages Figures et graphiques
\usepackage{graphics} %inclusion de figures
\usepackage{graphicx} %inclusion de figures
\usepackage{pgf,tikz}
\usepackage{circuitikz}
\usepackage{siunitx}
\begin{document}
\begin{circuitikz}
%circuit node[label={$V_{in}$}]
\draw (0, 0) to[short,o-] (10, 0)
(7,-4) -- (10,-4)
(0,-7) to[short,o-o] (10,-7);
%composants
\draw (3,-4) to [Schottky diode] (3,0)
(7,0) to [ecapacitor] (7,-4)
(10,-4) to [R] (10,0)
(3,-4) to [inductor,l_=\SI{2}{\henry}] (7,-4);
%mosfet
\draw (3,-5.5) node[njfet] (fet) {}
(fet.G) node[anchor=south] {G}
(fet.D) node[anchor=north east] {D}
(fet.S) node[anchor=south east] {S};
\draw (9.5,-2.6) node[rotate=90,right]{10 $k \Omega$};
% circuit & labels
\draw (7.7,-2.4) node [rotate=90,right]{\SI{1}{\micro\farad}};
\draw (fet.D) -- (3,-4);
\draw (3,-7) -- (fet.S)
(5,-7) node[ground] {};
\draw [->,>=latex] (0,-6.8) -- (0,-0.2) node[below=0.7cm,right=0.1cm] {$V_{in}$};
\draw [->,>=latex] (10.5,-3.6) -- (10.5,-0.4) node[below=0.7cm,right=0.1cm] {$V_{out}$};
\end{circuitikz}
\end{document}
有人有办法或线索来解决这个问题吗? 太棒了! 非常感谢大家!
南卡罗来纳州
答案1
我认为您正在使用 TeX Live 2012,而新安装具有较新的 TeX 发行版。
您可以通过添加来解决问题\usetikzlibrary{babel}
。
也在hyperref
已加载的包中最后移动。graphics
无需加载。
\documentclass{article}
% Package langue
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
%Packages mathématiques
\usepackage{amsmath} %Equations
%Packages Figures et graphiques
\usepackage{graphicx} %inclusion de figures
\usepackage{pgf,tikz}
\usetikzlibrary{babel} %%% <--- Don't forget
\usepackage{circuitikz}
\usepackage{siunitx}
\usepackage{hyperref} %%% <--- This should be last
\begin{document}
\begin{circuitikz}
%circuit node[label={$V_{in}$}]
\draw (0, 0) to[short,o-] (10, 0)
(7,-4) -- (10,-4)
(0,-7) to[short,o-o] (10,-7);
%composants
\draw (3,-4) to [Schottky diode] (3,0)
(7,0) to [ecapacitor] (7,-4)
(10,-4) to [R] (10,0)
(3,-4) to [inductor,l_=\SI{2}{\henry}] (7,-4);
%mosfet
\draw (3,-5.5) node[njfet] (fet) {}
(fet.G) node[anchor=south] {G}
(fet.D) node[anchor=north east] {D}
(fet.S) node[anchor=south east] {S};
\draw (9.5,-2.6) node[rotate=90,right]{10 $k \Omega$};
% circuit & labels
\draw (7.7,-2.4) node [rotate=90,right]{\SI{1}{\micro\farad}};
\draw (fet.D) -- (3,-4);
\draw (3,-7) -- (fet.S)
(5,-7) node[ground] {};
\draw [->,>=latex] (0,-6.8) -- (0,-0.2) node[below=0.7cm,right=0.1cm] {$V_{in}$};
\draw [->,>=latex] (10.5,-3.6) -- (10.5,-0.4) node[below=0.7cm,right=0.1cm] {$V_{out}$};
\end{circuitikz}
\end{document}