1

I am new here. Before I decided to ask this question I spent a few hours looking for an answer on my own.

I'm trying to include the "tikz-lad­der" ( https://ctan.org/pkg/tikz-ladder ) library to my document using:

 \usepackage{tikz}
 \usetikzlibrary{circuits}
 \usetikzlibrary{circuits.plc.ladder}

Tex says that it can't find the library. I'm trying to install it through TexLive but I can't the "tikz-ladder" package.

I'm using TeXStudio under Fedora 27. By "TexLive" I mean typing "dnf install texlive-" into terminal. I've already installed "texlive-full" and "texlive-tikz*" through "my TexLive".

Thanks in advance.

2

1 Answer 1

1

Download pgfmanual-en-macros.tex from CTAN and put it in your working directory.

Go to tikz-ladder on CTAN and the file tikzlibrarycircuits.plc.ladder.code is at tex folder of tikz-ladder. Copy it and put it in your working directory. In my case, this was the solution:

Use the following before your code. These need not be in preamble.

\input{pgfmanual-en-macros}    
\input{tikzlibrarycircuits.plc.ladder.code}

Sample Codes

\input{pgfmanual-en-macros}
\input {tikzlibrarycircuits.plc.ladder.code}

\begin{tikzpicture}[circuit plc ladder,thick,ladderrungsep=0.8]
\draw(0,0) 
    to [contact NO={info={$A$},name=ca}] ++(3,0)
    to [coil={info={$Q$}}] ++(3,0) coordinate(laddertopright);
ill[red!20] (laddertopright |- ca.south) rectangle +(-2,-1em);
  \draw(0,-1) 
    to [contact NO={info={$B$},name=cb}] ++(3,0) -- +(0,1);
  ill[red!20] (laddertopright |- cb.south) 
       rectangle +(-2,-1em) coordinate (pb);
  ill[blue!20] (pb) rectangle ++(2,-0.8);
\ladderrungend{2}
  \draw(0,0) 
    to [contact NO={info={$C$},name=cc}] ++(3,0)
    to [coil={info={$R$}}] ++(3,0);
  ill[red!20] (laddertopright |- cc.south) 
       rectangle +(-2,-1em) coordinate (pc);
  ill[blue!20] (pc) rectangle ++(2,-0.8);
\ladderrungend{1}
  \draw(0,0) 
    to [contact NO={info={$D$}}] ++(3,0)
    to [coil={info={$S$}}] ++(3,0);
\ladderrungend{1}
\ladderpowerrails
\end{tikzpicture}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .