Skip to content

ascii.latex.AASTex: don't include new line characters after last row of data #3888

@jrka

Description

@jrka

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)

Result:

\begin{deluxetable}{cc}
 \tablehead{\colhead{a} & \colhead{b}}
\startdata
1 & 1234000000.0 \\
2 & 2.34e-12 \\
\enddata
\end{deluxetable}

Which looks like:
image

But if you got rid of the "\" after 2.34e-12, you'd get:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions