ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Enumerating paragraphs
@ 2000-09-20  2:31 Guy Worthington
  2000-09-20  2:53 ` [Q] \inleft [was Re: Enumerating paragraphs] Hans Fredrik Nordhaug
  0 siblings, 1 reply; 10+ messages in thread
From: Guy Worthington @ 2000-09-20  2:31 UTC (permalink / raw)


Thanks Ed L Cashin for your solution.  I had read section 12
in the beginner's manual but it takes an especially devious mind to
invent a wrapper macro around the paragraph formatting macro.  Your
reference to the Count was much more obvious (I guess I watch too much
Sesame St.).

Thanks Hans Hagen for your reply.  I'm continually amazed at what
you've packed into ConTeXt, the \inleft command is exactly what I
want.


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

* [Q] \inleft [was Re: Enumerating paragraphs]
  2000-09-20  2:31 Enumerating paragraphs Guy Worthington
@ 2000-09-20  2:53 ` Hans Fredrik Nordhaug
  2000-09-20  8:16   ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Fredrik Nordhaug @ 2000-09-20  2:53 UTC (permalink / raw)


On 20 Sep 2000, Guy Worthington wrote:

> Thanks Hans Hagen for your reply.  I'm continually amazed at what
> you've packed into ConTeXt, the \inleft command is exactly what I
> want.

Hi, a newbie question coming up:

Is there any difference between \inleft and \llap?
If not, is there a lot of commands in ConTeXt that just are wrappers
around plain TeX commands? [Anyway \inleft was a good name.]

Regards Hans Fredrik,

--------------------------------------------------------------------------
   Hans Fredrik Nordhaug       | web:    www.mi.uib.no/~hansfn   
    Ph.D. student at           | phone:    (+47) 55 58 48 79       
    Department of Mathematics, | fax:      (+47) 55 58 96 72       
    University of Bergen       | e-mail:    hanfn@mi.uib.no      
--------------------------------------------------------------------------
   Fall 2000: Visiting at the Department of Civil Engineering,
                        Princeton University.
--------------------------------------------------------------------------


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

* Re: [Q] \inleft [was Re: Enumerating paragraphs]
  2000-09-20  2:53 ` [Q] \inleft [was Re: Enumerating paragraphs] Hans Fredrik Nordhaug
@ 2000-09-20  8:16   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2000-09-20  8:16 UTC (permalink / raw)
  Cc: ConTeXt

At 10:53 PM 9/19/00 -0400, Hans Fredrik Nordhaug wrote:
>On 20 Sep 2000, Guy Worthington wrote:
>
>> Thanks Hans Hagen for your reply.  I'm continually amazed at what
>> you've packed into ConTeXt, the \inleft command is exactly what I
>> want.
>
>Hi, a newbie question coming up:
>
>Is there any difference between \inleft and \llap?
>If not, is there a lot of commands in ConTeXt that just are wrappers
>around plain TeX commands? [Anyway \inleft was a good name.]

Concerning \llap, that plain one is reimplemented (liek a few more) to be
more robust in tricky situations. 

Concerning \inleft, this is definitely a different command, since it takes
care of proper placement with regards to the left margin distance; the
\inleft \inright \inmargin \margintitle commands take multiples lines and
go to a far extend to align properly; \margintitle also stacks marginal
things that can then be placed at given locations with given characteristics 

[some more margin trickery is in beta stage here, esp proper alignment with
math formulas]

Concerning plain wrappers, i never counted the lines, but context is
written mostly from scratch (for me it was the only way to learn tex),
plain is there for as far as useful, and most of plain is low level stuff
needed for math and basic housekeeping; if you look in syst-tex, you will
notice that I bypass some plain defs [overloading] like fonts. 

BTW, plain tex in itself does not offer much typo things. I used to load
the etex format too, but now I just implement the additional register
things myself and the rest is not needed anyway. For some users it's
comfortable to have the plain stuff available, so i leave it there.   

Hans  
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      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
-------------------------------------------------------------------------


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

* Re: enumerating paragraphs
  2001-11-11 12:27 ` Patrick Gundlach
