fsmMLK / inkscapeCircuitSymbols

Inkscape extension to assist creating circuit symbols.
GNU General Public License v3.0
199 stars 28 forks source link

Issue with siunitx (old version?) #27

Closed deganii closed 2 years ago

deganii commented 2 years ago

Thanks for the great work! I tried to run the extension as-is but got exceptions about:

  1. There being no "per" parameter in the siunitx package
  2. There being no "\newunit" command

In order to make the extension work in Inkscape 1.1 (I am using MikTex 21.6-x64 on Windows 7) I had to update the circuitSymbolsPreamble.tex as follows: remove the [per=slash] on line 2, and replace \newunit with \DeclareSIUnit

The updated working file is shown below. I'm not sure whether this is an issue with the siunitx 3.x version or whether there is some other breaking change that is causing this.


\usepackage{amsmath,amsthm,amsbsy,amsfonts,amssymb}
\usepackage{siunitx}
\usepackage{steinmetz}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

\newcommand{\micro}{\ensuremath{\mu}}
\newcommand{\phasorName}[1]{ \ensuremath{ \boldsymbol{\hat #1} } }
\newcommand{\impedance}[1]{ \ensuremath{ \boldsymbol{#1} } }
\newcommand{\complexPol}[2]{\ensuremath{#1\phase{#2}}}
\newcommand{\complexPolDeg}[2]{\ensuremath{#1\phase{#2\degree}}}

% new units
\DeclareSIUnit{\Vef}{\volt_{ef}} % volt eficaz
\DeclareSIUnit{\Vrms}{\volt_{rms}} % volt RMS
\DeclareSIUnit{\Vpp}{\volt_{pp}} % volt peak-to-peak

\DeclareSIUnit{\Aef}{\ampere_{ef}} % ampere eficaz
\DeclareSIUnit{\Arms}{\ampere_{rms}} % ampere rms
\DeclareSIUnit{\App}{\ampere_{pp}} % ampere peak-to-peak

% logic Commands
\newcommand{\NOT}[1]{\ensuremath{\overline{\mbox{\ensuremath{#1}}}}}
\newcommand{\AND}{\ensuremath{\cdot}}
\newcommand{\OR}{\ensuremath{+}}
\newcommand{\XOR}{\ensuremath{\oplus}}
\newcommand{\XNOR}{\ensuremath{\odot}}
Rigoberdo commented 2 years ago

Also other extensions based on basicLatexPackages.tex may run into some trouble. Thanks to @fsmMLK support (https://github.com/fsmMLK/inkscapeMadeEasy/issues/14#issuecomment-878921029) I solved modifying the second row of basicLatexPackages.tex inside inkcapeMadeEasy: from \usepackage[per=slash]{siunitx}
to \usepackage{siunitx}

fsmMLK commented 2 years ago

updated the repository to fix this issue.