Aloha Alan, Alan Schmitt <alan.schm...@polytechnique.org> writes:
> Unfortunately, if I export this, the code is duplicated. Here is the > generated html, for instance: Yes, the code is partially duplicated when I run it. It looks to me as if the problem stems from :results raw and the fact that results is itself a source code block that includes lines like #+BEGIN_SRC and #+END_SRC. Perhaps the same confusion shows if you change the :results raw header argument for the call line to :results org, evaluate, change back to :results raw, and then evaluate again. You should find an extra #+END_SRC in the buffer. IIUC, your goal is to export the coq source code blocks. Does the following, which uses :results org, do what you want? It seems to work for me. #+name: fetchcoq2 #+BEGIN_SRC sh :exports none :results raw :var f="demo.v" echo "#+BEGIN_SRC coq" echo $f echo "#+END_SRC" #+END_SRC #+results: fetchcoq2 #+BEGIN_SRC coq demo.v #+END_SRC #+name: fetchcoq-call #+call: fetchcoq2("demo.v") :results org #+results: fetchcoq-call #+BEGIN_SRC org ,#+BEGIN_SRC coq demo.v ,#+END_SRC #+END_SRC hth, Tom P.S. I remembered :wrap just now. This doesn't export well, though. #+call: fetchcoq2("demo.v") :wrap src coq #+results: #+BEGIN_src coq demo.v #+END_src Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com