ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startalignment etc. require text immediately after
@ 2006-01-24 14:30 Ville Voipio
  2006-01-24 15:16 ` Taco Hoekwater
  0 siblings, 1 reply; 2+ messages in thread
From: Ville Voipio @ 2006-01-24 14:30 UTC (permalink / raw)


One phenomenon I have repeatedly come accross but not quite 
understood... If I have \startalignment, \startnarrower, etc., then 
there has to be text immediately after the start command.

As small example:

\startalignment[center]
\bTABLE
\bTR \bTD something \eTD \eTR
\eTABLE
\stopalignment

This should create a single-cell table in the middle of the page. It 
does not, the text is in the left.

If I add something small (a strut), then everything works fine:

\startalignment[center]
\strut
\bTABLE
\bTR \bTD something \eTD \eTR
\eTABLE
\stopalignment

Any text has the same effect as the strut. If the text is added to the 
end, it does not have any effect, i.e. the start has no effect. After 
some quick experimenting it seems evident that there has to be text 
after the start command. A figure or a table won't do. Why? And does 
this occur with any start-stop pair (sounds odd) or just with a few? And 
what is the kosher way of solving this problem?

This must be a FAQ, but I could not find the search terms to find an answer.

TIA,

- Ville

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: \startalignment etc. require text immediately after
  2006-01-24 14:30 \startalignment etc. require text immediately after Ville Voipio
@ 2006-01-24 15:16 ` Taco Hoekwater
  0 siblings, 0 replies; 2+ messages in thread
From: Taco Hoekwater @ 2006-01-24 15:16 UTC (permalink / raw)




Ville Voipio wrote:
> One phenomenon I have repeatedly come accross but not quite 
> understood... If I have \startalignment, \startnarrower, etc., then 
> there has to be text immediately after the start command.

The best thing you can add is \dontleavehmode. The problem is
that TeX is still in Vertical mode when it encounters the box
that is created by the TABLE environment. So:

   \startalignment[center]
   \dontleavehmode
   \bTABLE
   \bTR \bTD something \eTD \eTR
   \eTABLE
   \stopalignment


Cheers, Taco

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-24 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24 14:30 \startalignment etc. require text immediately after Ville Voipio
2006-01-24 15:16 ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).