Skip to content

Fix Issue #1580 #1603

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

Merged
merged 2 commits into from
Mar 9, 2024
Merged

Fix Issue #1580 #1603

merged 2 commits into from
Mar 9, 2024

Conversation

kbrevoort
Copy link
Collaborator

Summary

This pull request makes a minor correction to avoid a Latex error when including multiple tables in a Quarto document.

I've simplified the code to avoid having to define the holdLTright and holdLTleft variables, which were causing errors when being redefined in Quarto. These variables existed because to change the table width, we need to reset the lengths stored in variables LTright and LTleft. This would create side effects in Latex since changing these would alter them for every table that followed. As a result, I used holdLTright and holdLTleft to record the lengths of these variables at the very beginning of the table code and then restored those values at the end.

Among the changes made to master by my last PR, was the use of \begingroup and \endgroup at the start and end of the table code block to make changes to the font size only apply to the table code block. This change gets rid of the need for holdLTright and holdLTleft because changes made to LTright and LTleft will now also only apply within the code between \begingroup and \endgroup.

With the change, we no longer need "bookend" values for fontsize and table width values. I've changed the names of the functions that generated these values to reflect that they're now returning single fontsize and table width statements to make the code clearer.

I verified that the code works in RMarkdown and Quarto and have updated the tests.

Related GitHub Issues and PRs

Checklist

Gets rid of holdLTleft and holdLTright, which are no longer necessary because we wrap everything in \begingroup - \endgroup and have been finicky.
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

LGTM!

@rich-iannone rich-iannone merged commit 411328c into rstudio:master Mar 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants