bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multitable widths problem


From: Gavin Smith
Subject: Re: multitable widths problem
Date: Wed, 24 Mar 2021 21:12:01 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Mar 19, 2021 at 09:20:15PM +0100, Werner LEMBERG wrote:
> Thanks for the explanation.  What I conclude is that changing the way
> `@columnfractions` works would break too much documents.  Alas, using
> prototypes is not always practicable.
> 
> I thus suggest that you introduce a new command, say, `@columnwidths`,
> that works the same as `@columnfractions` does but without including
> the space between columns.
> 
> And while you are at it: Another nice thing would be the ability to be
> able to use both fraction values and prototypes :-)
> 
> Regardless of improvements, the documentation should be improved so
> that people like me are not suprised by unexpected results of
> `@columnfractions`.
> 

I added a note to the manual.

We'd have to think carefully about adding any new command.  I think
you can already do something with a macro:

\input texinfo.tex

@multitable @columnfractions .3 .2 .3 .2
@item
@code{abcde fghijklmnopqrstu}
@tab
foobar
@tab
@code{abcde fghijklmnopqrstu}
@tab
foobar
@end multitable

@macro CWidth{f}
@inlineraw{tex, \\hbox to \f\\\hsize{}}
@end macro

@multitable {@CWidth{.28}} {@CWidth{.19}} {@CWidth{.28}} {@CWidth{.19}}
@item
@code{abcde fghijklmnopqrstu}
@tab
foobar
@tab
@code{abcde fghijklmnopqrstu}
@tab
foobar
@end multitable

@bye 

This looks good for TeX output but for Info output removes spaces
between columns as the column widths aren't set properly.

So the best option at the moment is, unfortunately, something like

@iftex
@multitable {@CWidth{.28}} {@CWidth{.19}} {@CWidth{.28}} {@CWidth{.19}}
@end iftex
@ifnottex
@multitable @columnfractions .3 .2 .3 .2
@end ifnottex
@item
@code{abcde fghijklmnopqrstu}
@tab
foobar
@tab
@code{abcde fghijklmnopqrstu}
@tab
foobar
@end multitable

which does work (although you never know with macros and conditionals).
This approach would allow you to mix fraction values and prototypes
for TeX output only.  Perhaps your use case is rare enough that this
is tolerable?

Note that trying to include the braces inside the definition of @CWidth
doesn't work, like

@macro CWidth{f}
{@inlineraw{tex, \\hbox to \f\\\hsize{}}}
@end macro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]