New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
White space breaks chunk regexes? #236
Comments
this is the default syntax inherited from Sweave, and I guess the main consideration is to make it as unique as possible because it serves as the marker of code chunks you can customize the syntax like this (see http://yihui.name/knitr/patterns): library(knitr)
pat_rnw() # default syntax
knit_patterns$set(chunk.begin = "^\\s*<<(.*)>>=", chunk.end = "^\\s*@\\s*%*")
Is there a special reason that you need to add white spaces before |
Hi Yihui, I have started looking into knitr to find ways to integrate into ESS. So far I am really impresed. Thanks for your work. Be sure that we will have a full blown support for knitr in the next version (September I guess). This issue is crucial for proper indentation of code chunks inside Latex docs when chunks are not at top level. For example you might want to have a chunk inside |
Actually I believe this is a fair request now, because sometimes I also want the code blocks to be indented, especially in markdown. White spaces do not really have any influence on LaTeX output, but they do have a meaning for markdown. So I think I will change the syntax to allow white spaces before I'm thrilled to know knitr is going to ESS. Thanks! |
hi @jamiefolson and @Vitoshka, now leading spaces are allowed in chunk headers, so you are free to indent the chunks; see https://github.com/yihui/knitr/blob/master/NEWS.md#major-changes |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Not sure if this is desired, but if there's any whitespace in front of a chunk, it's not detected, e.g. " <<>>=...@" instead of "<<>>=...2"
The text was updated successfully, but these errors were encountered: