[XeTeX] XeTex and Tibetan full justification

Daniel Muller x01dev at yahoo.fr
Tue Apr 19 21:44:24 CEST 2005

> > Thanks for the example, the second macro of \line{} gives the proper 
> > results, except that the fill
> > should occur only with a shad+space like "some Tibetan text| |other 
> > text", "some text| text" or
> > "some text ga |text", but not in "some text|| ||".
> OK.... trickier, but it ought to be possible. There isn't much that 
> *can't* be done by a sufficiently determined TeX programmer!

Tex programmer of course! I'm Java and C++ programmer, at the first look
Tex seems rather different than "normal or standard" languages!
> > I would like to undestand how the macro works and modify according to 
> > the rules above:
> >
> > % version of \line that pads with space after \shad, or with \tsheg on 
> > the right if no \shad
> > present
> > \catcode\shad=\active
> > \def^^^^0f0d{\advance\shadfound by 1 \shad\hskip1sp plus 1fil}
> > \newcount\shadfound
> > \def\line#1{\shadfound=0
> >   \hbox to \hsize{#1\ifnum\shadfound=0 
> > \unskip\leaders\hbox{\tsheg\kern.05em}\hfil
> >   \else \skip0=\lastskip \unskip \ifdim\skip0=1sp \advance\shadfound 
> > by -1 \fi
> >     \ifnum \shadfound=0 \hfill \fi \fi}}
> >
> > Where can I find a good reference on the web how to program in LaTex?
> (Be aware that you're in for a steep learning curve.)

Thanks for the advice!
Is a debugger a common tool in Tex/LaTex programming?

> >
> > For sure I will replace it with \tibetanline{} macro.
> >
> > I'm wondering about one little things, my text is about 573 pages or 
> > 12000 lines, is it efficent
> > to use a macro in that case or should we implement that Tibetan 
> > justification differently?
> Well, the first question to consider is whether this is a text with 
> predetermined line breaks, or one where you want TeX to find the 
> optimal line-breaks in each paragraph (as it normally does).

Lines are predetermined: the works are part of a Tibetan Data Input project
(medical texts): already typed, corrected and proofread. I have to generate pdf
files of those works with the same pagination, but not necessary the same
page layout, so page and line breaks are predetermined.

> If the line breaks are fixed, then it should be possible to use 
> \everypar to automatically apply an appropriate macro (yes, that's a 
> perfectly reasonable thing to do) to each line of the text (with 
> \obeylines, so that each input line is considered a separate 
> paragraph).

What about the headers and footers, are they paragraphs?

> If you want normal line-breaking of paragraphs, and then special the 
> justification behavior applied to the resulting lines, that'll be 
> harder.... I'm imagining schemes that involve unpacking and 
> re-justifying each line of a paragraph, after the normal paragraph 
> builder has done its work. Sounds like a job for a real TeX macro 
> wizard.
> Sorry, I don't think I have time to try and put together a complete 
> implementation of all this at the moment; it's considerably more than a 
> few minutes of work (at least, it sounds like it to me).

I will not ask you to make it, I just need some guidances and mainly where to
start as I'm new in Tex/LaTex but experienced software engineer.


Do you Yahoo!? 
Plan great trips with Yahoo! Travel: Now over 17,000 guides!

More information about the XeTeX mailing list