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

feat: allow rendering of tables to LaTeX #481

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Oct 2, 2024

This feature PR implements the rendering of tables to LaTeX, addressing #75 and #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.

Preview: https://pr-481--gt-python.netlify.app/a-latex_examples/index.pdf.

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 51.84382% with 222 lines in your changes missing coverage. Please review.

Project coverage is 84.60%. Comparing base (cc9829c) to head (8385bd9).

Files with missing lines Patch % Lines
great_tables/_utils_render_latex.py 35.74% 178 Missing ⚠️
great_tables/gt.py 15.38% 22 Missing ⚠️
great_tables/_formats.py 87.24% 19 Missing ⚠️
great_tables/_export.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #481      +/-   ##
==========================================
- Coverage   87.86%   84.60%   -3.26%     
==========================================
  Files          42       44       +2     
  Lines        4852     5185     +333     
==========================================
+ Hits         4263     4387     +124     
- Misses        589      798     +209     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot temporarily deployed to pr-481 October 2, 2024 18:12 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 2, 2024 20:53 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 2, 2024 21:20 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 2, 2024 21:38 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 3, 2024 01:04 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 3, 2024 01:10 Destroyed
@@ -71,6 +71,20 @@
create_heading_component_h,
create_source_notes_component_h,
)
from great_tables._utils_render_latex import (
Copy link
Collaborator

@machow machow Oct 3, 2024

Choose a reason for hiding this comment

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

Can you move these out of gt.py along with the definition _render_as_latex()?

But as it exists, this code is...

  • importing as_latex, which...
  • calls _render_as_latex(), that is defined in this file, which...
  • calls the create_*() functions defined in _utils_render_latex

So the path is going...

  • _export.as_latex() -> gt.py -> _utils_render_latex()

Ideally it seems like it should just be going...

  • _export.as_latex() -> _utils_render_latex()

And then we just assign the function to GT.as_latex()

@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 01:55 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 04:34 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 04:39 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 04:50 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 04:55 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 04:58 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 14:29 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 17:35 Destroyed
@github-actions github-actions bot temporarily deployed to pr-481 October 16, 2024 18:36 Destroyed
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