Skip to content

Commit

Permalink
Fix flake8 reported errors in previous cherry-picked commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Aug 8, 2022
1 parent 993e970 commit c99f150
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sphinx/writers/latex.py
Expand Up @@ -926,13 +926,18 @@ def visit_row(self, node: Element) -> None:
self.table.col = 0
_colsep = '' if self.table.booktabs else '|'

if self.builder.config.latex_zebra_stripes and not isinstance(node.parent, nodes.thead):
if (
self.builder.config.latex_zebra_stripes and
not isinstance(node.parent, nodes.thead)
):
if self.table.row % 2 == 0:
self.body.append(
'\\rowcolor{RowEvenColor}[\\dimexpr\\tabcolsep+0.1pt\\relax]')
'\\rowcolor{RowEvenColor}[\\dimexpr\\tabcolsep+0.1pt\\relax]'
)
else:
self.body.append(
'\\rowcolor{RowOddColor}[\\dimexpr\\tabcolsep+0.1pt\\relax]')
'\\rowcolor{RowOddColor}[\\dimexpr\\tabcolsep+0.1pt\\relax]'
)

# fill columns if the row starts with the bottom of multirow cell
while True:
Expand Down

0 comments on commit c99f150

Please sign in to comment.