rlkamalapurkar / bodeplot

LaTeX package to plot Bode diagrams
LaTeX Project Public License v1.3c
6 stars 1 forks source link

Errors compiling #1

Closed AndreaDiPietro92 closed 3 years ago

AndreaDiPietro92 commented 3 years ago

Trying to compile some examples of QuickReferance.tex i get some errors:

% !TeX TS-program = lualatex
\documentclass{report}
\usepackage[]{bodeplot,pgfplots, pgf}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{center}
\BodeTF[plot/mag/{blue,thick},plot/ph/{green,thick}]{num/{10,2,2.6,0},den/{1,0.2,100},d/0.01}{0.01}{1}
\end{center}
\end{document}

ERRORS: I can't write on file 'gnuplot/1.gnuplot'. ...10,2,2.6,0},den/{1,0.2,100},d/0.01}{0.01}{1} Emergency stop. ...10,2,2.6,0},den/{1,0.2,100},d/0.01}{0.01}{1}

It would be really useful to have some examples in the DOCS that can be compiled and the commands for compiling. Thank you

rlkamalapurkar commented 3 years ago

Which operating system are you using? QuickReference.tex compiles fine on all of the Windows machines I have access to.

AndreaDiPietro92 commented 3 years ago

Kubuntu 21.10. A workaround is creating a gnuplot folder (manually). In this way the compiling works correctly.

rlkamalapurkar commented 3 years ago

On linux, you do have to create the directory manually. That is why I added the gnuplot directory to the repository with an empty .placeholder file in it. If you git clone the repository, everything will work. It won't, though when this package is distributed through CTAN.

I will either add that limitation to the documentation or include some code in the package to check which OS is being used and adjust the defaults accordingly.

Thanks for the bug report!

rlkamalapurkar commented 3 years ago

Added

\RequirePackage{ifplatform}
\ifwindows\else
  \immediate\write18{mkdir -p gnuplot}%
\fi

to the source code. Should now work on any on any non-windows operating system that has the mkdir -p command.