I currently have written a script that produces several figures. I was wondering if there is a way to publish these figures directly into a tex file, say in eps format without including all of the python code verbatim. I also want to include the values of some variables. I looked at the module pweave (http://mpastell.com/pweave/) but I couldn't figure out a way to exclude code chunks. I'm new to python so any help would be much appreciated!
Asked
Active
Viewed 110 times
1
-
1What do you mean by a "script that produces several figures" Does the script write eps files to disk? What do you mean by "including the python code". You can't include python code in \TeX, The purpose of pweave is to document code (or rather to write code that is self documenting) So I'm not sure what you mean. There is also a \TeX stack exchange http://tex.stackexchange.com/ – James K Sep 21 '16 at 17:07
-
Thanks for your comment. By "script that produces several figures", I mean I have a python script that has a loop in which some function calls are made and matplotlib plots are generated after every iteration. I want to document these results automatically, including parts of the code that I think are relevant to a documentation. So to put it as you say, I want to write self documenting code. – CSforStructuralEngineer Sep 21 '16 at 17:21
-
Then pweave is a good choice. You can use hidden code chunks http://mpastell.com/pweave/chunks.html#envvar-echo=Trueor(False) – James K Sep 21 '16 at 17:48
2 Answers
1
You can use pweave. If you want a code chunk to be executed but not formatted, set the echo property to false. See http://mpastell.com/pweave/chunks.html#envvar-echo=Trueor(False)

James K
- 3,692
- 1
- 28
- 36
0
Set echo to false before very code chunk, following the documentation: http://mpastell.com/pweave/defaults.html

thedarkgriffen
- 394
- 3
- 16