Skip to content

Commit

Permalink
Merge pull request #7349 from xuanxu/latex-reader
Browse files Browse the repository at this point in the history
Makes Latex reader ignore table rules
  • Loading branch information
bsipocz committed Apr 22, 2018
2 parents 9aa4dc3 + 1e76791 commit 64b5733
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ astropy.extern
astropy.io.ascii
^^^^^^^^^^^^^^^^

Latex reader now ignores ``\toprule``, ``\midrule``, and ``\bottomrule`` commands [#7349]

astropy.io.misc
^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion astropy/io/ascii/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class Latex(core.BaseReader):
data_class = LatexData
inputter_class = LatexInputter

def __init__(self, ignore_latex_commands=['hline', 'vspace', 'tableline'],
def __init__(self, ignore_latex_commands=['hline', 'vspace', 'tableline', 'toprule', 'midrule', 'bottomrule'],
latexdict={}, caption='', col_align=None):

super().__init__()
Expand Down
4 changes: 4 additions & 0 deletions astropy/io/ascii/tests/t/latex2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
\tablehead{\colhead{Facility} & \colhead{Id} & \colhead{exposure} & \colhead{date}}

\startdata
\toprule
Chandra & \dataset[ADS/Sa.CXO#obs/06438]{ObsId 6438} & 23 ks & 2006-12-10\\
\midrule
Spitzer & AOR 3656448 & 41.6 s & 2004-06-09\\
\midrule
FLWO & filter: $B$ & 600 s & 2009-11-18\\
\bottomrule
\enddata

\end{deluxetable}
1 change: 1 addition & 0 deletions astropy/io/ascii/tests/t/latex3.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
cola & colb & colc\\
\hline
a & 1 & 2\\
\midrule
b & 3 & 4\\
\hline
\end{tabular}

0 comments on commit 64b5733

Please sign in to comment.