Documentation: pat_rnw #226

Closed
dmenne opened this Issue May 9, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@dmenne
Contributor

dmenne commented May 9, 2012

It would be good to have an example how to modifiy a knitr_pattern. The example in pat_rnw is a bit academic.

@yihui

This comment has been minimized.

Show comment Hide comment
@yihui

yihui May 9, 2012

Owner

does ?knit_patterns help? I have examples there.

Owner

yihui commented May 9, 2012

does ?knit_patterns help? I have examples there.

@dmenne

This comment has been minimized.

Show comment Hide comment
@dmenne

dmenne May 10, 2012

Contributor

It helps, but who finds it there? I know, because students asked me and were totally lost in the "side effect" lingo. A link would be good. I still don't know what pat_rnw really is for, and I had suggested the students to use:

## Change \Sexpr to \S
pt = knit_patterns$get()
pt$inline.code= "\\\\S\\{([^}]*)\\}"
knit_patterns$set(pt)
Contributor

dmenne commented May 10, 2012

It helps, but who finds it there? I know, because students asked me and were totally lost in the "side effect" lingo. A link would be good. I still don't know what pat_rnw really is for, and I had suggested the students to use:

## Change \Sexpr to \S
pt = knit_patterns$get()
pt$inline.code= "\\\\S\\{([^}]*)\\}"
knit_patterns$set(pt)
@yihui

This comment has been minimized.

Show comment Hide comment
@yihui

yihui May 11, 2012

Owner

pat_rnw sets all_patterns$rnw as the pattern list; if the documentation is not clear, see https://github.com/yihui/knitr/blob/master/R/pattern.R

Does it save a huge amount of time by redefining \Sexpr{} to \S{}? I do not recommend them to break the default syntax unless they are completely sure that the reports are only used by themselves, otherwise they have the extra burden of instructing other people how to compile the document.

Owner

yihui commented May 11, 2012

pat_rnw sets all_patterns$rnw as the pattern list; if the documentation is not clear, see https://github.com/yihui/knitr/blob/master/R/pattern.R

Does it save a huge amount of time by redefining \Sexpr{} to \S{}? I do not recommend them to break the default syntax unless they are completely sure that the reports are only used by themselves, otherwise they have the extra burden of instructing other people how to compile the document.

@dmenne dmenne closed this May 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment