ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Dropped caps, \startlines\stoplines, and indentation question
@ 2006-01-22  4:08 Adrian Drury
  2006-01-25 19:59 ` Radhelorn
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Drury @ 2006-01-22  4:08 UTC (permalink / raw)


Hello,

I'm having trouble using dropped caps within \startlines\stoplines.
I'm trying to typeset some poetry and I'm using
\setuplines[space=yes]. I'd like to use dropped caps and have the
indented lines be additionally indented by any space at the beginning
of the lines.

See the following example - the first part shows roughly the result I
want (but with manual formatting/spacing), the second part shows the
result of \DroppedCaps inside \startlines\stoplines, and the third
part uses the lettrine module. The lettrine module comes close, but
Nindent doesn't seem to affect the indented lines within
\startlines\stoplines.

\usemodule[lettrine]
\def\MyDroppedCaps%
{	\DroppedCaps
        {} {Serif} {2\baselineskip} {2pt} {1\baselineskip} {2}
}
\setuplines[space=yes]

\starttext
\MyDroppedCaps S{\sc umer} is icumen in,\crlf
\hbox to .6em{}Lhude sing cuccu!\crlf
Groweth sed, and bloweth med,\crlf
\hbox to .6em{}And springth the wude nu---\crlf
\hbox to 3.3em{}Sing cuccu!

\startlines
\MyDroppedCaps S{\sc umer} is icumen in,
  Lhude sing cuccu!
Groweth sed, and bloweth med,
  And springth the wude nu---
          Sing cuccu!
\stoplines

\startlines
\lettrine{S}{umer} is icumen in,
  Lhude sing cuccu!
Groweth sed, and bloweth med,
  And springth the wude nu---
          Sing cuccu!
\stoplines
\stoptext

Any suggestions for how to do this? I'm a beginning ConTeXt user, so
if there's a better/different way to do this, I'd be happy to hear it!

Also, I read the list in digest form. For the benefit of people using
threaded mail readers, is there a better way to reply to individual
messages than replying to the digest message and editing the Subject
line appropriately?

Thanks very much,
Adrian Drury

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Dropped caps, \startlines\stoplines, and indentation question
  2006-01-22  4:08 Dropped caps, \startlines\stoplines, and indentation question Adrian Drury
@ 2006-01-25 19:59 ` Radhelorn
  0 siblings, 0 replies; 4+ messages in thread
From: Radhelorn @ 2006-01-25 19:59 UTC (permalink / raw)


Adrian Drury wrote:
> Hello,
> 
> I'm having trouble using dropped caps within \startlines\stoplines.
> I'm trying to typeset some poetry and I'm using
> \setuplines[space=yes]. I'd like to use dropped caps and have the
> indented lines be additionally indented by any space at the beginning
> of the lines.
> 
> See the following example - the first part shows roughly the result I
> want (but with manual formatting/spacing), the second part shows the
> result of \DroppedCaps inside \startlines\stoplines, and the third
> part uses the lettrine module. The lettrine module comes close, but
> Nindent doesn't seem to affect the indented lines within
> \startlines\stoplines.
> 
> \usemodule[lettrine]
> \def\MyDroppedCaps%
> {	\DroppedCaps
>         {} {Serif} {2\baselineskip} {2pt} {1\baselineskip} {2}
> }
> \setuplines[space=yes]
> 
> \starttext
> \MyDroppedCaps S{\sc umer} is icumen in,\crlf
> \hbox to .6em{}Lhude sing cuccu!\crlf
> Groweth sed, and bloweth med,\crlf
> \hbox to .6em{}And springth the wude nu---\crlf
> \hbox to 3.3em{}Sing cuccu!
> 
> \startlines
> \MyDroppedCaps S{\sc umer} is icumen in,
>   Lhude sing cuccu!
> Groweth sed, and bloweth med,
>   And springth the wude nu---
>           Sing cuccu!
> \stoplines
> 
> \startlines
> \lettrine{S}{umer} is icumen in,
>   Lhude sing cuccu!
> Groweth sed, and bloweth med,
>   And springth the wude nu---
>           Sing cuccu!
> \stoplines
> \stoptext
> 
> Any suggestions for how to do this? I'm a beginning ConTeXt user, so
> if there's a better/different way to do this, I'd be happy to hear it!
> 
> Also, I read the list in digest form. For the benefit of people using
> threaded mail readers, is there a better way to reply to individual
> messages than replying to the digest message and editing the Subject
> line appropriately?
> 
> Thanks very much,
> Adrian Drury
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

Try

\startlines
\vbox{\lettrine{S}{umer} is icumen in,\crlf Lhude sing cuccu!}
  Groweth sed, and bloweth med,
    And springth the wude nu---
            Sing cuccu!
\stoplines



-- 
Radhelorn <radhelorn@mail.ru>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Dropped caps, \startlines\stoplines, and indentation question
  2006-01-29  1:50 Adrian Drury