@ 2001-11-12  9:29   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2001-11-12  9:29 UTC (permalink / raw)
  Cc: ntg-context

At 01:27 PM 11/11/2001 +0100, Patrick Gundlach wrote:
>Hi!
>
> > How can I enumerate paragraphs? They should simply look like
> >
> > (1) sometext
> > for this para.
> >
> > (2) and some
> > for this
> > para
> >
> > (X) ...
> > ....
>
>Is this something you want?
>\starttext
>\defineconversion[map][(\numbers]
>\startitemize[map,intext][stopper=)]
>\item \input tufte
>\item \input tufte
>\item \input tufte
>\stopitemize
>\stoptext
>
>Patrick, who is getting closer every day to become a MOI (master of itemize)

then, how about: \setupparagraphnumbering[state=start]

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


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

* Re: enumerating paragraphs
  2001-11-09 18:06 enumerating paragraphs Mathias.Picker
@ 2001-11-11 12:27 ` Patrick Gundlach
  2001-11-12  9:29   ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Patrick Gundlach @ 2001-11-11 12:27 UTC (permalink / raw)


Hi!

> How can I enumerate paragraphs? They should simply look like
>
> (1) sometext
> for this para.
>
> (2) and some
> for this
> para
>
> (X) ...
> ....

Is this something you want?
\starttext
\defineconversion[map][(\numbers]
\startitemize[map,intext][stopper=)]
\item \input tufte
\item \input tufte
\item \input tufte
\stopitemize
\stoptext

Patrick, who is getting closer every day to become a MOI (master of itemize)


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

* enumerating paragraphs
@ 2001-11-09 18:06 Mathias.Picker
  2001-11-11 12:27 ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Mathias.Picker @ 2001-11-09 18:06 UTC (permalink / raw)


How can I enumerate paragraphs? They should simply look like

(1) sometext
for this para.

(2) and some
for this
para

(X) ...
...

?? I tried to play with the itemize setups, but got nowhere. Any hints?

Thanks, Mathias
-- 
                            virtual earth
 Mathias Picker
 Geschäftsführer      Gesellschaft für Wissens re/prä sentation mbH

                            Mathias.Picker@virtual-earth.de 
			    Fon +49 89  / 540 7425-1
                            Fax +49 89  / 540 7425-9


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

* Re: Enumerating paragraphs
  2000-09-19 13:39 ` Ed L Cashin
@ 2000-09-19 14:36   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2000-09-19 14:36 UTC (permalink / raw)
  Cc: Guy Worthington, Context

At 09:39 AM 9/19/00 -0400, Ed L Cashin wrote:
>Guy Worthington <guyw@multiline.com.au> writes:
>
>> How do I number paragraphs (similar to the format used when
>> typesetting a module)?  I've had an unsuccessful attempt at
>> it (below).
>
>There's a section in the beginner's manual on paragraph formatting.
>There may be a cleaner way to do it, but here's an example based on
>the ones in the beginner's manual:
>
>  \newcount\paragraphno
>  \paragraphno=1
>  \defineparagraphs	[guypara][n=2,before={\blank},after={\blank}]
>  \setupparagraphs	[guypara][1][width=.1\textwidth,style=bold]
>  \def\GuyPar#1{\startguypara
>          \the\paragraphno
>          \global\advance\paragraphno by 1
>          \guypara#1\stopguypara}
>  
>  \starttext
>  \GuyPar{This is the first paragraph.}
>  \GuyPar{This is the second paragraph.}
>  \GuyPar{Three!!!  Three paragraphs!!!  Ah -- ah -- ah -- ahh!!!.}
>  \stoptext

btw, if you're talking about not too large paragrapgs, you may consider
using the \startnumbering mechanism which supports line and para numbering. 

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      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
-------------------------------------------------------------------------


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

