Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice tables hotfixes #911

Merged
merged 3 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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