I get error messages that don't make sense running code which I've adapted from https://ftp.acc.umu.se/mirror/CTAN/graphics/circuit_macros/doc/Circuit_macros.pdf. I've rewritten the code with the built-in text editor in Ubuntu the "Text Editor" to be sure that I don't have hidden tokens from the copy/paste process and I have no tabs in the file. It worked once, don't know how. Should I re-install TexLive? I've been running other Tikz stuff with no problem.
LaTeX Warning: Writing file `./['.
LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help.
l.4 \begin{filecontents*}[n
oheader,force]{sample.m4}
When I rerun it I get the same missing \begin{document}complaint and it always error indicates the options bracket in \filecontents. If I delete the offending option it complains about the next.
It also gives me a warning:
LaTeX Warning: File `[' already exists on the system. Not generating it from this source.
\documentclass{article}
\usepackage{tikz}
\newcommand\mtotex[2]{\immediate\write18{m4 #2.m4 | dpic -#1 > #2.tex}}
\begin{filecontents*}[noheader,force]{sample1.m4}
include(pgf.m4)
.PS
cct_init
elen = 0.75
Origin: Here
source(up_ elen); llabel(-,v_s,+)
resistor(right_ elen); rlabel(,R,)
dot
{
capacitor(down_ to (Here,Origin))
rlabel(+,v,-);llabel(,C,)
dot
}
line right_ elen*3/3
inductor(down_ Here.y-Origin.y); rlabel(,L,);b_current(i)
line to Origin
.PE
\end{filecontents}
\begin{filecontents}[overwrite,noheader,nosearch]{dummy.m4}
\end{filecontents}
\begin{document}
\mtotex{g}{sample1}
\begin{figure}[ht]
\input{sample}
\caption{customized caption}
\label{Symbolic_label}
\end{figure}
\end{document}```
pdflatex '\stop'? You probably has an older version of LaTeX that doesn't support the optional argument infilecontents– Phelype Oleinik May 16 '22 at 20:45filecontentswere introduced in 2019-10-01, so your version of LaTeX doesn't support them. You need to update (or use thefilecontentspackage and\begin{filecontents*}, to get the same behaviour as[noheader,force]). – Phelype Oleinik May 17 '22 at 10:31context/sample/common/sample.tex. That won't work in LaTeX... – Phelype Oleinik May 19 '22 at 10:27pdflatex --shell-escape testQ.tex– Lasse Karagiannis May 19 '22 at 18:15