Math & ScienceCircuitikz and AMSmath

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
niklz
Posts: 9
Joined: Sun Jan 24, 2010 9:51 pm

Circuitikz and AMSmath

Post by niklz »

Hi there,
I would like to use Circuitikz to draw circuit diagrams for a project report. However, it seems to conflict with amsmath, which I also need for the report.
Does anyone else know why this is, and a work around?
Running win7, TXC, MikteX
here's my code

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{amsbsy}
%\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage[sectionbib,round]{natbib}
\usepackage{hyperref}
\usepackage{subfig}
\usepackage{rotating}
\usepackage{braket}\usepackage[siunitx]{circuitikz}
\usepackage{tikz}
\begin{document}
\begin{figure}[htbp]%
\begin{center}
\subfloat[Series RLC Circuit]{\label{fig:seriesrlc}
\begin{circuitikz}[scale=1.2]\draw
(0,0)to[sV=$V_0\sin(\omega t)$, i^>=$I_s$] (0,2) --
(0,2)to[C=$C$] (2,2) --
(2,2)to[L=$L$] (2,0) --
(2,0)to[R, l_=$R$] (0,0)
;\end{circuitikz}
}
\subfloat[Parallel RLC Circuit]{\label{fig:parallelrlc}
\begin{circuitikz}[scale=1.2]\draw
(0,0)to[sV=$V_0\sin(\omega t)$, i^>=$I_p$] (0,2)
(1,2)to[C=$C$,i>^=$I_C$,*-*] (1,0)
(1,0)to[short] (3,0)
(2,2)to[L=$L$,i>^=$I_L$,*-*] (2,0)
(0,0)to[short] (1,0)
(3,2)to[R=$R$,i>^=$I_R$,*-*] (3,0)
(0,2)to[short] (3,2)
;\end{circuitikz}
}
\end{center}
\caption{Resonant RLC Circuits: \protect\subref{fig:seriesrlc} Series RLC configuration. \protect\subref{fig:parallelrlc} Parallel RLC configuration}
\label{fig:rlcres}
\end{figure}
\end{document}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
It works when amsmath is commented out, but not when it isn't.
Thanks in advance

kind regards,

niklz

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Circuitikz and AMSmath

Post by gmedina »

Hi,
niklz wrote:...It works when amsmath is commented out, but not when it isn't...
I just did a test and your code worked OK in my system even when amsmath was loaded. Perhaps your LaTeX systemm is using outdated packages? Add \listfiles just before \documentclass{article}
to your example code, compile it and then search the generated .log file for the section *File List*; in it you'll find a list of the packages used and their versions. Here's my *File List* after compilation of your code (with amsmath included):

Code: Select all

*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fancyhdr.sty
setspace.sty 2000/12/01 6.7 Contributed and Supported LaTeX2e package
amsbsy.sty 1999/11/29 v1.2d
amsgen.sty 1999/11/30 v2.0
amsmath.sty 2000/07/18 v2.13 AMS math features
amstext.sty 2000/06/29 v2.01
amsopn.sty 1999/12/14 v2.01 operator names
amsfonts.sty 2009/06/22 v3.00 Basic AMSFonts support
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live
pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX
psfrag.sty 1998/04/11 v3.04 PSfrag (MCG)
natbib.sty 2009/11/07 8.31a (PWD, AO)
hyperref.sty 2010/02/08 v6.80e Hypertext links for LaTeX
kvsetkeys.sty 2010/01/28 v1.8 Key value parser (HO)
infwarerr.sty 2007/09/09 v1.2 Providing info/warning/message (HO)
etexcmds.sty 2010/01/28 v1.3 Prefix for e-TeX command names (HO)
pdfescape.sty 2007/11/11 v1.8 Provides hex, PDF name and string conversions
(HO)
pdftexcmds.sty 2009/12/12 v0.7 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2009/04/17 v1.2 Provides the ifluatex switch (HO)
ltxcmds.sty 2010/01/28 v1.2 LaTeX kernel commands for general use (HO)
ifpdf.sty 2010/01/28 v2.1 Provides the ifpdf switch (HO)
ifvtex.sty 2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO)
ifxetex.sty 2009/01/23 v0.5 Provides ifxetex conditional
hycolor.sty 2009/12/12 v1.6 Color options of hyperref/bookmark (HO)
xcolor-patch.sty 2009/12/12 xcolor patch
letltxmacro.sty 2008/06/24 v1.3 Let assignment for LaTeX macros (HO)
pd1enc.def 2010/02/08 v6.80e Hyperref: PDFDocEncoding definition (HO)
intcalc.sty 2007/09/27 v1.1 Expandable integer calculations (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty 2009/12/08 v3.6 Keyval support for LaTeX options (HO)
url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc.
bitset.sty 2007/09/28 v1.0 Data type bit set (HO)
bigintcalc.sty 2007/11/11 v1.1 Expandable big integer calculations (HO)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If you are using outdated packages, update them. If that was not the problem, please attach to your next post the complete .log file obtained after compilation of your document when the error was produced.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
niklz
Posts: 9
Joined: Sun Jan 24, 2010 9:51 pm

Re: Circuitikz and AMSmath

Post by niklz »

Hi, thanks for reply.

Here's my logfile. I updated my packages when trying to get circuitikz to work. So i dont think it will be that.


Thanks

niklz
Attachments
circuitikz.log
(37.58 KiB) Downloaded 336 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Circuitikz and AMSmath

Post by localghost »

The cause might be that you gave the source file the name of the package. Never name sources like this.


Best regards
Thorsten
niklz
Posts: 9
Joined: Sun Jan 24, 2010 9:51 pm

Re: Circuitikz and AMSmath

Post by niklz »

Changing the name did not resolve the issue. :(
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Circuitikz and AMSmath

Post by localghost »

As gmedina already assumed, you have to update the circuitikz package. Generally you should keep your LaTeX system up to date.
niklz
Posts: 9
Joined: Sun Jan 24, 2010 9:51 pm

Re: Circuitikz and AMSmath

Post by niklz »

Thanks so much, I did the foolish mistake of assuming the owners website would be up-to-date.

Sorry

niklz
Post Reply