Repository navigation
Read LaTeX tables where there is whitespace before the \begin{tabular} - #17624
Merged
Merged
Conversation
Contributor
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
pllim
reviewed
Jan 10, 2025
Member
Author
|
pre-commit.ci autofix |
mhvk
reviewed
Jan 11, 2025
mhvk
left a comment
Contributor
There was a problem hiding this comment.
Yes, nice little paper cut avoidance! Small comments inline.
Member
Author
|
Note that I didn't' want to shift the entire doctoring inwards y 4 space, but the pre-commit checked failed until I did so with the autofix. I don't like it, but I guess we use that formatter, so that we never have to discuss formatting again... just don't blame me if you don't like it! |
This commit fixes astropy#4595 as discussed in that issue: It makes the finding of the \begin{tabular} (and similar keywords) a little bit more flexible by allowing extra white space. Extra white space is easy to introduce when copying and pasting from a LaTeX file. It does not implement any further flexibility. It does not allow extra text in front of the tag because the reader cannot replace a full LaTeX parser an we prefer to fail in cases like `1 & 3 & 4 \\ \end{tabular}` instead of silently dropping the last row of data just because it happens to be in the same line as the `\end{tabular}`. It also does not add a reader to read LaTeX tables without the \bgin{tabular} \end{tabular} lines. Every full LaTeX table has those and if users copy and paste from a longer LaTeX file, they can simply include those lines. Documentation has been added to that effect.
Co-authored-by: P. L. Lim <[email protected]>
mhvk
force-pushed
the
fix_4295_whitespace
branch
from
January 11, 2025 17:01
3784f53 to
1002717
Compare
mhvk
approved these changes
Jan 11, 2025
mhvk
left a comment
Contributor
There was a problem hiding this comment.
Thanks, and sorry for the strange effects of my request to replace the back-slash strings with raw strings...
meeseeksmachine
pushed a commit
to meeseeksmachine/astropy
that referenced
this pull request
Jan 11, 2025
…e before the `\begin{tabular}`
pllim
added a commit
that referenced
this pull request
Jan 13, 2025
…624-on-v7.0.x Backport PR #17624 on branch v7.0.x (Read LaTeX tables where there is whitespace before the `\begin{tabular}`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 commit fixes #4595 as discussed in that issue:
It makes the finding of the \begin{tabular} (and similar keywords) a little bit more flexible by allowing extra white space. Extra white space is easy to introduce when copying and pasting from a LaTeX file. It does not implement any further flexibility. It does not allow extra text in front of the tag because the reader cannot replace a full LaTeX parser an we prefer to fail in cases like
1 & 3 & 4 \\ \end{tabular}instead of silently dropping the last row of data just because it happens to be in the same line as the\end{tabular}.It also does not add a reader to read LaTeX tables without the \bgin{tabular} \end{tabular} lines. Every full LaTeX table has those and if users copy and paste from a longer LaTeX file, they can simply include those lines. Documentation has been added to that effect.