0

I want to use check valve pic as described on chemplants doc at page 54, but I get an error saying it's not defined. I know it could be an error of the package, but I want to be sure and see if it's defined in another way. It's possible to print all tiks/pics available? or how should I face this problem ?

\documentclass{article}
\usepackage[utf8]{inputenc}

%%%
\usepackage{tikz}
\usepackage{chemplants}
%%%

\begin{document}


\begin{tikzpicture}
    \pic at (0,0) { check valve = main };
\end{tikzpicture}

\end{document}
Package pgfkeys Error: I do not know the key '/tikz/pics/check valve', to which you passed 'main', and I am going to ignore it. Perhaps you misspelled it.

Currently I create my own command, but it's really a crude attempt (I'm new at tikz, so I don't know how to define coordinates for a pic and it doesn't even see proportional when I use the scale option)

\tikzset{
    check-valve/.pic={
        \draw (0,-2mm) -- (0,0);
        \node[minimum size=3pt,draw,circle,fill, inner sep=0pt, outer sep=0pt] at (0,0) {};
        \draw (0,0) -- (4mm,-2mm);
        \draw (4mm,-2mm) -- (4mm,0);
    }
}
4
  • Do you get any other errors (in particular before the error message you quote)? Is chemplants installed? To answer these questions it would already help if you could upload the whole .log file of your LaTeX run to a text-sharing website such as pastebin.com
    – moewe
    Apr 28, 2022 at 5:49
  • To use check valve you need chemplants 2021/09/25 v0.9.9 (see related diff from texlive's svn repo, starting from line 2098). You may have the previous version (2019/11/19 v0.9.8) installed. Overleaf's texlive 2021 also provides v0.9.8, hence no check valve available. May 28, 2022 at 9:16
  • Note the doc you download from CTAN's webpage ctan.org/pkg/<pkg name> is always the latest one, hence may be ahead of your local installation. May 28, 2022 at 9:23
  • I don't know. For the example I used XeLaTeX in TexWorks (MikTeX) and didn't work, I downloaded TeXMaker and it did. May 29, 2022 at 21:32

1 Answer 1

0

Your code works for me in Texmaker (MikTex), with quick build options being PdfLatex or LuaLatex.

\documentclass{article}
\usepackage[utf8]{inputenc}

%%%
\usepackage{tikz}
\usepackage{chemplants}
%%%

\begin{document}
  \begin{tikzpicture}
    \pic at (0,0) { valve = main };    
    \pic at (2 ,0) { check valve = main };
  \end{tikzpicture}
\end{document}

Result

enter image description here

Some guesses why your compile might fail:

  • hidden typo
  • tikz not installed
1
  • I'm using XeLaTeX in TexWorks (MikTeX) and I used also Overleaf to build the example Apr 28, 2022 at 7:01

You must log in to answer this question.

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