I read about my task here. But I didn't get working it for my needs. MWE:
\begin{filecontents*}{compensation.tex}
\begin{tikzpicture}[auto]
%placing the nodes
\node[signal] (input) {};
\node[
block,
right = of input
] (controller) {linearer Regler};
\node[
block,
path picture = {
\draw[double distance = 2pt]
(path picture bounding box.south west) rectangle
(path picture bounding box.north east);
},
right = of controller
] (compensation) {$#1$}; %%% first parameter
\node[
block,
right = of compensation
] (system) {$#2$}; %%% second parameter
\node[
signal,
right = of system
] (output) {};
%connecting the nodes
\draw
[->] (input) -- node {$e$} (controller);
\draw
[->] (controller) -- node {$u_*$} (compensation);
\draw
[->] (compensation) -- node {$u$} (system);
\draw
[->] (system) -- node {$x$} (output);
\draw[
decorate,
decoration = {
brace,
amplitude = 5pt
}
] (.98, .5) -- (6.31, .5)
node[
above = 5pt,
midway
] {Rechner};
\draw[
decorate,
decoration = {
brace,
amplitude = 5pt
}
] (10, -.5) -- (4.72, -.5)
node[
below = 5pt,
midway
] {bzgl.\ $u_*$ lineare Strecke};
\end{tikzpicture}
\end{filecontents*}
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{
decorations.pathreplacing,
positioning
}
\tikzset{
signal/.style = coordinate,
block/.style = {
draw,
rectangle,
minimum height = 2em,
minimum width = 4em
}
}
\newcommand*\test[2]{\input{compensation}}
\begin{document}
\test{()^2}{\dot x = \ldots + \sqrt{u}}
\end{document}
naturally yields two errors described in the linked question. I only wish to load a tex file with two (or probably more) parameters. How could it be done?
Also interesting: An additional path to the file. Let say the file is located in the subdirectory figures/2 of the main directory. To access to the file one have usually type \input{figures/2/compensation}.
Thank you for your help and effort in advance!

\newcommandstatement. – Su-47 Feb 21 '20 at 14:07