ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* referencing line numbers of a typing environment
@ 2003-04-05 18:12 Marko Schuetz
  2003-04-07 17:00 ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Marko Schuetz @ 2003-04-05 18:12 UTC (permalink / raw)


I usually present C/C++ code in a typing environment. If I need to
frequently reference statements I put a line number environment around
that. Now I would like to use line numbers and experimented a bit with 
\setuptyping[option=commands,escape=/], but did not yet get the
desired results.

Any hint is welcome

Thanks

Marko

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

* Re: referencing line numbers of a typing environment
  2003-04-05 18:12 referencing line numbers of a typing environment Marko Schuetz
@ 2003-04-07 17:00 ` Patrick Gundlach
  2003-04-07 17:35   ` Marko Schuetz
  0 siblings, 1 reply; 10+ messages in thread
From: Patrick Gundlach @ 2003-04-07 17:00 UTC (permalink / raw)


Marko Schuetz <MarkoSchuetz@web.de> writes:

Hi Marko,

> I usually present C/C++ code in a typing environment. If I need to
> frequently reference statements I put a line number environment around
> that. Now I would like to use line numbers and experimented a bit with 
> \setuptyping[option=commands,escape=/], but did not yet get the
> desired results.

what about this?

\starttext
\setuptyping[option=commands]

\startlinenumbering
\starttyping 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse
/startline[line:a]molestie, lorem nec tempor condimentum, enim pede sollicitudin
/blackrule ante,
non mollis est lectus et ligula. Integer at libero. Fusce sagittis
magna vel libero. Sed ut quam. /startline[line:b]Sed faucibus purus in sem. Phasellus ut

\stoptyping
\stoplinenumbering

See \inline [line:a] and \inline[line:b]
\stoptext



Patrick

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

* Re: Re: referencing line numbers of a typing environment
  2003-04-07 17:00 ` Patrick Gundlach
@ 2003-04-07 17:35   ` Marko Schuetz
  2003-04-07 18:22     ` Marko Schuetz
  0 siblings, 1 reply; 10+ messages in thread
From: Marko Schuetz @ 2003-04-07 17:35 UTC (permalink / raw)


Patrick,

From: Patrick Gundlach <pg@levana.de>
Subject: [NTG-context] Re: referencing line numbers of a typing environment
Date: Mon, 07 Apr 2003 19:00:10 +0200

[..]
> what about this?
> 
> \starttext
> \setuptyping[option=commands]
> 
> \startlinenumbering
> \starttyping 
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse
> /startline[line:a]molestie, lorem nec tempor condimentum, enim pede sollicitudin
> /blackrule ante,
> non mollis est lectus et ligula. Integer at libero. Fusce sagittis
> magna vel libero. Sed ut quam. /startline[line:b]Sed faucibus purus in sem. Phasellus ut
> 
> \stoptyping
> \stoplinenumbering
> 
> See \inline [line:a] and \inline[line:b]
> \stoptext


Yes, it works. I thought I had tried this, then noticed I had always
tested this within my project, product, and environment. Seems there
are some interferences... 

Thank you for the help.

Marko

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

* Re: Re: referencing line numbers of a typing environment
  2003-04-07 17:35   ` Marko Schuetz
@ 2003-04-07 18:22     ` Marko Schuetz
  2003-04-08 14:52       ` Marko Schuetz
  0 siblings, 1 reply; 10+ messages in thread
From: Marko Schuetz @ 2003-04-07 18:22 UTC (permalink / raw)


From: Marko Schuetz <MarkoSchuetz@web.de>
Subject: Re: [NTG-context] Re: referencing line numbers of a typing environment
Date: Mon, 07 Apr 2003 19:35:25 +0200 (CEST)

