Re: @multitable with prototype row has no effect in html

2023-01-15 Thread Raymond Toy
I really appreciate all of the investigation done for this small issue.

Thanks.

On Sun, Jan 15, 2023 at 9:07 AM Patrice Dumas  wrote:

> On Sat, Jan 14, 2023 at 10:19:53AM +, Gavin Smith wrote:
> > On Sat, Jan 14, 2023 at 10:41:10AM +0100, Patrice Dumas wrote:
> > > It seems that the portability of "visibility: collapse" and
> > > implementation is not good, and that it would be better to use
> > > display: none
> > > https://developer.mozilla.org/en-US/docs/Web/CSS/visibility
> >
> > With "display: none" the table row does not affect the column widths at
> > all.
>
> Ok, so not real point trying to implement anything.
>
> --
> Pat
>


-- 
Ray


Re: @multitable with prototype row has no effect in html

2023-01-15 Thread Patrice Dumas
On Sat, Jan 14, 2023 at 10:19:53AM +, Gavin Smith wrote:
> On Sat, Jan 14, 2023 at 10:41:10AM +0100, Patrice Dumas wrote:
> > It seems that the portability of "visibility: collapse" and
> > implementation is not good, and that it would be better to use
> > display: none
> > https://developer.mozilla.org/en-US/docs/Web/CSS/visibility
> 
> With "display: none" the table row does not affect the column widths at
> all.

Ok, so not real point trying to implement anything.

-- 
Pat



Re: @multitable with prototype row has no effect in html

2023-01-14 Thread Gavin Smith
On Sat, Jan 14, 2023 at 10:19:54AM +, Gavin Smith wrote:
> I wonder if we could use it with multiple rows so that columns had
> the width of the widest text, plus some padding.  This would not
> allow for text wrapping but could be ok for short tables.