@ 2006-01-29 17:59 ` Taco Hoekwater
  0 siblings, 0 replies; 4+ messages in thread
From: Taco Hoekwater @ 2006-01-29 17:59 UTC (permalink / raw)


Adrian Drury wrote:
> Is there a way to calculate the width of some number of characters (or a 
> string of characters) to use as a dimension parameter? For example, a 
> macro that returns the width in points of 5 space characters in the 
> current font? I figured hardcoding the width of a space as a percentage 
> of an em might work, but would probably not be consistent across fonts. 
> Is that true, or is it really that simple?

That would break now and then. Here is how you get the natural
size of a space:

   \setbox0=\hbox{ }

now \wd0 (the WiDth of box 0) is the 'natural' width of a space.
But note that this is not 100% accurate in normal typesetting,
because TeX adjusts spaces when needed for justification.
Anyway, after this \setbox command,

    5\wd0

is the width of five spaces, etc.

Chees, taco

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Dropped caps, \startlines\stoplines, and indentation question
@ 2006-01-29  1:50 Adrian Drury
  2006-01-29 17:59 ` Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Drury @ 2006-01-29  1:50 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 3690 bytes --]

Radhelorn wrote:

>
> Adrian Drury wrote:
> > Hello,
> >
> > I'm having trouble using dropped caps within \startlines\stoplines.
> > I'm trying to typeset some poetry and I'm using
> > \setuplines[space=yes]. I'd like to use dropped caps and have the
> > indented lines be additionally indented by any space at the beginning
> > of the lines.
> >
> > See the following example - the first part shows roughly the result I
> > want (but with manual formatting/spacing), the second part shows the
> > result of \DroppedCaps inside \startlines\stoplines, and the third
> > part uses the lettrine module. The lettrine module comes close, but
> > Nindent doesn't seem to affect the indented lines within
> > \startlines\stoplines.
> >
> > \usemodule[lettrine]
> > \def\MyDroppedCaps%
> > {     \DroppedCaps
> >         {} {Serif} {2\baselineskip} {2pt} {1\baselineskip} {2}
> > }
> > \setuplines[space=yes]
> >
> > \starttext
> > \MyDroppedCaps S{\sc umer} is icumen in,\crlf
> > \hbox to .6em{}Lhude sing cuccu!\crlf
> > Groweth sed, and bloweth med,\crlf
> > \hbox to .6em{}And springth the wude nu---\crlf
> > \hbox to 3.3em{}Sing cuccu!
> >
> > \startlines
> > \MyDroppedCaps S{\sc umer} is icumen in,
> >   Lhude sing cuccu!
> > Groweth sed, and bloweth med,
> >   And springth the wude nu---
> >           Sing cuccu!
> > \stoplines
> >
> > \startlines
> > \lettrine{S}{umer} is icumen in,
> >   Lhude sing cuccu!
> > Groweth sed, and bloweth med,
> >   And springth the wude nu---
> >           Sing cuccu!
> > \stoplines
> > \stoptext
> >
> > Any suggestions for how to do this? I'm a beginning ConTeXt user, so
> > if there's a better/different way to do this, I'd be happy to hear it!
> >
> > Also, I read the list in digest form. For the benefit of people using
> > threaded mail readers, is there a better way to reply to individual
> > messages than replying to the digest message and editing the Subject
> > line appropriately?
> >
> > Thanks very much,
> > Adrian Drury
> > _______________________________________________
> > ntg-context mailing list
> > ntg-context@ntg.nl
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> >
> >
>
> Try
>
> \startlines
> \vbox{\lettrine{S}{umer} is icumen in,\crlf Lhude sing cuccu!}
>   Groweth sed, and bloweth med,
>     And springth the wude nu---
>             Sing cuccu!
> \stoplines
>
> --
> Radhelorn < radhelorn@mail.ru>
>

Thank you very much for your suggestion - it does most of what I want to do.
I have a follow-up question if anybody would like to provide more help!

Because lines in \startlines\stoplines with \setuplines[space=yes] can be
indented by space characters, I want to set Nindent for the dropped cap to
(N * <width of space character>), so lines can be indented by the exact same
amount they would be with spaces in \startlines\stoplines.

Is there a way to calculate the width of some number of characters (or a
string of characters) to use as a dimension parameter? For example, a macro
that returns the width in points of 5 space characters in the current font?
I figured hardcoding the width of a space as a percentage of an em might
work, but would probably not be consistent across fonts. Is that true, or is
it really that simple?

I'd also be happy with a way to preserve spaces in the text inside the vbox
(and ignore any Nindent dimension calculation), because then I could just
add the appropriate number of spaces for indentation after the \crlf, like
this: \vbox{\lettrine{S}{umer} is icumen in,\crlf <2 spaces>Lhude sing
cuccu!}, as I do in \startlines\stoplines.

Thanks very much,
Adrian Drury

[-- Attachment #1.2: Type: text/html, Size: 4786 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-29 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-22  4:08 Dropped caps, \startlines\stoplines, and indentation question Adrian Drury
2006-01-25 19:59 ` Radhelorn
2006-01-29  1:50 Adrian Drury
2006-01-29 17:59 ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).