Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
testthat
unit tests totests/testthat
for any new functionality.