The following plain TeX input shows that good table output is possible
for short tables, without anything like a prototype row.  We just need
to use this underlying TeX functionality in texinfo.tex.  There's quite
a lot to consider, including line wrapping, items in the TODO file:

  - multicolumn * width to take up `the rest'.
  - @multitable: handle @hsep and @vsep.
  - @multitable: repeat table headings if multiple pages long.
  - @multitable: support a heading line concept ( in HTML).

this thread too suggesting mixing column fractions and prototypes:
https://lists.gnu.org/archive/html/bug-texinfo/2021-03/msg00041.html


\halign{

Re: @multitable with prototype row has no effect in html

2023-01-14 Thread Gavin Smith
On Sat, Jan 14, 2023 at 10:41:10AM +0100, Patrice Dumas wrote:
> It seems that the portability of "visibility: collapse" and
> implementation is not good, and that it would be better to use
> display: none
> https://developer.mozilla.org/en-US/docs/Web/CSS/visibility

With "display: none" the table row does not affect the column widths at
all.

> > I doubt this will be much use, anyway, as we want the output to look good
> > without CSS.
> 
> I propose to generate that code only if a customization variable is set,
> named: MULTITABLE_PROTOTYPE_WITH_CSS

What would be ideal is if we could eliminate the need for any prototype
row at all as this does not work well across output formats, leading users
to be confused.  However, I am not sure how easily it could be done in TeX.
In texinfo.tex \halign is used (this is a TeX primitive) but it is only
used with one row.

I wonder if we could use it with multiple rows so that columns had
the width of the widest text, plus some padding.  This would not
allow for text wrapping but could be ok for short tables.



Re: @multitable with prototype row has no effect in html

2023-01-14 Thread Patrice Dumas
On Fri, Jan 13, 2023 at 11:22:14PM +, Gavin Smith wrote:
> 
> Something like it appears to be possible with CSS:
> 
> 
> 
> greater than or equal to 333
> notequal 333
> relational function
> 
> OperationSymbolType
> less than
> relational infix
> less than or equal to class="code">=relational infix
> equality (syntactic) class="code">=relational infix
> 
> 
> although the prototype row was not strictly observed in the testing
> I did in Chromium - columns could be wider than needed in the text in
> the prototype row, so I am not sure what affect if any the
> "table-layout: fixed" setting is having.
> 
> "Table and column widths are set by the widths of table and col
> elements or by the width of the first row of cells. Cells in subsequent
> rows do not affect column widths."
> 
> https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
> 
> The "visibility: collapse" setting means the row is invisible and does
> not take up any space, but still affects the table layout and column widths.

It seems that the portability of "visibility: collapse" and
implementation is not good, and that it would be better to use
display: none
https://developer.mozilla.org/en-US/docs/Web/CSS/visibility

> I doubt this will be much use, anyway, as we want the output to look good
> without CSS.

I propose to generate that code only if a customization variable is set,
named: MULTITABLE_PROTOTYPE_WITH_CSS

-- 
Pat



Re: @multitable with prototype row has no effect in html

2023-01-13 Thread Gavin Smith
On Wed, Jan 04, 2023 at 01:59:26PM +0100, Patrice Dumas wrote:
> On Mon, Jan 02, 2023 at 09:39:33AM -0800, Raymond Toy wrote:
> > On Sun, Jan 1, 2023 at 10:12 AM Patrice Dumas  wrote:
> > 
> > > I do not remember any discussion about that.  But it is not clear to me
> > > what should be done.  There is no obvious way to get the width of
> > > rendered text in HTML.
> > >
> > >
> > I am no HTML expert, but couldn't you create a hidden row containing the
> > prototype text for each column?
> 
> I don't know how to do that.  An additional constraint is that, at least
> for the default output, it should look ok with no CSS, so if an header
> pops up when there is no CSS this is not good.

Something like it appears to be possible with CSS:



greater than or equal to 333
notequal 333
relational function

OperationSymbolType
less than
relational infix
less than or equal to=relational infix
equality (syntactic)=relational infix


although the prototype row was not strictly observed in the testing
I did in Chromium - columns could be wider than needed in the text in
the prototype row, so I am not sure what affect if any the
"table-layout: fixed" setting is having.

"Table and column widths are set by the widths of table and col
elements or by the width of the first row of cells. Cells in subsequent
rows do not affect column widths."

https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout

The "visibility: collapse" setting means the row is invisible and does
not take up any space, but still affects the table layout and column widths.

I doubt this will be much use, anyway, as we want the output to look good
without CSS.



Re: @multitable with prototype row has no effect in html

2023-01-04 Thread Gavin Smith
On Wed, Jan 04, 2023 at 08:53:41AM -0800, Raymond Toy wrote:
> So maybe the best thing is for the manual to say that prototypes have no
> effect in HTML.  I would be satisfied with that answer. Then I wouldn't
> have tried to use it and just used the columnfractions method to space out
> the table columns.

I've added a line to the manual.  Thanks for the report.



Re: @multitable with prototype row has no effect in html

2023-01-04 Thread Raymond Toy
On Wed, Jan 4, 2023 at 4:59 AM Patrice Dumas  wrote:

> On Mon, Jan 02, 2023 at 09:39:33AM -0800, Raymond Toy wrote:
> > On Sun, Jan 1, 2023 at 10:12 AM Patrice Dumas  wrote:
> >
> > > I do not remember any discussion about that.  But it is not clear to me
> > > what should be done.  There is no obvious way to get the width of
> > > rendered text in HTML.
> > >
> > >
> > I am no HTML expert, but couldn't you create a hidden row containing the
> > prototype text for each column?
>
> I don't know how to do that.  An additional constraint is that, at least
> for the default output, it should look ok with no CSS, so if an header
> pops up when there is no CSS this is not good.
>

I did some googling and some experiments but nothing really looked right to
me.  I didn't try super-hard.

So maybe the best thing is for the manual to say that prototypes have no
effect in HTML.  I would be satisfied with that answer. Then I wouldn't
have tried to use it and just used the columnfractions method to space out
the table columns.

>
> > Of course, the prototype is itself a bit
> > problematic with proportional fonts.  However, it does look nice in the
> PDF
> > version.
> >
> > Perhaps this is not worth the effort
>
> If somebody knows the HTML that allows to do it I could add it.
>
> It would also be nice to implement correctly in LaTeX output.
> Currently, for the LaTeX output, the prototype is converted to plain
> text and used to compute the fractions, which is bad (maybe doing
> nothing would be better actually), but if it is doable in Texinfo TeX
> (and it seems to be done with a little bit of code) it should be doable
> in LaTeX too.
>

I haven't tried the LaTeX output; I'm not really interested (currently) in
having makeinfo produce a LaTeX file.

>
> --
> Pat
>


-- 
Ray


Re: @multitable with prototype row has no effect in html

2023-01-04 Thread Patrice Dumas
On Mon, Jan 02, 2023 at 09:44:39AM -0800, Raymond Toy wrote:
> On Sun, Jan 1, 2023 at 10:19 AM Patrice Dumas  wrote:
> 
> Thanks, this should work.  I was just wondering if texinfo should be more
> consistent in the output since the PDF output has left-aligned columns, as
> does the info output.

I do not think that we should try to be consistent among output formats
regarding formatting, what matters is that the meaning is conveyed.
Here, it seems to me that centering allows to mark better the row as
an header row, but as long as it is marked somehow if possible (not
necessarily possible in Info) it is ok to me, even if it is only with a
change in the font.

-- 
Pat



Re: @multitable with prototype row has no effect in html

2023-01-04 Thread Patrice Dumas
On Mon, Jan 02, 2023 at 09:39:33AM -0800, Raymond Toy wrote:
> On Sun, Jan 1, 2023 at 10:12 AM Patrice Dumas  wrote:
> 
> > I do not remember any discussion about that.  But it is not clear to me
> > what should be done.  There is no obvious way to get the width of
> > rendered text in HTML.
> >
> >
> I am no HTML expert, but couldn't you create a hidden row containing the
> prototype text for each column?

I don't know how to do that.  An additional constraint is that, at least
for the default output, it should look ok with no CSS, so if an header
pops up when there is no CSS this is not good.

> Of course, the prototype is itself a bit
> problematic with proportional fonts.  However, it does look nice in the PDF
> version.
> 
> Perhaps this is not worth the effort

If somebody knows the HTML that allows to do it I could add it.

It would also be nice to implement correctly in LaTeX output.
Currently, for the LaTeX output, the prototype is converted to plain
text and used to compute the fractions, which is bad (maybe doing
nothing would be better actually), but if it is doable in Texinfo TeX
(and it seems to be done with a little bit of code) it should be doable
in LaTeX too.

-- 
Pat



Re: @multitable with prototype row has no effect in html

2023-01-02 Thread Raymond Toy
On Sun, Jan 1, 2023 at 10:19 AM Patrice Dumas  wrote:

> On Thu, Dec 29, 2022 at 11:06:45AM -0800, Raymond Toy wrote:
> > One other thing.  Each item from headitem is left-justified for both info
> > and pdf.  But it's centered in html.  For consistency, should they all be
> > left-justified?  (Or maybe allow a way to control that?  It looks funny
> in
> > html if the columns are wide, but the actual entries are narrow.)
>
> This depends on the browser rendering of .  You can use CSS to
> align, with 'text-align: start;'.  There may be other  in Texinfo
> output, so you could use something like the following to select th in
> multitables:
>
>  table.multitable th {
>   text-align: start;
>  }
>
>
Thanks, this should work.  I was just wondering if texinfo should be more
consistent in the output since the PDF output has left-aligned columns, as
does the info output.

> --
> Pat
>


-- 
Ray


Re: @multitable with prototype row has no effect in html

2023-01-02 Thread Raymond Toy
On Sun, Jan 1, 2023 at 10:12 AM Patrice Dumas  wrote:

> On Thu, Dec 29, 2022 at 10:59:43AM -0800, Raymond Toy wrote:
> > Consider the following table (taken in part from maxima's user manual):
> >
> > @multitable {greater than or equal to 333} {notequal 333} {relational
> > function}
> > @headitem Operation @tab Symbol @tab Type
> > @item less than  @tab @code{<}@tab relational
> infix
> > @item less than or equal to  @tab @code{<=}   @tab relational
> infix
> > @item equality (syntactic)   @tab @code{=}@tab relational
> infix
> > @end multltable
> >
> > In the pdf and info file, the columns are spaced out nicely according to
> > the prototype.  If the prototype is made wider, then the columns are
> > wider.  But this doesn't happen in the html output.  The width of each
> > column is pretty much fixed to the entry with the widest element.
>
> There is nothing specific in HTML with prototypes, so a plain HTML table
> is output, with the rendering based on the browser.
>
> > But if I replace the prototype with @columnfractions, everything works
> > nicely in info, pdf, and html.
> >
> > The prototype form is much easier to use; it's hard to know a priori what
> > column fractions to use to make the columns spaced nicely.
>
> I do not remember any discussion about that.  But it is not clear to me
> what should be done.  There is no obvious way to get the width of
> rendered text in HTML.
>
>
I am no HTML expert, but couldn't you create a hidden row containing the
prototype text for each column?  Of course, the prototype is itself a bit
problematic with proportional fonts.  However, it does look nice in the PDF
version.

Perhaps this is not worth the effort

> --
> Pat
>


-- 
Ray


Re: @multitable with prototype row has no effect in html

2023-01-01 Thread Patrice Dumas
On Thu, Dec 29, 2022 at 11:06:45AM -0800, Raymond Toy wrote:
> One other thing.  Each item from headitem is left-justified for both info
> and pdf.  But it's centered in html.  For consistency, should they all be
> left-justified?  (Or maybe allow a way to control that?  It looks funny in
> html if the columns are wide, but the actual entries are narrow.)

This depends on the browser rendering of .  You can use CSS to
align, with 'text-align: start;'.  There may be other  in Texinfo
output, so you could use something like the following to select th in
multitables:

 table.multitable th {
  text-align: start;
 }

-- 
Pat



Re: @multitable with prototype row has no effect in html

2023-01-01 Thread Patrice Dumas
On Thu, Dec 29, 2022 at 10:59:43AM -0800, Raymond Toy wrote:
> Consider the following table (taken in part from maxima's user manual):
> 
> @multitable {greater than or equal to 333} {notequal 333} {relational
> function}
> @headitem Operation @tab Symbol @tab Type
> @item less than  @tab @code{<}@tab relational infix
> @item less than or equal to  @tab @code{<=}   @tab relational infix
> @item equality (syntactic)   @tab @code{=}@tab relational infix
> @end multltable
> 
> In the pdf and info file, the columns are spaced out nicely according to
> the prototype.  If the prototype is made wider, then the columns are
> wider.  But this doesn't happen in the html output.  The width of each
> column is pretty much fixed to the entry with the widest element.

There is nothing specific in HTML with prototypes, so a plain HTML table
is output, with the rendering based on the browser.

> But if I replace the prototype with @columnfractions, everything works
> nicely in info, pdf, and html.
> 
> The prototype form is much easier to use; it's hard to know a priori what
> column fractions to use to make the columns spaced nicely.

I do not remember any discussion about that.  But it is not clear to me
what should be done.  There is no obvious way to get the width of
rendered text in HTML.

-- 
Pat



Re: @multitable with prototype row has no effect in html

2022-12-29 Thread Raymond Toy
On Thu, Dec 29, 2022 at 10:59 AM Raymond Toy  wrote:

> Consider the following table (taken in part from maxima's user manual):
>
> @multitable {greater than or equal to 333} {notequal 333} {relational
> function}
> @headitem Operation @tab Symbol @tab Type
> @item less than  @tab @code{<}@tab relational infix
> @item less than or equal to  @tab @code{<=}   @tab relational infix
> @item equality (syntactic)   @tab @code{=}@tab relational infix
> @end multltable
>
> In the pdf and info file, the columns are spaced out nicely according to
> the prototype.  If the prototype is made wider, then the columns are
> wider.  But this doesn't happen in the html output.  The width of each
> column is pretty much fixed to the entry with the widest element.
>
> But if I replace the prototype with @columnfractions, everything works
> nicely in info, pdf, and html.
>
>
>
One other thing.  Each item from headitem is left-justified for both info
and pdf.  But it's centered in html.  For consistency, should they all be
left-justified?  (Or maybe allow a way to control that?  It looks funny in
html if the columns are wide, but the actual entries are narrow.)
-- 
Ray


@multitable with prototype row has no effect in html

2022-12-29 Thread Raymond Toy
Consider the following table (taken in part from maxima's user manual):

@multitable {greater than or equal to 333} {notequal 333} {relational
function}
@headitem Operation @tab Symbol @tab Type
@item less than  @tab @code{<}@tab relational infix
@item less than or equal to  @tab @code{<=}   @tab relational infix
@item equality (syntactic)   @tab @code{=}@tab relational infix
@end multltable

In the pdf and info file, the columns are spaced out nicely according to
the prototype.  If the prototype is made wider, then the columns are
wider.  But this doesn't happen in the html output.  The width of each
column is pretty much fixed to the entry with the widest element.

But if I replace the prototype with @columnfractions, everything works
nicely in info, pdf, and html.

The prototype form is much easier to use; it's hard to know a priori what
column fractions to use to make the columns spaced nicely.

I tested this with texinfo 6.8 and 7.0.1; they both have the same html
column problem.

-- 
Ray