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

out.height seems not working #501

Closed
sammo3182 opened this issue Dec 24, 2017 · 4 comments
Closed

out.height seems not working #501

sammo3182 opened this issue Dec 24, 2017 · 4 comments
Milestone

Comments

@sammo3182
Copy link

I am using the developed version of bookdown and RStudio 1.2.209. Whenever I tried to modify the plot height with out.height, I got the following error:

! Paragraph ended before \Gin@ii was complete.
<to be read again> 
                   \par 
l.204 

Error: Failed to compile miniSample.tex. See miniSample.log for more info.
In addition: Warning messages:
1: running command '"pdflatex" -halt-on-error -interaction=batchmode "miniSample.tex"' had status 1 
2: running command '"pdflatex" -halt-on-error -interaction=batchmode "miniSample.tex"' had status 1 
Execution halted

I tried to change the compiling engine to xelatex, and it still produced the error. out.width works pretty well, though.

A minimal sample is attached:
miniSample.zip

@dataopt
Copy link
Contributor

dataopt commented Dec 30, 2017

Looks like the percent sign was parsed literally and caused pandoc to think that it is the beginning of a latex comment. The knitted file has the following:

\includegraphics[height=80%]{_main_files/figure-latex/pressure-1}

Changing out.height to out.width gives instead the following in the knitted file:

\includegraphics[width=0.8\linewidth]{_main_files/figure-latex/pressure-1}

So, in the case when out.height is specified, the percent sign should be replaced with \textheight.

EDIT: This seems to be a bug in knitr.

@dataopt
Copy link
Contributor

dataopt commented Dec 30, 2017

Until the bug is fixed, you can do this:

```{r pressure, out.height='0.8\\textheight'}
plot(pressure)
```

@yihui
Copy link
Member

yihui commented Dec 31, 2017

Fixed in the dev version of knitr. Thanks!

clrpackages pushed a commit to clearlinux-pkgs/R-knitr that referenced this issue Feb 2, 2018
David Hugh-Jones (1):
      Make Roxygen sentence case (#1483)

Jennifer (Jenny) Bryan (1):
      Structure of content returned by imgur has changed (#1496)

Ruaridh Williamson (1):
      Update spin code block styling (#1492)

Yihui Xie (27):
      use tinytex::latemk() to compile tikz to PDF
      install latex packages needed by tikzDevice
      use tinytex::latexmk() instead of tools::texi2pdf() to build .tex to .pdf in knit2pdf() and stitch()
      bump version
      try to cache texlive
      remove stringr::perl() since the next version of stringr will remove it
      bump version
      start using the sentence style
      fixes rstudio/bookdown#501: support percentage values in the out.height option
      roxygenize after #1483
      point to the original source
      update the FAQ URL
      some typos
      no longer hide showtext behind
      close #1489: reticulate 1.4 has fixed the issue with include=FALSE, echo=FALSE, etc
      don't repeat the regex, and roxygenize after #1492
      add @ruaridhw to contributors for #1492 and #1484
      several utils functions have been moved to the xfun package, and I'll use xfun in the future
      caching is an optional feature of knitr, so move digest to Suggests to make the dependencies a little lighter
      bump version
      a news item for #1495 and add Jenny to contributors
      default to html4 in eng_block()
      add the --mathjax option since Pandoc 2.0 will warn against LaTeX math if no math options are specified for the HTML output
      remove spin() examples since they require writing to the current directory, and CRAN no longer allows it
      bump version
      https
      CRAN release 1.19
@github-actions
Copy link

github-actions bot commented Nov 6, 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 6, 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

Successfully merging a pull request may close this issue.

3 participants