Am 16.12.2011 um 17:53 schrieb Chris Lott: > On Fri, Dec 16, 2011 at 12:00 AM, Hans Hagen <pra...@wxs.nl> wrote: >>>>> I've seen some discussion about creating a verse environment in ConTeXt >>>>> that handles the alignment of long (broken) lines of text. But I can't >>>>> find >>>>> anything about optical centering as can be done in LaTeX using the gmverse >>>>> package: http://www.ctan.org/pkg/gmverse >>>>> >>>>> Is there something like this available for ConTeXt? >>>> >>>> >>>> Can you make a PDF where we can see what do you want? >> >> >> That's just a bunch of macro code ... what Wolfgang meant was output that >> you want to see. Writing from scratch fo rwhat you need is easier that >> deciphering macro code. > > My apologies, this is what I meant to link to, a TUGboat article which > has both the formulae for calculating the center and visual > illustrations of the resulting centering: > www.tug.org/TUGboat/tb29-1/tb91murzynowski-text.pdf > > The package provides three things, in descending order of importance for me: > > * optical centering, which is a calculation of the center point for > the alignment of the box of text that is based on based on an average > of the line lengths of the work being set. gmverse provides four > different possible centering methods based on different formulae (if > it matters, method 3 and 2 are most useful.
Centered text based on the longest line is simple but when it’s better to make this a feature of the lines environment. \def\startverse {\begingroup \dostartbuffer[versecontent][startverse][stopverse]} \def\stopverse {\setbox\scratchbox\hbox\bgroup\framed[width=fit,align=right]\bgroup \startlines \getbuffer[versecontent] \stoplines \egroup\egroup \leftskip\the\dimexpr(\textwidth-\wd\scratchbox)/2\relax \startlines \getbuffer[versecontent] \stoplines \endgroup} \starttext \showframe \startverse ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \stoptext > * Alignment of broken lines, right-aligned to the length of the line > above the break I guess Hans can do this when he provides a setting similar to “align=last”. > * An environment that needs no use of \\ to break lines, but does so > based on the length of the line and automatically wraps long lines (as > defined by a dimension) and uses the alignment above. This is more or less what the lines environment does. \startlines line 1 line 2 … \stoplines Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________