Subject: | Support for row dimension |
Hi,
I'm currently working on a math training app for my daughter and when I
add fractions into a table row, two rows overlapping slightly.
I studied tabular and longtable documentation and detected the
"field1 & field2 \\[<dim>]" support. Attached is a first shot to see
whether it works and solves my basic issue - and it does (even if it's
only a workaround).
If you like it (not the name of the attribute - I can change it), I'd
like to add some documentation (suggestion for the right place for that
would be nice) and provide a new, full patch for it.
Why it's only a workaround in my special situation? I've seen that long
rows will be wrapped and fractions wrapped rows overlap with the
fraction in the same row in the line above. So it seems I need to figure
out how to increase line height in a table with math environment (I
don't want to increase line height in general).
Best regards,
Jens
Subject: | row-dim.patch |
diff --git a/lib/LaTeX/Table.pm b/lib/LaTeX/Table.pm
index cdeae5b..f739b95 100644
--- a/lib/LaTeX/Table.pm
+++ b/lib/LaTeX/Table.pm
@@ -28,7 +28,7 @@ use Module::Pluggable
# Str
for my $attr (
- qw(label maincaption shortcaption caption caption_top coldef custom_template width maxwidth width_environment custom_tabular_environment position tabletail star)
+ qw(label maincaption shortcaption caption caption_top coldef custom_template width maxwidth width_environment custom_tabular_environment position row_height tabletail star)
)
{
has $attr => ( is => 'rw', isa => 'Str', default => 0 );
@@ -381,7 +381,10 @@ ROW:
for my $i ( 0 .. scalar( @{$row} ) - 1 ) {
$row->[$i] = sprintf '%-*s', $max{$i}, $row->[$i];
}
- $code .= join( ' & ', @{$row} ) . " \\\\\n";
+ $code .= join( ' & ', @{$row} ) . " \\\\";
+ my $row_height = $self->get_row_height;
+ $row_height and $code .= "[$row_height]";
+ $code .= "\n";
}
return $code;
}