ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [HELP] colored text marked by a caption and across multipages
@ 2006-09-29  9:52 Wei_Hu
  2006-10-04 10:58 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Wei_Hu @ 2006-09-29  9:52 UTC (permalink / raw)



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

Hi all,

<< 1 >>
First, I want to put source codes into my document.
I achieve this by using 'verbatim'

\starttyping
blah blah
\stoptyping

<< 2 >>
Then I decide to add colors for these source codes, so I use:

\starttyping[option=color,option=commands]
blah blah
<</color[red]....>>
blah blah
\stoptyping

<< 3 >>
Finally, I want to refer to this block of source codes in the rest 
document, so I use:

\placefloat[here][listing:sample]{Hello world}
\starttyping[option=color,option=commands]
blah blah
<</color[red]....>>
blah blah
\stoptyping

and refer to it by \in{}[] and \at{}[].

<< 1 >> & << 2 >> & << 3 >> work great, however, if the source codes are 
long enough, and doesn't fit into one page,
then the bottom of it will not display.

After searching this mailing list, I found some methods: \bTABLE, 
\starttextbackground ..etc...
But none of them can achieve this facility.

I can accomplish this facility though LaTeX as described in page 2 ~ page 
3 in the attached file.
(It uses listings package in LaTeX)

All I want is a colored source codes marked by a caption, and I can refe 
to that source code using \in{}[] or \at{}[] primitives.
Are there any ways in ConTeXt can achieve this?

Thanks.


************* Email Confidentiality Notice ********************

The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s).  Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person.   Thank you!


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

[-- Attachment #2: listingseg.pdf --]
[-- Type: application/octet-stream, Size: 100252 bytes --]

[-- Attachment #3: 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] 2+ messages in thread

* Re: [HELP] colored text marked by a caption and across multipages
  2006-09-29  9:52 [HELP] colored text marked by a caption and across multipages Wei_Hu
@ 2006-10-04 10:58 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2006-10-04 10:58 UTC (permalink / raw)



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

2006/9/29, Wei_Hu@mtk.com.tw <Wei_Hu@mtk.com.tw>:
>
>
> Hi all,
>
> << 1 >>
> First, I want to put source codes into my document.
> I achieve this by using 'verbatim'
>
> \starttyping
> blah blah
> \stoptyping
>
> << 2 >>
> Then I decide to add colors for these source codes, so I use:
>
> \starttyping[option=color,option=commands]
> blah blah
> <</color[red]....>>
> blah blah
> \stoptyping
>
> << 3 >>
> Finally, I want to refer to this block of source codes in the rest
> document, so I use:
>
> \placefloat[here][listing:sample]{Hello world}
> \starttyping[option=color,option=commands]
> blah blah
> <</color[red]....>>
> blah blah
> \stoptyping
>
> and refer to it by \in{}[] and \at{}[].
>
> << 1 >> & << 2 >> & << 3 >> work great, however, if the source codes are
> long enough, and doesn't fit into one page,
> then the bottom of it will not display.
>
> After searching this mailing list, I found some methods: \bTABLE,
> \starttextbackground ..etc...
> But none of them can achieve this facility.
>
> I can accomplish this facility though LaTeX as described in page 2 ~ page
> 3 in the attached file.
> (It uses listings package in LaTeX)
>
> All I want is a colored source codes marked by a caption, and I can refe
> to that source code using \in{}[] or \at{}[] primitives.
> Are there any ways in ConTeXt can achieve this?
>
> Thanks.



You can find a very simple but working example in my attached file.

Wolfgang

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

[-- Attachment #2: listing.tex --]
[-- Type: application/x-tex, Size: 5960 bytes --]

[-- Attachment #3: 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] 2+ messages in thread

end of thread, other threads:[~2006-10-04 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29  9:52 [HELP] colored text marked by a caption and across multipages Wei_Hu
2006-10-04 10:58 ` Wolfgang Schuster

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