I'm trying to put several graphs for several cohorts into cohort-specific html files using dyndoc. The problem I encounter is that while Stata handels the local variables inside the loop correctly, those are expressed literally in the html output instead of with the values that the locals take. I have made a toy-code for the auto data that reflects what I'm doing (much shorter, same issue in output though).
Code:
forval x = 3/5 { dyndoc ../../test.txt `x', saving(../Output/test_r`x'.html) nomsg replace }
Inside test.txt I'm (among other things) generating various graphs. (Those have "fixed" names.) I then want to display these in the file I'm generating with dyndoc.
The code in test.txt is given (in a short version by):
Code:
<<dd_version: 1>> A Test ===== <<dd_do: nocom noout>> sysuse auto, clear keep if rep == `1' scatter mpg weight, mcolor(blue%50) name(scatter9, replace) <</dd_do>> This is a scatterplot. <<dd_graph: gr(scatter9) saving(../Output/scatter`1'_9.svg) replace>>
0 Response to Local variables in dyndoc not expressed correctly in HTML code
Post a Comment