Skip to content

Commit

Permalink
Merge pull request #911 from Alex-Jordan/niceTables-hotfixes
Browse files Browse the repository at this point in the history
Nice tables hotfixes
  • Loading branch information
pstaabp authored Aug 20, 2023
2 parents 5201eb8 + 4c2b7c7 commit 31c8f69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/tex/pg.sty
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
% packages that are needed for some PG macro to function for tex output or that
% support math mode tex macros that could reasonably appear in a PG problem
\usepackage{amsmath, amsfonts, amssymb} % math macros
\usepackage{booktabs, tabularx, colortbl, caption, xcolor} % niceTables.pl
\usepackage{booktabs, tabularx, colortbl, caption} % niceTables.pl
\usepackage[table]{xcolor} % niceTables.pl
\usepackage{multicol} % DragNDrop.pm
\usepackage[version=4]{mhchem} % chemistry macros

Expand Down
7 changes: 6 additions & 1 deletion macros/ui/niceTables.pl
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,10 @@ sub Rows {
if $x->{bottom};
}

# if this row had a row color, disable that now or else with nested tables
# the row color will extend into subsequent rows (this seems like a colortbl bug)
$row = suffix($row, '\hiderowcolors', ' ') if $rowcolor;

push(@rows, $row);
} elsif ($main::displayMode eq 'PTX') {
my $ptxbottom = '';
Expand Down Expand Up @@ -942,6 +946,7 @@ sub Row {
$columntype =~ s/^p/b/ if ($valign eq 'bottom');
$columntype =~ s/^p/m/ if ($tableOpts->{valign} eq 'middle');
$columntype =~ s/^p/b/ if ($tableOpts->{valign} eq 'bottom');
$columntype = ">{$cellAlign->{tex}}" . $columntype if $cellAlign->{tex};
$columntype = getLaTeXcolumnWidth($alignment->[0]{left}) . $columntype
if ($i == 0 && $alignment->[0]{left} && !$cellOpts->{halign});

Expand Down Expand Up @@ -1492,7 +1497,7 @@ sub getLaTeXthickness {
my $input = shift;
my $output = '';
if ($input =~ /^\s*(\.\d+|\d+\.?\d*)\s*$/) {
$output = "$1px" if $1;
$output = $1 * 0.75 . 'pt' if $1;
} elsif ($input) {
$output = "$input";
}
Expand Down

0 comments on commit 31c8f69

Please sign in to comment.