Skip to content

Commit 31c8f69

Browse files
authored
Merge pull request #911 from Alex-Jordan/niceTables-hotfixes
Nice tables hotfixes
2 parents 5201eb8 + 4c2b7c7 commit 31c8f69

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

assets/tex/pg.sty

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
% packages that are needed for some PG macro to function for tex output or that
55
% support math mode tex macros that could reasonably appear in a PG problem
66
\usepackage{amsmath, amsfonts, amssymb} % math macros
7-
\usepackage{booktabs, tabularx, colortbl, caption, xcolor} % niceTables.pl
7+
\usepackage{booktabs, tabularx, colortbl, caption} % niceTables.pl
8+
\usepackage[table]{xcolor} % niceTables.pl
89
\usepackage{multicol} % DragNDrop.pm
910
\usepackage[version=4]{mhchem} % chemistry macros
1011

macros/ui/niceTables.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,10 @@ sub Rows {
758758
if $x->{bottom};
759759
}
760760

761+
# if this row had a row color, disable that now or else with nested tables
762+
# the row color will extend into subsequent rows (this seems like a colortbl bug)
763+
$row = suffix($row, '\hiderowcolors', ' ') if $rowcolor;
764+
761765
push(@rows, $row);
762766
} elsif ($main::displayMode eq 'PTX') {
763767
my $ptxbottom = '';
@@ -942,6 +946,7 @@ sub Row {
942946
$columntype =~ s/^p/b/ if ($valign eq 'bottom');
943947
$columntype =~ s/^p/m/ if ($tableOpts->{valign} eq 'middle');
944948
$columntype =~ s/^p/b/ if ($tableOpts->{valign} eq 'bottom');
949+
$columntype = ">{$cellAlign->{tex}}" . $columntype if $cellAlign->{tex};
945950
$columntype = getLaTeXcolumnWidth($alignment->[0]{left}) . $columntype
946951
if ($i == 0 && $alignment->[0]{left} && !$cellOpts->{halign});
947952

@@ -1492,7 +1497,7 @@ sub getLaTeXthickness {
14921497
my $input = shift;
14931498
my $output = '';
14941499
if ($input =~ /^\s*(\.\d+|\d+\.?\d*)\s*$/) {
1495-
$output = "$1px" if $1;
1500+
$output = $1 * 0.75 . 'pt' if $1;
14961501
} elsif ($input) {
14971502
$output = "$input";
14981503
}

0 commit comments

Comments
 (0)