Displaying 15 results from an estimated 15 matches for "knit_hooks".
2013 Jan 28
1
Setting inline hook to a function identical to default in knitr turns of exponential formatting
Hello List,
while dealing with a questin of 'xiaodao' (
http://r.789695.n4.nabble.com/Problem-with-large-small-numbers-in-knitr-tp4653986.html)
I noticed that copying the default inline hook function obtained by
knit_hooks$get("inline")
into a knit_hook$set(inline = <...>) call turns off exponential
fomatting in the resulting .tex file.
I used a stripped version of 'xiaodao's example:
\documentclass{article}
\begin{document}
<<>>=
a<-1e-13
b<-2.5e-10
ssrr<-123456.12
ssru...
2013 Jan 10
1
help with knit_hooks
Dear R-listers,
does anybody can suggest some manual where I can learn more about how the
hooks in knitr work?
I am trying to enclose the output of an R command in the Latex verbatim
environment.
I defined a hook as follows:
knit_hooks$set(fsverb = function(x, options) {
paste("\\begin(verbatim)\n", x, "\\end(verbatim)\n", sep = "")
}
then I set a chunk as follows:
<<expl-emp, echo = TRUE, results = 'asis', fsverb = TRUE>>=
names(data)
@
but when I compile, I get a message of...
2015 Sep 12
3
rgl/webGL complains about Javascript, even in recent online docs?
...ifferent, and the initialization was silently skipped.
I'll soon be committing changes to R-forge to fix this, and eventually
it will end up on CRAN. At the moment it looks like I need to add this
function:
setupKnitr <- function() {
if (requireNamespace("knitr")) {
knitr::knit_hooks$set(webgl = hook_webgl)
knitr::knit_hooks$set(rgl = hook_rgl)
environment(hook_webgl)$commonParts <- TRUE
environment(hook_webgl)$reuse <- TRUE
}
}
and that should be called (just once) near the start of the vignette.
Duncan Murdoch
2017 Sep 06
4
post_processor in rmarkdown not working
...text[(end_first_page + 1):length(text)]
)
writeLines(enc2utf8(text), output_file, useBytes = TRUE)
}
output_file
}
output_format(
knitr = knitr_options(
opts_knit = list(
width = 60,
concordance = TRUE
),
opts_chunk = opts_chunk,
knit_hooks = knit_hooks
),
pandoc = pandoc_options(
to = "latex",
latex_engine = "xelatex",
args = args,
keep_tex = keep_tex
),
post_processor = post_processor,
clean_supporting = !keep_tex
)
ir. Thierry Onkelinx
Instituut voor natuur- en bo...
2015 Sep 12
1
rgl/webGL complains about Javascript, even in recent online docs?
...t; I'll soon be committing changes to R-forge to fix this, and eventually
>> it will end up on CRAN. At the moment it looks like I need to add this
>> function:
>>
>> setupKnitr <- function() {
>> if (requireNamespace("knitr")) {
>> knitr::knit_hooks$set(webgl = hook_webgl)
>> knitr::knit_hooks$set(rgl = hook_rgl)
>> environment(hook_webgl)$commonParts <- TRUE
>> environment(hook_webgl)$reuse <- TRUE
>> }
>> }
>>
>> and that should be called (just once) near the start of the vignette...
2017 Sep 07
0
post_processor in rmarkdown not working
...eLines(enc2utf8(text), output_file, useBytes = TRUE)
> }
> output_file
> }
>
> output_format(
> knitr = knitr_options(
> opts_knit = list(
> width = 60,
> concordance = TRUE
> ),
> opts_chunk = opts_chunk,
> knit_hooks = knit_hooks
> ),
> pandoc = pandoc_options(
> to = "latex",
> latex_engine = "xelatex",
> args = args,
> keep_tex = keep_tex
> ),
> post_processor = post_processor,
> clean_supporting = !keep_tex
> )
&g...
2017 Sep 07
0
post_processor in rmarkdown not working
...tf8(text), output_file, useBytes = TRUE)
> }
> output_file
> }
>
> output_format(
> knitr = knitr_options(
> opts_knit = list(
> width = 60,
> concordance = TRUE
> ),
> opts_chunk = opts_chunk,
> knit_hooks = knit_hooks
> ),
> pandoc = pandoc_options(
> to = "latex",
> latex_engine = "xelatex",
> args = args,
> keep_tex = keep_tex
> ),
> post_processor = post_processor,
> clean_supporting = !keep_tex
&g...
2017 Sep 07
3
post_processor in rmarkdown not working
...t; }
>> output_file
>> }
>>
>> output_format(
>> knitr = knitr_options(
>> opts_knit = list(
>> width = 60,
>> concordance = TRUE
>> ),
>> opts_chunk = opts_chunk,
>> knit_hooks = knit_hooks
>> ),
>> pandoc = pandoc_options(
>> to = "latex",
>> latex_engine = "xelatex",
>> args = args,
>> keep_tex = keep_tex
>> ),
>> post_processor = post_processor,
>>...
2013 Jun 19
2
knitr without R studio
...on2>
</p>
```{r table1, comment=NA, results='asis'}
library(xtable)
data(iris)
print(xtable(head(iris, 10)), type = "html", include.rownames = T)
```
```{r, include=FALSE}
opts_knit$set(progress = TRUE, verbose = TRUE)
opts_chunk$set(fig.width=20, fig.height=12)
knit_hooks$set(fig.bg = function(before, options, envir) {
if (before) par(bg = options$fig.bg)
})
```
```{r graphs,fig.keep=?last?}
for (x in 1:10) plot(rnorm(100), col = x)
```
```{r graph1}
plot(rnorm(500), type="lines", main="Graph1")
```
Top of the Page <#top>...
2015 Sep 12
0
rgl/webGL complains about Javascript, even in recent online docs?
...ilently skipped.
>
> I'll soon be committing changes to R-forge to fix this, and eventually
> it will end up on CRAN. At the moment it looks like I need to add this
> function:
>
> setupKnitr <- function() {
> if (requireNamespace("knitr")) {
> knitr::knit_hooks$set(webgl = hook_webgl)
> knitr::knit_hooks$set(rgl = hook_rgl)
> environment(hook_webgl)$commonParts <- TRUE
> environment(hook_webgl)$reuse <- TRUE
> }
> }
>
> and that should be called (just once) near the start of the vignette.
>
> Duncan Murdoch
&...
2017 Sep 07
0
post_processor in rmarkdown not working
...? ?}
>
> ? ?output_format(
> ? ? ?knitr = knitr_options(
> ? ? ? ?opts_knit = list(
> ? ? ? ? ?width = 60,
> ? ? ? ? ?concordance = TRUE
> ? ? ? ?),
> ? ? ? ?opts_chunk = opts_chunk,
> ? ? ? ?knit_hooks = knit_hooks
> ? ? ?),
> ? ? ?pandoc = pandoc_options(
> ? ? ? ?to = "latex",
> ? ? ? ?latex_engine = "xelatex",
> ? ? ? ?args = args,
> ? ? ? ?keep_tex = keep_tex
> ? ? ?),
> ? ? ?po...
2017 Sep 07
2
post_processor in rmarkdown not working
...?output_format(
>> ? ? ?knitr = knitr_options(
>> ? ? ? ?opts_knit = list(
>> ? ? ? ? ?width = 60,
>> ? ? ? ? ?concordance = TRUE
>> ? ? ? ?),
>> ? ? ? ?opts_chunk = opts_chunk,
>> ? ? ? ?knit_hooks = knit_hooks
>> ? ? ?),
>> ? ? ?pandoc = pandoc_options(
>> ? ? ? ?to = "latex",
>> ? ? ? ?latex_engine = "xelatex",
>> ? ? ? ?args = args,
>> ? ? ? ?keep_tex = keep_tex
>>...
2012 Dec 26
2
Problem with large/small numbers in knitr
I have problems with very large numbers using knitr. In the following, my a
and b are extremely small and ssrr and ssru are extremely large. Knitr
delivers error messages. Scaling ssrr and ssru by 1000 resolved the problem:
ssrr <-ssrr/1000 ; ssru<-ssru/1000
Any clue as to how I might resolve the problem?
BTW, the same program does run in another computer. I am wondering whether
my
2015 Sep 12
2
rgl/webGL complains about Javascript, even in recent online docs?
Hello,
The recently created online "rgl Overview" at
https://cran.r-project.org/web/packages/rgl/vignettes/rgl.html
illustrates a problem that I am trying to resolve.
At the bottom of each image block on that page appears the
advisory: You must enable Javascript to view this page properly.
I am using Safari under MacOS with Javascript and WebGL
both enabled, so it must be the
2017 Sep 08
0
post_processor in rmarkdown not working
...knitr = knitr_options(
>>> opts_knit = list(
>>> width = 60,
>>> concordance = TRUE
>>> ),
>>> opts_chunk = opts_chunk,
>>> knit_hooks = knit_hooks
>>> ),
>>> pandoc = pandoc_options(
>>> to = "latex",
>>> latex_engine = "xelatex",
>>> args = args,
>>> keep_tex...