I am trying to get a STATA macro or an R variable into Latex. This is relatively straightforward with R markdown, but I'm hoping for a pure TeX solution. e.g. say I have a document that says
Our model predicts [x] number of hamburgers will be consumed by aliens.
and a STATA do file or an R file that says
x <- 10000
or
local x 10000
How do I get latex to be able to update that number each time I get new data? For figures, it's relatively simple, because I can import a code block with the figure, but what about for just numbers?
Apologies if this has been asked already--I've tried searching to no success, probably because I don't know the correct jargon and search terms to use.
Thanks for your help!
alien_hamburgers.txt
, and then read that file into a macro viacatchfile
's\CatchFileDef{\alienhamburgers}{alien_hamburgers.txt}{}
that you can then use in your (La)TeX file:Our model predicts \alienhamburgers{} number of hamburgers will be consumed by aliens.