1

I wrote my thesis in the Lyx software using Windows 10. At the end, i get a succesfully compiled PDF. I tried to compile the exact same document in Lyx in Linux but i get the error Package PGF Math Error: Unknown function 'inner' in any graphics that i made by using circuitikz package.

This graphics are electronic circuits that contains a transformer with his dots showing the polarity. circuit

The code that i use for generate the previous circuit is:

%Preamble
\usepackage{emptypage}
\usepackage{graphicx}
\usepackage{matlab-prettifier}
\usepackage{listings}
\usepackage{siunitx}
\raggedbottom
\usepackage[american]{circuitikz}
\usepackage[none]{hyphenat}
\usetikzlibrary{shapes,arrows}

%Flyback
\begin{circuitikz}[scale = 1.5] \draw
    (0,0) node[transformer, yscale=1.5](T) {} 
    (T.A2)  
        to [short] ($(T.A2)+(-1.5,0)$)
        to [V, l=$V_S$, invert] ($(T.A1)+(-1.5,0)$)     
        to [nos, l=S] (T.A1)    
    (T.B1)
        to [D, l=D] ++(2,0) coordinate (Node1)  
        to [short] ++(2,0)
        to [R, l_=R, v^=$V_o$] ($(T.B2)+(4,0)$)
        to [short] (T.B2)
    (Node1)
        to [pC, l_=C, *-*, invert] ($(T.B2)+(2,0)$) 
    %Transformer labels
    (T.inner dot A1) node[circ]{}
    (T.inner dot B2) node[circ]{}
    ($(T.base)+(0,0.3)$) node{$N_1$ : $N_2$}
;
\end{circuitikz}

Lyx says that this error ocurrs in these lines:

    (T.inner dot A1) node[circ]{}
    (T.inner dot B2) node[circ]{}

If i comment these lines that every circuit uses it, the error don't show but the dots for polarity neither. How i can solve it? My code is the same, i just tried to compiled in Linux, no missing packages or similar.

  • 1
    I cannot reproduce the error. Do you work with an up-to-date TeX installation? –  Jan 15 '20 at 05:57
  • One shortcut TikZ takes is that you can specify an explicit anchor by (T.anchor) or a point on the boarder by angle (T.90). It is very likely that it does not find inner dot A1 as an explicit anchor so it tries to parse it as an angle (which is a number). By doing so it throw everything into a pgfmathparse and immediately it finds that inner is not a valid function like sin and exp, hence the error. – Symbol 1 Jan 15 '20 at 06:30
  • 1
    Please add a \pgfcircversion in your text somewhere to see what the version is. inner anchors has been added around 0.9.2 and for example the stock Ubuntu 8.04 distribution has older packages. See also https://tex.stackexchange.com/a/521554/38080 – Rmano Jan 15 '20 at 06:52
  • @Schrödinger'scat, yes i recently installed openSUSE with Lyx. – Rafa1296 Jan 15 '20 at 07:57
  • @Rmano i used the package manager of my distribution and found that both Miktex (Windows 10) and Linux uses the same 0.8.3 version. – Rafa1296 Jan 15 '20 at 07:59
  • 2
    inner dot was not in 0.8.3; it was added in 0.9.0. You can update the package with any release from GitHub or (probably easier) using the method I explained in https://tex.stackexchange.com/a/521554/38080. In the page https://circuitikz.github.io/circuitikz/ there are instructions on how to use any version you want! – Rmano Jan 15 '20 at 08:35
  • I put a Q&A here: https://tex.stackexchange.com/questions/524328/i-need-to-use-a-different-version-of-circuitikz-how-can-i-do-that/524329#524329 – Rmano Jan 15 '20 at 09:15

0 Answers0