great-tables
great-tables copied to clipboard
feat: allow rendering of tables to LaTeX
This feature PR implements the rendering of tables to LaTeX, addressing https://github.com/posit-dev/great-tables/issues/75 and https://github.com/posit-dev/great-tables/issues/178. This will be exposed through the as_latex() method on the GT class. If in Quarto and the render target is LaTeX, tables will be automatically rendered as LaTeX tables.
Codecov Report
Attention: Patch coverage is 95.26917% with 29 lines in your changes missing coverage. Please review.
Project coverage is 88.88%. Comparing base (
cc9829c) to head (c2f7c81). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #481 +/- ##
==========================================
+ Coverage 87.86% 88.88% +1.01%
==========================================
Files 42 44 +2
Lines 4852 5216 +364
==========================================
+ Hits 4263 4636 +373
+ Misses 589 580 -9
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
- Explicitly raise or warn for currently unsupported behaviors (e.g. styles)
Now we warn when there is any definition of tab_style() in LaTeX output.
- formatters sometimes run but their output generate latex errors
- fmt_nanoplot
- fmt_markdown
- fmt_image
- fmt_url
- fmt_integer (?) -- this seems to raise a python error
- fmt_integer() is fine. No error on second look
- fmt_url() is not in API.
- fmt_image now provides a warning and formatting is skipped
- fmt_markdown raises a NotImplementedError in LaTeX render
- fmt_nanoplot also raises a NotImplementedError
- the
md()andhtml()functions produce output that causes latex errors (but maybe this is okay?)
- md() still raises a NotImplementedError
- html() will warn and perform LaTeX escaping on the string
From pairing, LGTM -- thanks for this ENORMOUS push, excited for latex tables!