I'm trying to call a program from within LaTeX via the \input
command. The call itself works just fine however I want to pack everything inside an environment in order to make the call more readable.
The problem is that I need to be able to still give some arguments every time. I know that I could do it with a macro with multiple arguments, but it seemed to be cleaner to use an environment for this.
\begin{regression}{pathToFile}
-param1=x
-param2=y
\end{regression}
My goal is to expand the above code to
\input{|"java -jar pathToProgram -path=pathtoFile-param1=x -param2=y"}
My current approach is this one here:
\newenvironment{regression}[1]{\input{|"java -jar pathToProgram -path='#1'}{"}}
So the idea was that I'd open the \input
command at the beginning of the environment and close it at it's ending.
However the problem is that Latex interprets the whole thing as one big argument for the \newenvironment
command as if there was no after
-definition.
How can I get LaTeX to just copy the curly braces in the argument for the \newenvironment
command and only treat them as group-delimiters once the environment has been expanded?
\regression{pathtofile}{-param1=a -param2=b}
{\input{|"java -jar pathToProgram -path='#1'}{"}}
and the end code is missing in the fragment shown.