# package chemfig does not work with tikzlibrary circuits.pid.ISO14617

Using tikz and have a document with various libraries. In particular \usetikzlibrary{circuits.pid.ISO14617} works fine until I add \usepackage{chemfig} with \chemfig

\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{circuits.pid.ISO14617}
\usepackage{chemfig}
\begin{document}

\section{Process and Instrumentation Diagram}
\tikz [circuit pid ISO14617] \draw (0,0) to [pump={displacement}] (2,0);

\section{chemical}
\chemfig{O-C-O}

\end{document}


Gives error: ./chemfig-test.tex:11: Package PGF Math Error: Unknown function C (in C\tikzcircuitssizeunit of ().

Essentially I would like to use both \chemfig and \tikzlibrary{circuits.pid.ISO14617} which currently do not appear to work together.

EDIT: UPDATE: The tikzpgfmanual section 54 covers externalizing graphics. Using the example provided I was able to concoct the following partial solution.

% This is the file chemfigProb
\documentclass[]{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{circuits.pid.ISO14617}
\usepackage{chemfig}
\pgfrealjobname{chemfigProb}
\begin{document}
\section{Process and Instrumentation Diagram}
\beginpgfgraphicnamed{process-1}
\begin{tikzpicture}
\tikz [circuit pid ISO14617] \draw (0,0) to [pump={displacement}] (2,0);
\end{tikzpicture}
\endpgfgraphicnamed
\section{chemical}
\chemfig{O-C-O}
\end{document}


Step1: commenting out lines: \usepackage{chemfig} \chemfig{O-C-O}
Step2: Run Command Prompt> xelatex --jobname=process-1 chemfigProb.tex
Step3: commenting out line: \usetikzlibrary{circuits.pid.ISO14617} and reintroducing the commented lines in Step1
Step4: Run Command Prompt. xelatex chemfigProb.tex

Returns the bottom half of the process with the pump and a model of carbon dioxide, however, This gives only the bottom half of the symmetry pump process.

https://gitlab.com/peer23peer/PIDcircuitTikZ/issues/14

• Is circuits.pid.ISO14617 an official library? The only reference of it I found here, and this suggest it is not. – marmot Jul 28 '18 at 22:15
• @marmot yes, that is where I found out about this package. Perhaps my lack of knowledge of official libraries as opposed to unofficial libraries. I did not realize that this was perhaps not official. In any case, if it is not official would it be possible to get it to work? If not how can I know what is official and what is not? – CJD Jul 29 '18 at 2:57
• @jelle-spijker Hi Jelle, would you know if this can be rectified. I really like the package you made. – CJD Jul 29 '18 at 2:59
• @CJD nice to hear that you like the package. Yes this is a home-brew unofficial package, still under development. If you could create an issue ( gitlab.com/peer23peer/PIDcircuitTikZ/issues ) I will check/fix if it is a bug in my code. – Jelle Spijker Jul 29 '18 at 9:19
• @JelleSpijker would a possible solution to my dilemma be to use the circuits.pid.ISO14617 package to create a separate document with only the figure and then to embed that into my master document? If so, how might I do this? – CJD Aug 8 '18 at 15:00