Home Comments Thread
New Thread

8 Comments

giscus-bot giscus-bot 2022-12-16 22:26:34
Guest *Rivo* @ 2012-06-11 09:06:37 originally posted:

Hi Yihui,

Nice job, man.

Just one remark, what is the purpose of the  lyxframeend and lyxframe commands??

yihui yihui 2022-12-16 22:26:41

I made the slides by LyX. You can ignore these commands, and use the frame environment in beamer as usual.

Originally posted on 2012-06-11 13:26:18

giscus-bot giscus-bot 2022-12-16 22:26:35
Guest *Rivo* @ 2012-06-11 10:20:25 originally posted:

The knitr source file for including linguistic notation as graphical elements in ggplot2 is buggy now.

I have an error going like this:
Error in process_file(text) :
Quitting from lines 52-55: Error in getMetricsFromLatex(TeXMetrics) :
TeX was unable to calculate metrics for the following string
or character:

"hwy"

yihui yihui 2022-12-16 22:26:42

If you mean this https://gist.github.com/2387823#file_ling_plot.rnw it works for me under Ubuntu 12.04, R 2.15.0 and tikzDevice 0.6.2. Otherwise you have to provide a reproducible example and your sessionInfo().

Originally posted on 2012-06-11 13:43:57

giscus-bot giscus-bot 2022-12-16 22:26:42
Guest *Rivo* @ 2012-06-11 21:56:56 originally posted:

 Yeah, I mean this file. My compile workflow chokes on the hwy part.

Purling and source-ing gave no error.

OS: 64-bit Windows 7
LaTeX distrib: MiKTeX

sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252
[2] LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C
[5] LC_TIME=French_France.1252

attached base packages:
[1] stats graphics
[3] grDevices utils
[5] datasets methods
[7] base

loaded via a namespace (and not attached):
[1] tools_2.15.0

giscus-bot giscus-bot 2022-12-16 22:26:43
Guest *Rivo* @ 2012-06-11 23:26:11 originally posted:

 Ok, sorted out.  I commented out everything and added each chunk back one at a time.

Possible explanation: my MiKTeX is setup to install packages on the fly. The culprit was the missing LaTeX package pict2e that was to be installed. But somehow this package was not explicitly mentioned in the Rnw file.

