-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix aastex lastline #5236
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
Fix aastex lastline #5236
Conversation
LatexSplitter inherits from core.BaseSplitter LatexSplitter.__call__ overrides the default function to handle the last line with a special case that allows for a lat line without \\.
This requires adding the same to any class that inherits from LatexSplitter. In this case this also required adding last_line to AASTexHeaderSplitter.process_line. even though it doesn't do anything in the case of reading a header.
|
@taldcroft Could you take a look at this pull request to allow the reading of LaTeX table files with no |
|
@hamogu - you may also be able to review this? |
|
This should have an entry in CHANGES.rst. |
|
@wmwv - just back from vacation and trying to catch up. |
| def find_latex_line(lines, latex): | ||
| ''' | ||
| Find the first line which matches a patters | ||
| Find the first line which matches a pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a . at the end of the sentence.
|
I included some comments but this seems really complex for such a small change. For example you override |
|
As alternative: Why not just check the "last line" if it "ends" with a |
|
Thanks @MSeifert04 for a very through review. Some of the changes recommended as easy and should definitely be done (adding . at the end of sentence etc.) while we are looking at this in detail right now. |
|
I agree with @MSeifert04 that this change appears at the outset to be more complicated than necessary. Following on his suggestion, would this work? |
|
|
||
| class LatexSplitter(core.BaseSplitter): | ||
| '''Split LaTeX table date. Default delimiter is `&`. | ||
| '''Split LaTeX table data. Default delimiter is `&`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
& should be using double ticks, not single.
Allow for last line to not have an ended
\\by restructuring the LatexHeader line-by-line generator and write a special-case last_line option for processing the lines of a table.The tests for this are part of the round-tripping testing of #5235.