> Patrick,
> 
> From: Patrick Gundlach <pg@levana.de>
> Subject: [NTG-context] Re: referencing line numbers of a typing environment
> Date: Mon, 07 Apr 2003 19:00:10 +0200
> 
> [..]
> > what about this?
> > 
> > \starttext
> > \setuptyping[option=commands]
> > 
> > \startlinenumbering
> > \starttyping 
> > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse
> > /startline[line:a]molestie, lorem nec tempor condimentum, enim pede sollicitudin
> > /blackrule ante,
> > non mollis est lectus et ligula. Integer at libero. Fusce sagittis
> > magna vel libero. Sed ut quam. /startline[line:b]Sed faucibus purus in sem. Phasellus ut
> > 
> > \stoptyping
> > \stoplinenumbering
> > 
> > See \inline [line:a] and \inline[line:b]
> > \stoptext
> 
> 
> Yes, it works. I thought I had tried this, then noticed I had always
> tested this within my project, product, and environment. Seems there
> are some interferences... 

It's not my environment...

I narrowed it down to this

\starttext

\setuptyping[option=commands]
\starttyping
      cout << "Test!";
\stoptyping

\stoptext

This does not work here. TeX stops at a *-prompt.

Marko

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

* Re: Re: referencing line numbers of a typing environment
  2003-04-07 18:22     ` Marko Schuetz
@ 2003-04-08 14:52       ` Marko Schuetz
  2003-04-08 16:37         ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Marko Schuetz @ 2003-04-08 14:52 UTC (permalink / raw)


Just in case anyone else runs into the same problem.

From: Marko Schuetz <MarkoSchuetz@web.de>
Subject: Re: [NTG-context] Re: referencing line numbers of a typing environment
Date: Mon, 07 Apr 2003 20:22:50 +0200 (CEST)

> It's not my environment...
> 
> I narrowed it down to this
> 
> \starttext
> 
> \setuptyping[option=commands]
> \starttyping
>       cout << "Test!";
> \stoptyping
> 
> \stoptext
> 
> This does not work here. TeX stops at a *-prompt.

This works:

\starttext
\def\cout{<<}
\setuptyping[option=commands]
\starttyping 
    cout /cout "Test";
\stoptyping
\stoptext

and so does this:

\starttext
\starttyping
    cout << "Test";
\stoptyping
\stoptext

and also this: (where reserve.cpp contains <<)

\starttext
\setuptyping[option=commands]
\typefile{reserve.cpp}
\stoptext

but this does not work:

\starttext
\setuptyping[option=commands]
\starttyping
    cout << "Test";
\stoptyping
\stoptext



Marko

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

* Re: Re: referencing line numbers of a typing environment
  2003-04-08 14:52       ` Marko Schuetz
@ 2003-04-08 16:37         ` Hans Hagen
  2003-04-08 17:00           ` Marko Schuetz
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2003-04-08 16:37 UTC (permalink / raw)


At 16:52 08/04/2003 +0200, you wrote:
>Just in case anyone else runs into the same problem.
>
>From: Marko Schuetz <MarkoSchuetz@web.de>
>Subject: Re: [NTG-context] Re: referencing line numbers of a typing 
>environment
>Date: Mon, 07 Apr 2003 20:22:50 +0200 (CEST)
>
> > It's not my environment...
> >
> > I narrowed it down to this
> >
> > \starttext
> >
> > \setuptyping[option=commands]
> > \starttyping
> >       cout << "Test!";
> > \stoptyping
> >
> > \stoptext
> >
> > This does not work here. TeX stops at a *-prompt.
>
>This works:
>
>\starttext
>\def\cout{<<}
>\setuptyping[option=commands]
>\starttyping
>     cout /cout "Test";
>\stoptyping
>\stoptext
>
>and so does this:
>
>\starttext
>\starttyping
>     cout << "Test";
>\stoptyping
>\stoptext
>
>and also this: (where reserve.cpp contains <<)
>
>\starttext
>\setuptyping[option=commands]
>\typefile{reserve.cpp}
>\stoptext
>
>but this does not work:
>
>\starttext
>\setuptyping[option=commands]
>\starttyping
>     cout << "Test";
>\stoptyping
>\stoptext

this is a side effect:

option=commands =>

   <</bf bold>>

so, in commands mode the << and >> act as braces

option=slanted =>

   <<this comes out slanted>>

and here it does a font switch.

Maybe we need another option -)

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] 10+ messages in thread

* Re: Re: referencing line numbers of a typing environment
  2003-04-08 16:37         ` Hans Hagen
