{"comment":{"created_at":"2011-10-17T06:38:01Z","body":"most of above features have been finished; the rest of work is to write some default hooks, then long live the `knit` engine!","updated_at":"2011-10-17T06:38:01Z","url":"https://api.github.com/repos/yihui/activities/issues/comments/2425486","id":2425486,"user":{"gravatar_id":"fd6964ed425d626628bd057abbe6a85b","avatar_url":"https://secure.gravatar.com/avatar/fd6964ed425d626628bd057abbe6a85b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/yihui","id":163582,"login":"yihui"}},"action":"created","issue":{"number":17,"created_at":"2011-10-11T19:15:08Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"It is simply horrible, if not impossible, to extend the standard Sweave function in base R, because it is poorly modularized in design and hard-coded in many places. Existing packages:\r\n\r\n- `brew` is fairly light-weighted, and I like its simple style as well as its PHP-like nature (use `<% %>` instead of `<<>>= @` and the awkward `\\Sexpr{}`)\r\n- `pgfSweave` features beauty, which is extremely important to me; `tikzDevice` is an awesome package\r\n- `cacheSweave` features cache, of course, and it is important to large-scale computation\r\n- `decumar` is great in design; we no longer need to \"ruin\" the LaTeX document by weird illegal home-made nonsense pseudo-LaTeX code, since it puts literate programming code in LaTeX comments\r\n\r\nWhat is my ideal Sweave package?\r\n\r\n- we should be able to specify the pattern of R code to execute by ourselves; why? because literate programming with R should not be restricted to a particular type of output like LaTeX, HTML, or any other files; I want to borrow the design of `decumar` to put Sweave-related stuff in comments, but each language has its own definition of comments (may begin with `%` or `<!--`, ...); for example, `<!-- first-chunk, source=abc.R, noecho, figure, width=5, height=4 -->` is used in an HTML page to refer to a code chunk in an R script `abc.R` which looks like `## <label>:first-chunk`\r\n- beside putting R code in the main file (probably as comments), we can also put R code in an R script and use a label to reference a code chunk in the main file, which brings us huge convenience that we can run the R code whenever we want (imagine how difficult it is to run R code in LyX/Sweave without compiling the whole document!!), and this makes `Stangle` a useless invention (code is separated with the main file, so no need to export code again)\r\n- issues that may be difficult\r\n  - parse options, especially for plots\r\n  - recursive weaving, e.g. parse files under `\\input{}`\r\n- misc issues\r\n  - output should not be mangled with the leading prompts like `>` and `+` by default; that is _too bad_ for other people trying to copy and run your code\r\n  - should be able to freely specify the styles to be applied to the input code and output (instead of hard-coded `Schunk`, `Sinput`, ...); this can be convenient for HTML output since it gives us the flexibility to use CSS\r\n  - should not expect the users to `print()` grid-based graphics; make it natural that they just feel like they typed the commands in R (`qplot()` alone should produce the plot; why expect me to `print(qplot())` in Sweave?); I believe this is one of the ideas in `evaluate`\r\n  - how about a package name `knit`?\r\n\r\nFinally, I need time and I wish other Sweave users may find the above ideas useful and like to contribute.","comments":1,"title":"ideas on Sweave","updated_at":"2011-10-17T06:38:01Z","url":"https://api.github.com/repos/yihui/activities/issues/17","id":1879891,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"fd6964ed425d626628bd057abbe6a85b","avatar_url":"https://secure.gravatar.com/avatar/fd6964ed425d626628bd057abbe6a85b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/yihui","id":163582,"login":"yihui"},"html_url":"https://github.com/yihui/activities/issues/17","labels":[{"name":"ideas","url":"https://api.github.com/repos/yihui/activities/labels/ideas","color":"d7e102"}],"state":"open"},"legacy":{"issue_id":1879891,"comment_id":2425486}}