Skip Menu |

This queue is for tickets about the LaTeX-Table CPAN distribution.

Report information
The Basics
Id: 62395
Status: resolved
Priority: 0/
Queue: LaTeX-Table

People
Owner: Nobody in particular
Requestors: REHSACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



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; }
Dear Jens, thanks for your patch. We should name this new attribute 'newline' or maybe better 'eor' (end of row) with \\ as default. Documented in "TABULAR ENVIRONMENT'. I'm currently a little bit puzzled how to support custom newlines for particular rows. As a dirty workaround, one could append '\\[custom]%' to the last column. Have to think about this. If you want write access in the github repository, let me know... About your problems with math environments in tables, you could check if Filippo's suggestions work for you: http://www.tug.org/pracjourn/2007-1/mori/mori.pdf Best and thanks again, Markus
Applied your patch for 1.0.6. I changed the name to eor and set \\\\ as default. Thanks again!
Subject: Re: [rt.cpan.org #62395] Support for row dimension
Date: Tue, 26 Oct 2010 14:10:55 +0200 (CEST)
To: bug-LaTeX-Table [...] rt.cpan.org
From: "Jens Rehsack" <rehsack [...] web.de>
Show quoted text
-----Ursprüngliche Nachricht----- Von: "LIMAONE via RT" Gesendet: Oct 23, 2010 6:22:51 PM An: REHSACK@cpan.org Betreff: [rt.cpan.org #62395] Support for row dimension
>Dear Jens,
Hi Markus,
>thanks for your patch. We should name this new attribute 'newline' or maybe better 'eor' (end of >row) with \\ as default. Documented in "TABULAR ENVIRONMENT'. I'm currently a little bit >puzzled how to support custom newlines for particular rows. As a dirty workaround, one could >append '\\[custom]%' to the last column. Have to think about this. >If you want write access in the github repository, let me know...
Better not, I destroy my git checkouts on a regular basis :( I'm pretty familiar with svn, but cannot get warm with git.
>About your problems with math environments in tables, you could check if Filippo's suggestions >work for you: > > http://www.tug.org/pracjourn/2007-1/mori/mori.pdf
Well, didn't discuss exactly my problem. I think I have to play with it a bit ... Probably I can upload a developer version to CPAN and you can do a quick look...
>Best and thanks again,
I have to thank! It's very comfortable having module maintainers like you.
>Markus
/Jens
wrong mail address chosen - RT reopens automatically, sorry.