@ 2003-04-08 17:00           ` Marko Schuetz
  2003-04-08 17:49             ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Marko Schuetz @ 2003-04-08 17:00 UTC (permalink / raw)


From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [NTG-context] Re: referencing line numbers of a typing environment
Date: Tue, 08 Apr 2003 18:37:12 +0200

[..]
> this is a side effect:
> 
> option=commands =>
> 
>    <</bf bold>>
> 
> so, in commands mode the << and >> act as braces
> 
> option=slanted =>
> 
>    <<this comes out slanted>>
> 
> and here it does a font switch.

Ahh, I understand. Thank you.

> Maybe we need another option -)

I didn't find the "<< >> as braces" in the docs. IMHO mentioning it in
the docs would suffice.

Marko

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

* Re: referencing line numbers of a typing environment
  2003-04-08 17:00           ` Marko Schuetz
@ 2003-04-08 17:49             ` Patrick Gundlach
  0 siblings, 0 replies; 10+ messages in thread
From: Patrick Gundlach @ 2003-04-08 17:49 UTC (permalink / raw)


Marko Schuetz <MarkoSchuetz@web.de> writes:

Hello Hans, Marko,


>> Maybe we need another option -)

Yes, please :) I was playing with this yesterday, but couldn't think
of another name. Perhaps options=nogroups disables << and >>?

> I didn't find the "<< >> as braces" in the docs. IMHO mentioning it in
> the docs would suffice.

It is mentioned in the source ;-) and in cont-en?.pdf in chpater 5.8,
but under \type{} and not \starttyping

Patrick

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

* Re: referencing line numbers of a typing environment
  2003-04-07  5:45 Guy Worthington
@ 2003-04-16  7:56 ` Patrick Gundlach
  0 siblings, 0 replies; 10+ messages in thread
From: Patrick Gundlach @ 2003-04-16  7:56 UTC (permalink / raw)


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

Hi,

> Marko, I can't even get the documented example to work:
>
> -----
> \startbuffer
> \starttyping
> test//test test/BTEX \footnote{test test test}/ETEX test
> test//test test/BTEX \footnote{test test test}/ETEX  test
> test test test/BTEX \bf(nota bene)/ETEX test
> test test test /BTEX \bf(nota bene)/ETEX  test
> \stoptyping
> \stopbuffer
>
> \starttext
> \bgroup\setuptyping[option=commands]\getbuffer\egroup
> \stoptext 
> -----
>
> If you can't either, then either you or I are going to have to learn
> how to submit a bug report.

Go ahead :) 

IMO this should work.

Patrick

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

* Re: referencing line numbers of a typing environment
@ 2003-04-07  5:45 Guy Worthington
  2003-04-16  7:56 ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Guy Worthington @ 2003-04-07  5:45 UTC (permalink / raw)


Marko Schuetz <MarkoSchuetz@web.de> writes:

> I usually present C/C++ code in a typing environment. If I need to
> frequently reference statements I put a line number environment around
> that. Now I would like to use line numbers and experimented a bit with 
> \setuptyping[option=commands,escape=/], but did not yet get the
> desired results.
> 
> Any hint is welcome
> 

Marko, I can't even get the documented example to work:

-----
\startbuffer
\starttyping
test//test test/BTEX \footnote{test test test}/ETEX test
test//test test/BTEX \footnote{test test test}/ETEX  test
test test test/BTEX \bf(nota bene)/ETEX test
test test test /BTEX \bf(nota bene)/ETEX  test
\stoptyping
\stopbuffer

\starttext
\bgroup\setuptyping[option=commands]\getbuffer\egroup
\stoptext 
-----

If you can't either, then either you or I are going to have to learn
how to submit a bug report.

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

end of thread, other threads:[~2003-04-16  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-05 18:12 referencing line numbers of a typing environment Marko Schuetz
2003-04-07 17:00 ` Patrick Gundlach
2003-04-07 17:35   ` Marko Schuetz
2003-04-07 18:22     ` Marko Schuetz
2003-04-08 14:52       ` Marko Schuetz
2003-04-08 16:37         ` Hans Hagen
2003-04-08 17:00           ` Marko Schuetz
2003-04-08 17:49             ` Patrick Gundlach
2003-04-07  5:45 Guy Worthington
2003-04-16  7:56 ` Patrick Gundlach

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