Skip to content
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

render to pdf not including images (plots) on output #86

Closed
leonsas opened this issue Apr 28, 2014 · 7 comments
Closed

render to pdf not including images (plots) on output #86

leonsas opened this issue Apr 28, 2014 · 7 comments

Comments

@leonsas
Copy link

leonsas commented Apr 28, 2014

So when trying to render an Rmd to pdf, the output goes through without inserting the figured in the pdf. When knitting to HTML, the plots do get included.

See this gist: https://gist.github.com/leonsas/308ec0bfaaaaa2701017 for all the output files. I couldn't figure out what it is, but I suspect its something with the paths to the generated figures.

@jjallaire
Copy link
Member

I tracked this problem to the use of the fig.align chunk option (if you remove it then the plots appear in pdf output). @yihui I noted that this is documented to be the behavior of knitr:

fig.align: ('default'; character) alignment of figures in the output document (possible values are left, right and center; default is not to make any alignment adjustments); note that for Markdown output, forcing figure alignments will lead to the HTML tag instead of the original Markdown syntax , because Markdown does not have native support for figure alignments (see #611)

For situations where Rmd is not targeting HTML could knitr just ignore fig.align?

@leonsas
Copy link
Author

leonsas commented Apr 28, 2014

Yea, fig.align was the problem. I do think that knitr should ignore fig.align in such situations, since often times the Rmd is meant to be used both for pdf and HTML.

@jjallaire
Copy link
Member

I'm saying ignore fig.align for PDF only (as opposed to omitting the images
entirely).

On Mon, Apr 28, 2014 at 3:06 PM, Leon Sasson [email protected]:

Yea, fig.align was the problem. I do think that knitr should ignore
fig.align in such situations, since often times the Rmd is meant to be used
both for pdf and HTML.

Reply to this email directly or view it on GitHubhttps://github.com//issues/86#issuecomment-41599781
.

@yihui
Copy link
Member

yihui commented Apr 29, 2014

I think I have a better idea to solve this problem (i.e. use raw_tex for plots when the pandoc output is pdf). I'll experiment with it and let you know.

@jjallaire
Copy link
Member

@yihui Closing this issue here (assuming that you are tracking the possible raw_tex enhancement in the knitr issues database)

@yihui
Copy link
Member

yihui commented Nov 9, 2014

FYI: This has been fixed in the development version of knitr, which I plan to release to CRAN in the next few days.

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants