Thank to the people asking and answering this question for how to import a part of a file into Latex. I want to extend this question a bit more.
What if you have such a file resulted from a C++ simulation:
parmeters.tex
time=5 sec
max_velocity=3 m/s
tolerance=$10^{-6}$
start_time=349872034 sec
stop_time=349872039 sec
distance=11 m
In my latex, I would like to type
The trajectory travels the distance of \paraminput[distance]{parameters.tex} in
\paraminput[time]{parameters.tex}. The simulation stops when the relative error is
less than \paraminput[tolerance]{parameters.tex}. The maximum observed velocity
is \paraminput[max_velocity]{parameters.tex}. ...
And the result
The trajectory travels the distance of 11 m in
5 sec. The simulation stops when the relative error is
less than $10^{-6}$. The maximum observed velocity
is 3 m/s. ...
So I do not need to change the report everytime I run the simulation.
How is it possible in Latex?
R
andSweave
? And: Would it be possible to get the C++ program output with quotation marks, i.e.time="5 sec"
?\SI{...}
withsiunitx
package generated by theC++
code to get better display of numbers and units in the.pdf
output