Support more table environment configuration for cross referencing #930
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.
This fixes #924
As shown in #924 (comment), the issue is that the raw LaTeX for caption is not inserted in the right place when option for the table environment are passed: https://fr.overleaf.com/learn/latex/Tables#Reference_guide
Issue happens with gt because it adds something like
\begin{longtable}{rr}and it needs to be matched in our script.Also we need to add LaTeX new line after the caption to avoid a no align error. In knitr, we are adding
\\but I believe in Quarto you may expect\tabularnewline- I have seen this in here:quarto-cli/src/format/pdf/format-pdf.ts
Line 446 in 97b6995
So I used that.
This changes fix the initial issue.
I am opening this PR to run tests. I don't know if this change will be supported for all output and all type of LaTeX tables.
Also so that you can review and advice.