So I don't know if it was knitr that requested it (in which case, MiKTeX was fooled and didn't know about this request) or if this package was requested in the .tex intermediate file (but then I din't find any mention of it upon inspection).

giscus-bot giscus-bot 2022-12-16 22:26:35
Guest *Lighton Phiri* @ 2012-08-26 13:39:26 originally posted:

Thank you for the blog post.  I just started playing around with Beamer, Sweave& Knitr and currently struggling to figure out how to make the font types on R graphs match the font of Beamer slide.

Incidentally, I've been struggling to install tikzDevice... came across this [1], but the link to tikzDevice package redirects me to a page that seems to suggest that the package has been removed from CRAN --is there an alternative to this?

Package ‘tikzDevice’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
This package has been archived: the maintainer felt unable to provide an update fixing WARNINGs within reasonable amount of time.

[1] http://stackoverflow.com/questions/11307446/r-mathematical-annotations

yihui yihui 2022-12-16 22:26:44

See my reply at http://comments.gmane.org/gmane.comp.lang.r.general/272820

Originally posted on 2012-08-26 21:53:57

giscus-bot giscus-bot 2022-12-16 22:26:45
Guest *Lighton Phiri* @ 2012-08-27 00:23:08 originally posted:

Thank you, I finally managed to install tikzDevice. Could you kindly point me to resources/tutorials that will help me play around with fonts so they match with the one used in a particular Beamer presentation? I have not been able to find anything solid... merely mailing list archive messages suggesting tikzDevice. Does knitr by any chance handle these sort of things natively?

yihui yihui 2022-12-16 22:26:46

See the third example above in this page, which will point you to https://github.com/yihui/knitr-examples/blob/master/018-fullfig-tikz.Rnw eventually.

Originally posted on 2012-08-27 03:36:12

giscus-bot giscus-bot 2022-12-16 22:26:47
Guest *Lighton Phiri* @ 2012-08-27 14:38:17 originally posted:

Perfect, thank you very much... worked as expected.

giscus-bot giscus-bot 2022-12-16 22:26:36
Guest *Daniel Weeks* @ 2012-10-28 15:57:11 originally posted:

When I tried to typeset the example knitr-beamer.lyx using LyX version 2.0.4 on a Mac OS X 10.5 machine after adjusting the language preferences as you recommended elsewhere, I had to add

RequirePackage[english]{babel}

to the LaTeX preamble to get it to work.  Without that line, latex failed with error messages like:

! Package babel Error: You haven't loaded the option english yet.

Thank you for creating the knitr package - I am finding it very useful and easy to use.

yihui yihui 2022-12-16 22:26:48

I have never seen such an error before. Thanks for reporting. Usually I just suppress babel in LyX like I did in this page: http://yihui.name/knitr/demo/lyx/

Originally posted on 2012-10-28 18:29:53

giscus-bot giscus-bot 2022-12-16 22:26:37
Guest *Alex B.* @ 2013-01-14 18:10:14 originally posted:

Is there a way to get knitr output to span multiple frames/slides in beamer? I am using the lavaan package an want to show the output, but it will not go onto multiple slides, even if I include the allowframebreaks option, e.g.,

begin{frame}[fragile, allowframebreaks]
frametitle{Title}
framesubtitle{Subtitle}
<<>>=
example.data<-data.frame(v1=rnorm(100), v2=rnorm(100), v3=rnorm(100))
library(lavaan)
example.model<-'
v1~v2 + v3
v2~ v1
'
example.fit<-sem(example.model, data=example.data)
summary(example.fit, standardized=TRUE, rsquare=TRUE)
@
end{frame}

If I don not include the chunk in a frame, it will print over multiple slides, but this messes makes the slide number be off.

Thanks for any help you can offer.

yihui yihui 2022-12-16 22:26:49

Hi, this is due to the framed package in LaTeX used by knitr by default. At the moment I do not have a good solution, and you can try other styles such as listings. To do that, you can call render_listings() in the first chunk with include=FALSE; or render_sweave().

Originally posted on 2013-01-15 03:33:24

giscus-bot giscus-bot 2022-12-16 22:26:38
访客 *ypchen* @ 2013-04-09 09:10:16 写道:

有没有Rmd→beamer的例子? 中文的

@yanping

yihui yihui 2022-12-16 22:26:50

Rmd经由pandoc到beamer太麻烦了,不如直接做HTML5幻灯片。私信。

——原帖发布于 2013-04-13 03:36:42

giscus-bot giscus-bot 2022-12-16 22:26:39
Guest *Pietà Schofield* @ 2014-10-03 00:27:44 originally posted:

hullo, I am trying to use beamerposter.sty and I am not having any success with the opts_chunk$set( size = 'footnotesize' ) approach to achieve a smaller font size for code chunks.

giscus-bot giscus-bot 2022-12-16 22:26:51
Guest *Pietà Schofield* @ 2014-10-03 01:08:21 originally posted:

i seem to have a way of doing it by redefining the alltt environment

makeatletter
letoldallttalltt
defalltt{@ifnextchar[alltt@i alltt@ii}
defalltt@i[#1]{oldalltt[#1]footnotesize}
defalltt@ii{oldallttfootnotesize}
makeatother

but i wonder if there is a nicer one. I borrowed this idea from someone redefining the figure environments so I am not sure the extra lines the allow for arguments are necessary for the alltt environment

giscus-bot giscus-bot 2022-12-16 22:26:40
Guest *gigi Bi* @ 2017-10-28 12:40:36 originally posted:

These examples unfortunately do not work anymore in 2017: is there any new updated version? Thanks

yihui yihui 2022-12-16 22:26:52

In 2017 I'd recommend using R Markdown instead: http://rmarkdown.rstudio.com/beamer_presentation_format.html

Originally posted on 2017-10-28 15:43:21

Sign in to join the discussion

Sign in with GitHub