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}{\newdim...@tempdimc}{} 
\newenvironment{gridblock}{\par 
  \setb...@tempboxa\vtop\bgroup 
}{\par\egroup 
  % measurements of top 
  \...@tempdima=\ht\@tempboxa 
  \...@tempdimc=\dp\@tempboxa 
  \ifd...@tempdima>\ht\strutbox 
    \advan...@tempdimc\@tempdima 
    \...@tempdima=\ht\strutbox 
    \advan...@tempdimc-\@tempdima 
  \fi 
  % measurements of bottom 
  \setb...@tempboxa\vbox{\unvbox\@tempboxa}% 
  \ifdim\...@tempboxa>\dp\strutbox 
    \...@tempdimb=\dp\strutbox 
  \else 
    \...@tempdimb=\dp\@tempboxa 
  \fi 
 \advan...@tempdimc-\@tempdimb 
  \...@tempcnta=\@tempdimc 
  \divi...@tempcnta\baselineskip 
  \advan...@tempdimc -...@tempcnta\baselineskip 
  \ifd...@tempdimc >2\vfuzz \advan...@tempdimc-\baselineskip \fi 
  \divi...@tempdimc\tw@ 
  \vbox t...@tempdima{}% 
  \nobreak \nointerlineskip \ker...@tempdima \ker...@tempdimc \nobreak 
  \b...@tempboxa 
  \nobreak \nointerlineskip \ker...@tempdimb \ker...@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}{\newdim...@tempdimc}{} 
> \newenvironment{gridblock}{\par 
>   \setb...@tempboxa\vtop\bgroup 
> }{\par\egroup 
>   % measurements of top 
>   \...@tempdima=\ht\@tempboxa 
>   \...@tempdimc=\dp\@tempboxa 
>   \ifd...@tempdima>\ht\strutbox 
>     \advan...@tempdimc\@tempdima 
>     \...@tempdima=\ht\strutbox 
>     \advan...@tempdimc-\@tempdima 
>   \fi 
>   % measurements of bottom 
>   \setb...@tempboxa\vbox{\unvbox\@tempboxa}% 
>   \ifdim\...@tempboxa>\dp\strutbox 
>     \...@tempdimb=\dp\strutbox 
>   \else 
>     \...@tempdimb=\dp\@tempboxa 
>   \fi 
>  \advan...@tempdimc-\@tempdimb 
>   \...@tempcnta=\@tempdimc 
>   \divi...@tempcnta\baselineskip 
>   \advan...@tempdimc -...@tempcnta\baselineskip 
>   \ifd...@tempdimc >2\vfuzz \advan...@tempdimc-\baselineskip \fi 
>   \divi...@tempdimc\tw@ 
>   \vbox t...@tempdima{}% 
>   \nobreak \nointerlineskip \ker...@tempdima \ker...@tempdimc \nobreak 
>   \b...@tempboxa 
>   \nobreak \nointerlineskip \ker...@tempdimb \ker...@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
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to