olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 13 forks source link

Problem with horizontally and vertically sized table cells #77

Closed itmm closed 2 years ago

itmm commented 2 years ago

I run into problems with formatted tables (fixed cell width and height), like in the following example:

\enlang
\fontfam[Libertinus]
\raggedbottom
\table{p{3cm}l}{
    cell 1 & cell 2 \cr\tskip2cm
    cell 3 & cell 4
}
\bye

The error message is

! Misplaced alignment tab character &.
\_ddlinedata ->&
                \_dditem 
\_tskipA ...tA {}\_vbox to\_tmpdim {}\_ddlinedata 
                                                  \_crcr \_zerotabrule \_noa...

l.1 \_afterassignment \_tskipA \_tmpdim 2cm 
                                          cell 3
\_partabitem ...ip \_zo \_relax \_partabitemA {#1}
                                                  \_unsskip \_ifvmode \_vski...

<template> }
 }\_the \_tabitemr \_tabstrutA \_relax \_egroup \endtemplate 
l.1  cell 1 & cell 2 \cr \tskip 2cm cell 3 &
                                           cell 4 \_crcr
\_tableC ... \_scantextokens \_ea {\_tmpb \_crcr }
                                                  }
\_tableB ...leC \_else \_halign \_tablew \_tableC 
                                                  \_fi \_egroup 
l.7 }

But if I change the p{3cm} to l or remove the \tskip everything runs fine. As a workaround I prefixed the table with an additional empty l column and tried to position it so that the empty column is in the margin.

I am using LuaHBTeX 1.13.2 as part of mmtex v20210626 with OpTeX 1.03+ Jun.2021.

vlasakm commented 2 years ago

This problem (just like issue https://github.com/olsak/OpTeX/issues/66) was caused by commit cde08d91f98cfdd637c35ecbec661d2cb1c57e8c. It was also fixed as part of b769ef111a0e0697a407b45cd002437782eb5959.

The example works for me with OpTeX 1.04 (mmtex v20210902).

itmm commented 2 years ago

OK, then I have to wait until this version is available via the Open Build Service.

vlasakm commented 2 years ago

From Debian repository I have:

This is LuaTeX, Version 1.13.2 (mmtex 20210902)
This is OpTeX (Olsak's Plain TeX), version <1.04 Aug.2021>

and apt info mmtex:

$ apt info mmtex
Package: mmtex
Version: 20210829-1
Priority: optional
Section: user/hidden
Maintainer: Michal Vlasák <lahcim8@gmail.com>
Installed-Size: 17.5 MB
Depends: libc6 (>= 2.29), libpng16-16 (>= 1.6.2-1), libzzip-0-13 (>= 0.13.56), zlib1g (>= 1:1.2.3.4), fonts-lmodern
Download-Size: 4167 kB
APT-Manual-Installed: yes
APT-Sources: http://download.opensuse.org/repositories/home:/lahcim8/Debian_11  Packages
Description: A minimal modern (Lua)TeX distribution

So the most recent version (20210902) gets installed, but I forgot to update one of the debian version numbers and maybe your apt doesn't see the version as newer. I updated the version number. A package rebuild is in process. I will check if that gets it right when it finishes.

vlasakm commented 2 years ago

@itmm Should be fine now after the usual apt update / upgrade.

itmm commented 2 years ago

yes, it works. Thank you very much! Sorry for the inconveniences.