I need to set some TikZ options that have been written to a file by a script.
I thought I could use a helper macro defined with \edef
and the expandable version of \input
as described in Why is \input not expandable?, but the compilation of my minimal document fails with
Runaway definition?
->\tikzset { every node/.style={ fill=orange!50,draw=black,thick
! File ended while scanning definition of \auxmacro.
<inserted text>
}
l.12 \@@input inputfile.txt
Here's the test document
\documentclass{article}
\usepackage{tikz}
\usepackage{filecontents}
\begin{filecontents}{inputfile.txt}
fill=orange!50,draw=black,thick
\end{filecontents}
\makeatletter
\edef\auxmacro{\noexpand\tikzset{
every node/.style={
\@@input inputfile.txt
}
}}
\auxmacro
\makeatother
\begin{document}
\begin{tikzpicture}
\node {Testnode};
\end{tikzpicture}
\end{document}
How can I apply TikZ options stored in a file?
\input{setTikZ}
for this. However, the content of mysetTikZ.tex
-file includes thetikzset{}
-stuff already. Wouldn't a small adjustment to your script solve this problem?\tikset
macro.