Dear all,

By way of further definition and clarification of the issue: back in the world of LaTeX, I was kindly given the following code on CTT by Donald Arseneau to produce the desired effect. Mind you, it was only meant to work with a paragraph if the entire paragraph was on one page; it wouldn't work if split across pages:

%%% Donald Arseneau’s Gridblock Environment %%%
% For placing paragraphs into a box, and that box then
% being placed on a “grid” of the baselineskip. This ensures
% that following paragraphs are also on the grid.
\makeatletter
\@ifundefined{@tempdimc}{\newdimen\@tempdimc}{} 
\newenvironment{gridblock}{\par 
  \setbox\@tempboxa\vtop\bgroup 
}{\par\egroup 
  % measurements of top 
  \@tempdima=\ht\@tempboxa 
  \@tempdimc=\dp\@tempboxa 
  \ifdim\@tempdima>\ht\strutbox 
    \advance\@tempdimc\@tempdima 
    \@tempdima=\ht\strutbox 
    \advance\@tempdimc-\@tempdima 
  \fi 
  % measurements of bottom 
  \setbox\@tempboxa\vbox{\unvbox\@tempboxa}% 
  \ifdim\dp\@tempboxa>\dp\strutbox 
    \@tempdimb=\dp\strutbox 
  \else 
    \@tempdimb=\dp\@tempboxa 
  \fi 
 \advance\@tempdimc-\@tempdimb 
  \@tempcnta=\@tempdimc 
  \divide\@tempcnta\baselineskip 
  \advance\@tempdimc -\@tempcnta\baselineskip 
  \ifdim\@tempdimc >2\vfuzz \advance\@tempdimc-\baselineskip \fi 
  \divide\@tempdimc\tw@ 
  \vbox to\@tempdima{}% 
  \nobreak \nointerlineskip \kern-\@tempdima \kern-\@tempdimc \nobreak 
  \box\@tempboxa 
  \nobreak \nointerlineskip \kern-\@tempdimb \kern-\@tempdimc \nobreak 
  \hbox{\vrule height \z@ width \z@ depth \@tempdimb}% 
\makeatother


Seeing how systematised ConTeXt is, I'm assuming something much simpler could probably be used to achieve the same effect?

Kind regards,
Talal
On 3 Oct 2010, at 20:10, Talal Al-Azem wrote:

By way of further definition and clarification of the issue: back in the world of LaTeX, I was kindly given the following code on CTT by Donald Arseneau to produce the desired effect. Mind you, it was only meant to work with a paragraph if the entire paragraph was on one page; it wouldn't work if split across pages:

%%% Donald Arseneau’s Gridblock Environment %%%
% For placing paragraphs into a box, and that box then
% being placed on a “grid” of the baselineskip. This ensures
% that following paragraphs are also on the grid.
\makeatletter
\@ifundefined{@tempdimc}{\newdimen\@tempdimc}{} 
\newenvironment{gridblock}{\par 
  \setbox\@tempboxa\vtop\bgroup 
}{\par\egroup 
  % measurements of top 
  \@tempdima=\ht\@tempboxa 
  \@tempdimc=\dp\@tempboxa 
  \ifdim\@tempdima>\ht\strutbox 
    \advance\@tempdimc\@tempdima 
    \@tempdima=\ht\strutbox 
    \advance\@tempdimc-\@tempdima 
  \fi 
  % measurements of bottom 
  \setbox\@tempboxa\vbox{\unvbox\@tempboxa}% 
  \ifdim\dp\@tempboxa>\dp\strutbox 
    \@tempdimb=\dp\strutbox 
  \else 
    \@tempdimb=\dp\@tempboxa 
  \fi 
 \advance\@tempdimc-\@tempdimb 
  \@tempcnta=\@tempdimc 
  \divide\@tempcnta\baselineskip 
  \advance\@tempdimc -\@tempcnta\baselineskip 
  \ifdim\@tempdimc >2\vfuzz \advance\@tempdimc-\baselineskip \fi 
  \divide\@tempdimc\tw@ 
  \vbox to\@tempdima{}% 
  \nobreak \nointerlineskip \kern-\@tempdima \kern-\@tempdimc \nobreak 
  \box\@tempboxa 
  \nobreak \nointerlineskip \kern-\@tempdimb \kern-\@tempdimc \nobreak 
  \hbox{\vrule height \z@ width \z@ depth \@tempdimb}% 
\makeatother


Seeing how systematised ConTeXt is, I'm assuming something much simpler could probably be used to achieve the same effect?

Kind regards,
Talal


On 2 Oct 2010, at 23:23, Talal Al-Azem wrote:

Dear all,

This is important for anyone working with mixed language (font) texts. In my example,  the overall document is Latin-based (e.g. English), with a paragraph of Arabic text; I want this Arabic paragraph as a whole to fit onto the grid (though obviously the individual Arabic lines of the paragraph would not).

Currently, when I typeset an English paragraph, followed by an Arabic paragraph, followed by an English paragraph, the second English paragraph is no longer on the grid, having been throw off by the Arabic one. I'm looking for some way to automatically calculate and fill in the vspace needed for this.

This is not the same as the issue of an Arabic word or phrase (or mathematic formula) being typeset in the midst of Latin text, as discussed http://www.mail-archive.com/ntg-context@ntg.nl/msg46163.html. Having read a few other matters on the mailing list (largely involving Idris and Hans), I'm sure it's possible, but I can't figure it out.

Any help would be most appreciated.

Kind regards,
Talal