* Re: Enumerating paragraphs
  2000-09-19 11:16 Enumerating paragraphs Guy Worthington
  2000-09-19 13:39 ` Ed L Cashin
@ 2000-09-19 14:31 ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2000-09-19 14:31 UTC (permalink / raw)
  Cc: Context

At 07:16 PM 9/19/00 +0800, Guy Worthington wrote:

>\newcount\paragraphno    % enumerate paragraphs
>\def\paragraph#1\par{\advance\paragraphno by 1
>    \llap{\sl \the\paragraphno\kern1pc}#1\par}%  number to left of text
>
>\setupbodyfont[ber,10pt]
>\setupwhitespace[big]
>
>\starttext
>
>\section[sec-language]{How this Book Teaches You The Language}
>
>\paragraph Java is an object oriented programming language.  When you
>use an object oriented programming language, your program consists of
>class definitions.
>
>\stoptext

\newcounter\ParNum

\def\paragraph{\doglobal\increment\ParNum\inleft{\ParNum}}

So, \inleft \inleftmargin \margintitle are the commands to use since they
also honor the margindistance and so. You can even say: 

\margintitle{\NextPar} 

some text 

with \def\NextPar{\doglobal\increment\ParNum\ParNum}

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      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
-------------------------------------------------------------------------


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

* Re: Enumerating paragraphs
  2000-09-19 11:16 Enumerating paragraphs Guy Worthington
@ 2000-09-19 13:39 ` Ed L Cashin
  2000-09-19 14:36   ` Hans Hagen
  2000-09-19 14:31 ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Ed L Cashin @ 2000-09-19 13:39 UTC (permalink / raw)
  Cc: Context

Guy Worthington <guyw@multiline.com.au> writes:

> How do I number paragraphs (similar to the format used when
> typesetting a module)?  I've had an unsuccessful attempt at
> it (below).

There's a section in the beginner's manual on paragraph formatting.
There may be a cleaner way to do it, but here's an example based on
the ones in the beginner's manual:

  \newcount\paragraphno
  \paragraphno=1
  \defineparagraphs	[guypara][n=2,before={\blank},after={\blank}]
  \setupparagraphs	[guypara][1][width=.1\textwidth,style=bold]
  \def\GuyPar#1{\startguypara
          \the\paragraphno
          \global\advance\paragraphno by 1
          \guypara#1\stopguypara}

  \starttext
  \GuyPar{This is the first paragraph.}
  \GuyPar{This is the second paragraph.}
  \GuyPar{Three!!!  Three paragraphs!!!  Ah -- ah -- ah -- ahh!!!.}
  \stoptext

-- 
--Ed Cashin                     PGP public key:
  ecashin@coe.uga.edu           http://www.coe.uga.edu/~ecashin/pgp/


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

* Enumerating paragraphs
@ 2000-09-19 11:16 Guy Worthington
  2000-09-19 13:39 ` Ed L Cashin
  2000-09-19 14:31 ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Guy Worthington @ 2000-09-19 11:16 UTC (permalink / raw)


How do I number paragraphs (similar to the format used when
typesetting a module)?  I've had an unsuccessful attempt at
it (below).

\newcount\paragraphno    % enumerate paragraphs
\def\paragraph#1\par{\advance\paragraphno by 1
    \llap{\sl \the\paragraphno\kern1pc}#1\par}%  number to left of text

\setupbodyfont[ber,10pt]
\setupwhitespace[big]

\starttext

\section[sec-language]{How this Book Teaches You The Language}

\paragraph Java is an object oriented programming language.  When you
use an object oriented programming language, your program consists of
class definitions.

\stoptext


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

end of thread, other threads:[~2001-11-12  9:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-20  2:31 Enumerating paragraphs Guy Worthington
2000-09-20  2:53 ` [Q] \inleft [was Re: Enumerating paragraphs] Hans Fredrik Nordhaug
2000-09-20  8:16   ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2001-11-09 18:06 enumerating paragraphs Mathias.Picker
2001-11-11 12:27 ` Patrick Gundlach
2001-11-12  9:29   ` Hans Hagen
2000-09-19 11:16 Enumerating paragraphs Guy Worthington
2000-09-19 13:39 ` Ed L Cashin
2000-09-19 14:36   ` Hans Hagen
2000-09-19 14:31 ` 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).