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?
c
--
Chris Lott
Am 16.12.2011 um 02:31 schrieb Chris Lott:
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? Wolfgang
On Thu, Dec 15, 2011 at 8:22 PM, Wolfgang Schuster
Am 16.12.2011 um 02:31 schrieb Chris Lott:
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?
The documentation for the gmverse package probably explains it better than I can. Here's a direct link: http://mirror.ctan.org/macros/latex/contrib/gmverse/gmverse.pdf Thanks! c -- Chris Lott
On 16-12-2011 08:11, Chris Lott wrote:
On Thu, Dec 15, 2011 at 8:22 PM, Wolfgang Schuster
wrote: Am 16.12.2011 um 02:31 schrieb Chris Lott:
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?
The documentation for the gmverse package probably explains it better than I can. Here's a direct link: http://mirror.ctan.org/macros/latex/contrib/gmverse/gmverse.pdf
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. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Fri, Dec 16, 2011 at 12:00 AM, Hans Hagen
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.
* Alignment of broken lines, right-aligned to the length of the line
above the break
* 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.
I have no idea if the way the package is written is overly complicated
for what it does... I don't really understand the code nearly well
enough, I just know that it works!
Thanks for any input. I can keep using LaTeX for this work, but when I
switch technologies, I tend to learn it by trying to move everything
to it (having recently switched from emacs to vim comes to mind :)
c
--
Chris Lott
Am 16.12.2011 um 17:53 schrieb Chris Lott:
On Fri, Dec 16, 2011 at 12:00 AM, Hans Hagen
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
On Fri, Dec 16, 2011 at 8:26 AM, Wolfgang Schuster
Centered text based on the longest line is simple but when it’s better to make this a feature of the lines environment.
Yeah, but it *isn't* based on the longest line, but on an average of
line length. I guess that's why it is call...well, except for the
first example in the doc provided, which is what I think your code
does.
Though the code you provided is very useful, so thanks!
c
--
Chris Lott
Am 16.12.2011 um 18:37 schrieb Chris Lott:
On Fri, Dec 16, 2011 at 8:26 AM, Wolfgang Schuster
wrote: Centered text based on the longest line is simple but when it’s better to make this a feature of the lines environment.
Yeah, but it *isn't* based on the longest line, but on an average of line length. I guess that's why it is call...well, except for the first example in the doc provided, which is what I think your code does.
Though the code you provided is very useful, so thanks!
I showed only it’s not so hard to achieve this feature but with a more complex solution where you check the width of each line you can use different values for the margins. Wolfgang
On 16-12-2011 19:26, Wolfgang Schuster wrote:
Am 16.12.2011 um 18:37 schrieb Chris Lott:
On Fri, Dec 16, 2011 at 8:26 AM, Wolfgang Schuster
wrote: Centered text based on the longest line is simple but when it’s better to make this a feature of the lines environment.
Yeah, but it *isn't* based on the longest line, but on an average of line length. I guess that's why it is call...well, except for the first example in the doc provided, which is what I think your code does.
Though the code you provided is very useful, so thanks!
I showed only it’s not so hard to achieve this feature but with a more complex solution where you check the width of each line you can use different values for the margins.
A teaser for Wolfgang (a few more status dimens in the latest): \definesystemvariable{zv} \def\startverse[#1]% {\begingroup \getparameters[\??zv][\c!align=,#1]% \dostartbuffer[versecontent][startverse][stopverse]} \setvalue{\??zv:\v!flushleft }{\raggedright} \setvalue{\??zv:\v!flushright}{\raggedleft} \setvalue{\??zv:\v!left }{\raggedleft} \setvalue{\??zv:\v!right }{\raggedright} \setvalue{\??zv:\v!middle }{\raggedcenter} \setvalue{\??zv:\v!min }{\leftskip\the\dimexpr(\textwidth-\framedminwidth)/2\relax} \setvalue{\??zv:\v!max }{\leftskip\the\dimexpr(\textwidth-\framedmaxwidth)/2\relax} \setvalue{\??zv:\v!medium }{\leftskip\the\dimexpr(\textwidth-\framedaveragewidth)/2\relax} \def\stopverse {\setbox\scratchbox\hbox\bgroup\framed[width=fit,align=right]\bgroup \startlines \getbuffer[versecontent] \stoplines \egroup\egroup \getvalue{\??zv:\@@zvalign}% \startlines \getbuffer[versecontent] \stoplines \endgroup} % \protect \starttext \showframe \startverse[align=flushleft] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \startverse[align=flushright] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \startverse[align=middle] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \startverse[align=min] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \startverse[align=max] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \startverse[align=medium] ASM rządzi dioda świeci miodowo chrząszcz chrzęści w czcionkach. \stopverse \stoptext I'll think about a pluggable special line alignment in th emain text stream (would be multipass). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Chris Lott
-
Hans Hagen
-
Wolfgang Schuster