LaTeXing / LaTeXing

LaTeXing - Professional Typesetting - An extension for Sublime Text which makes your life easier and more comfortable while creating your documents.
79 stars 12 forks source link

Double quotes in knitr code chunk #39

Open ghost opened 10 years ago

ghost commented 10 years ago

Related:

Session info:

Say I want to set the highlighting theme in a .Rnw document; I may do so like this:

<<highlighting, cache = FALSE, echo = FALSE>>=
theme <- knit_theme$get("fruit")
knit_theme$set(theme)
@

However, for me at least, in Latexing (Knitr), double quotes are automatically matched and converted into ``", which causes a parsing error upon building with the default build. Getting a simple pair of double quotes then becomes a hassle.


1 I cannot access the issue without first creating an account on Bitbucket :-1:

csch0 commented 10 years ago

Ok will be removed asap.

Thats why I changed to issue system to github rather than using the bitbucket one.

ghost commented 10 years ago

Jolly good. Thanks.

ghost commented 10 years ago

Also: outside of parentheses (cf. issue #11), single quotes are automatically matched as `'; this too causes parsing problems upon build.

For example, in setting a chunk option, e.g., background below:

<<foo, fig.height = 4, background = '#F7F9FD'>>=
i <- rnorm(n = 100, mean = 44, sd = 11)
j <- rnorm(n = 100, mean = 55, sd = 18)
plot(i, j)
@

character values must be quoted; so the way single quotes outside of parentheses are matched by LaTeXing results in background = #F7F9FD'</code>, instead ofbackground = '#F7F9FD', i.e., <code>' instead of ''.

ghost commented 10 years ago

The problem with double-quote matching was solved upon enabling SublimeKnitr. The problem with single quote matching between <<>>= and in the actual code chunk remains.

csch0 commented 10 years ago

So to address this I guess we have to adjust SublimeKnitr and sent a pull request.