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

Added conversion of percent height to LaTex unit. #1482

Closed
wants to merge 2 commits into from
Closed

Added conversion of percent height to LaTex unit. #1482

wants to merge 2 commits into from

Conversation

dataopt
Copy link

@dataopt dataopt commented Dec 30, 2017

Before this patch, out.height for figures when specified as a percent leads to the percent sign get passed into pandoc causing parsing problems. The patch translates the percent to the equivalent fraction of \textheight

Fixes rstudio/bookdown#501

R/utils.R Outdated
@@ -355,6 +356,17 @@ percent_latex_width = function(x) {
x
}

# turn percent height to LaTeX unit, e.g. out.height = 30% -> .3\textheight
percent_latex_height = function(x) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently the code in this function pretty much duplicates percent_latex_width(). Can you try to merge the two into one and use an argument to control whether it is for width or height?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes merging the two into one committed.

@yihui yihui added this to the v0.19 milestone Dec 31, 2017
@yihui yihui closed this in 9e900e5 Dec 31, 2017
@yihui
Copy link
Owner

yihui commented Dec 31, 2017

Sorry for closing this PR. Normally I wouldn't do it, but this time the fix is simple enough, and I feel we probably need two more rounds of revisions in this PR, so I went ahead and did it by myself.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 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 this pull request may close these issues.

out.height seems not working
2 participants