ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* problem: long descriptions
@ 2002-11-09  8:06 Zeljko Vrba
  2002-11-09 17:23 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Zeljko Vrba @ 2002-11-09  8:06 UTC (permalink / raw)



Hi! I'm writing reference manual for a C/C++ library and I have the
following problem: When I define a description, long prototypes are not
line-broken. For example, I've set up

\definedescription
  [methref]
  [location=top,headstyle=\tt]

When I have
\startmethref{a very long prototype.........................}
blah blah blah
\stopmethref

the argument is not line-broken and it goes out of the page boundary. The
text shows properly only in the next line. I have something like the following
in mind, but I don't know how to do it:

I'd like the typeset layout to look something like this

a very long prototype proto..  Text describing the method
proto proto proto proto proto  Text describing the method
proto proto                    Text describinb the method
More text describing the method. More text. More text
More text.

Prototype may be framed. The text widths should be 0.5 and 0.5 of textwidth
for both the prototype and the description.

I hope you understood what I want :) I was thinking something like typesetting
prototype in the box and then using floating mechanism (\startXXXleft, would
that work at all?), but is there a more straightforward way?

Another unrelated question: is there a bold typewriter (CM) font somewhere?

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

* Re: problem: long descriptions
  2002-11-09  8:06 problem: long descriptions Zeljko Vrba
@ 2002-11-09 17:23 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2002-11-09 17:23 UTC (permalink / raw)


At 09:06 AM 11/9/2002 +0100, you wrote:

>Hi! I'm writing reference manual for a C/C++ library and I have the
>following problem: When I define a description, long prototypes are not
>line-broken. For example, I've set up
>
>\definedescription
>   [methref]
>   [location=top,headstyle=\tt]
>
>When I have
>\startmethref{a very long prototype.........................}
>blah blah blah
>\stopmethref
>
>the argument is not line-broken and it goes out of the page boundary. The
>text shows properly only in the next line. I have something like the following
>in mind, but I don't know how to do it:
>
>I'd like the typeset layout to look something like this
>
>a very long prototype proto..  Text describing the method
>proto proto proto proto proto  Text describing the method
>proto proto                    Text describinb the method
>More text describing the method. More text. More text
>More text.
>
>Prototype may be framed. The text widths should be 0.5 and 0.5 of textwidth
>for both the prototype and the description.
>
>I hope you understood what I want :) I was thinking something like typesetting
>prototype in the box and then using floating mechanism (\startXXXleft, would
>that work at all?), but is there a more straightforward way?

How about:

\definefloat[Prototype]
\setupfloat[Prototype][default={left,none}]

% default is a new parameter, you need a recent version fot this, else
% \placePrototype[left]{none}

\defineframedtext[Prototype][width=.5\textwidth,bodyfont=8pt]

\placePrototype\empty
\startPrototype
\input knuth
\stopPrototype
\input tufte

\def\StartPrototype{\placePrototype\empty\startPrototype}
\def\StopPrototype {\stopPrototype}

\StartPrototype
\input knuth
\StopPrototype
\input tufte

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

end of thread, other threads:[~2002-11-09 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-09  8:06 problem: long descriptions Zeljko Vrba
2002-11-09 17:23 ` Hans Hagen

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).