You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ascii.latex.AASTex: don't include new line characters after last row of data #3888
Very minor issue: writing a table in AASTex (deluxetable) format includes new line characters at the end of each line, including the last one. This results in a blank line at the end of each table. The last row of a table before "\enddata" should not include the "\" characters.
Example:
from astropy.io import ascii
from astropy.table import Table
import sys
t = Table([[1,2],[1.234e9,2.34e-12]], names = ('a','b'))
ascii.write(t,sys.stdout,Writer=ascii.latex.AASTex)
@taldcroft : I think that's fine. This is a very specialized reader/writer where we can do these "ad-hoc" solutions.
Do you want to convert this into a PR? I would ask you to add a comment to the code above the line that you added that explains what it does. It's not immediately obvious for future maintainers.
Also, I just checked regular LaTeX. That does not have this problem; it seems to be specific to ApJ's deluxetable package.
Activity
embray commentedon Jun 26, 2015
Confirmed, and definitely worth fixing.
taldcroft commentedon Jun 30, 2015
I personally think this is an upstream issue in LaTeX, but I agree we can fix this here. 😄
Here is a brutal hack that does the trick. Can you think of a better way @hamogu ?
taldcroft commentedon Jun 30, 2015
Oh, does plain LaTeX have the same problem? The table output has the same final trailing
\\but I don't know if this is a problem for plain tables.hamogu commentedon Jun 30, 2015
@taldcroft : I think that's fine. This is a very specialized reader/writer where we can do these "ad-hoc" solutions.
Do you want to convert this into a PR? I would ask you to add a comment to the code above the line that you added that explains what it does. It's not immediately obvious for future maintainers.
Also, I just checked regular LaTeX. That does not have this problem; it seems to be specific to ApJ's deluxetable package.
taldcroft commentedon Jun 30, 2015
@jrka - do you want to take a crack at this? In any case I'm leaving this open as low-hanging fruit for the upcoming astropy sprint at scipy 2015.
jrka commentedon Jun 30, 2015
@taldcroft , since scipy is just next week I'll keep it on the back burner for now. But if no one gets to it, I will do so!
shwetamore1295 commentedon Jan 26, 2016
If this issue isn't fixed, can I work on this issue?
taldcroft commentedon Jan 26, 2016
@shwetamore1295 - go for it!
anchitjain1234 commentedon Feb 4, 2016
Please check #4561.
Added changelog entry. Fixes astropy#3888.
Added changelog entry. Fixes astropy#3888.
Added changelog entry. Fixes astropy#3888.
Replaced slicing by regular expression for more robust matching. Fixes …
Added changelog entry. Fixes astropy#3888.
Replaced slicing by regular expression for more robust matching. Fixes …