[NTG-context] imbalanced columns

Peter Rolf indiego at gmx.net
Thu Jul 15 10:33:03 CEST 2010


Am 15.07.2010 02:35, schrieb Idris Samawi Hamid ادريس   سماوي حامد:
> Hi Peter,
> 
> On Wed, 14 Jul 2010 14:26:10 -0600, Peter Rolf <indiego at gmx.net> wrote:
> 
>> Am 14.07.2010 20:42, schrieb Idris Samawi Hamid ادريس   سماوي حامد:
>>> Dear fellow gangsters,
>>>
>>> MkIV:
>>>
>>> \starttext
>>> \starttables[|c|c|c|c|c|]
>>> \HL
>>> \VL Sevens \VL \Use{2}[c]{Al-Yaʿqūbī} (d.~283{\sc ah})\VL
>>> \Use{2}[c]{Al-Munādī} (d.~334{\sc ah}) \VL\AR
>>> \HL
>>> \VL        \VL ʿAlī \VL Zayd                          \VL ʿAlī \VL
>>> Zayd                          \VL\AR
>>> \HL
>>> \stoptables
>>> \stoptext
>>>
>>> In row 2, the space between columns 2-3, and 3-4 are not even. Is this a
>>> bug? If not, how do I balance them?
>>>
>>
>> probably just automatic width balancing.
> 
> I'm sure you are right :-) The question is, what is the logic here? If
> this is correct behavior, I'd like to understand why. Can someone
> explain it?
>

has to do with the way the column width is calculated. the combined
entries (2+3,4+5) in row one can only influence (increase) the total
width of the involved columns, but they can not give an answer to the
question how wide the single columns should be.

in the end you need a linear system of equations (and metapost) to solve
this. and there is also no guarantee that it is solvable in all (more
complex) cases.

col2=col3; col4=col5;
col2+col3= ....;
col4+col5= ....;

also: i can't imagine how a user interface for this should look like. :)

>> maybe like this...
> 
> That's a great workaround, and I appreciate it. But what about new
> users? There has got to be a more elegant solution to this seemingly
> simple table. Row two just does not look right...
>

true, but this is font related. you can see this by using
\ruledhbox{ʿAlī}. you have to add some manual kerning (\kern-0.??em ...)
then.


>> \starttext
>>
>> \setbox\scratchbox\hbox{Al-Yaʿqūbī (d.~283{\sc ah})}
>> \newdimen\colA \colA\wd\scratchbox
>> \advance\colA-2em % sub column offsets
>> \setbox\scratchbox\hbox{Al-Munādī (d.~334{\sc ah})}
>> \newdimen\colB \colB\wd\scratchbox
>> \advance\colB-2em
>>
>> \starttables[|c|cp(.5\colA)|cp(.5\colA)|cp(.5\colB)|cp(.5\colB)|]
>> \HL
>> \VL Sevens \VL \Use{2}[c]{Al-Yaʿqūbī} (d.~283{\sc ah})\VL
>> \Use{2}[c]{Al-Munādī} (d.~334{\sc ah}) \VL\AR
>> \HL
>> \VL        \VL ʿAlī \VL Zayd                          \VL ʿAlī \VL Zayd
>>                          \VL\AR
>> \HL
>> \stoptables
>> \stoptext
> 
> Thanks again, Peter, and
> 
> Best wishes
> Idris



More information about the ntg-context mailing list