ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to customize the default verbatim colors
@ 2005-08-24 23:55 Eugene Toporov
  2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
  2005-08-25 11:23 ` How to customize the default verbatim colors Taco Hoekwater
  0 siblings, 2 replies; 10+ messages in thread
From: Eugene Toporov @ 2005-08-24 23:55 UTC (permalink / raw)



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

Hi all!

I recently started using Verbatim Macroses to make source code pieces look 
prettier in my docs.
I use things like \setuptyping[JV] and then \startJV - \stopJV

But I'd like to change the default colors in the macroses to my own.

I only found that redefining some colors like this 
\definecolor [colorprettyone] [green]
\definecolor [colorprettytwo] [navy] 
\definecolor [colorprettythree] [r=0,g=0,b=.9]

makes effect, but that seems not very effective and affects all verbatims. 
1) I could not find all colors.
2) I need several different schemes (palettes) for different verbatims (XML, 
Java, SQL). 

I expect there is a way to redefine whole palette or something.

What's the easiest and the right way to do it?

Thanks in advance!

-- 
Eugene

[-- Attachment #1.2: Type: text/html, Size: 976 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] 10+ messages in thread

* Unable to make cont-en.fmt
  2005-08-24 23:55 How to customize the default verbatim colors Eugene Toporov
@ 2005-08-25  8:40 ` luigi.scarso
  2005-08-25  9:07   ` Taco Hoekwater
  2005-08-25  9:42   ` Vit Zyka
  2005-08-25 11:23 ` How to customize the default verbatim colors Taco Hoekwater
  1 sibling, 2 replies; 10+ messages in thread
From: luigi.scarso @ 2005-08-25  8:40 UTC (permalink / raw)


Hi, while installing latest pdftex 1.30.1 I have messed with some 
configs files
and now I am unable to remade format.
So
$> fmtutil --byfmt cont-en
gives

running `pdfetex -ini   -jobname=cont-en -progname=context -8bit 
*cont-en.ini' ...
This is pdfTeXk, Version 3.141592-1.30.1 (Web2C 7.5.5) (INITEX)
 %&-line parsing enabled.
! I can't find file `*cont-en.ini'.
<*> *cont-en.ini
               
Please type another input file name:
! Emergency stop.
<*> *cont-en.ini
               
No pages of output.
Transcript written on cont-en.log.
Error: `pdfetex -ini  -jobname=cont-en -progname=context -8bit 
*cont-en.ini' failed

###############################################################################
fmtutil: Error! Not all formats have been built successfully.
Visit the log files in directory
  /usr3/TeX/texmf-var/web2c
for details.
###############################################################################

This is a summary of all `failed' messages and warnings:
`pdfetex -ini  -jobname=cont-en -progname=context -8bit *cont-en.ini' failed

In file fmtutil.cnf there is the correct line :
cont-en pdfetex         cont-usr.tex    -8bit *cont-en.ini
(instead
cont-en pdfetex         cont-usr.tex    -8bit  cont-en.ini
works )

I have cont-en.ini in
$>kpsewhere cont-en.ini
/usr3/TeX/texmf-dist/tex/context/config/cont-en.ini

Any ideas ?

thanks
luigi

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

* Re: Unable to make cont-en.fmt
  2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
@ 2005-08-25  9:07   ` Taco Hoekwater
  2005-08-25  9:37     ` luigi.scarso
  2005-08-25  9:42   ` Vit Zyka
  1 sibling, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2005-08-25  9:07 UTC (permalink / raw)



Luigi,

It attempts to read the file "*cont-en.ini", with the star included
in the name. From personal experience, I know that this will happen
when pdfetex is not really pdfetex, but a non-etex pdftex ...
(because of a symlinked executable, i'll wager)

Taco


luigi.scarso wrote:
> Hi, while installing latest pdftex 1.30.1 I have messed with some 
> configs files
> and now I am unable to remade format.
> So
> $> fmtutil --byfmt cont-en
> gives
> 
> running `pdfetex -ini   -jobname=cont-en -progname=context -8bit 
> *cont-en.ini' ...
> This is pdfTeXk, Version 3.141592-1.30.1 (Web2C 7.5.5) (INITEX)
> %&-line parsing enabled.
> ! I can't find file `*cont-en.ini'.
> <*> *cont-en.ini
>               Please type another input file name:
> ! Emergency stop.
> <*> *cont-en.ini
>               No pages of output.
> Transcript written on cont-en.log.
> Error: `pdfetex -ini  -jobname=cont-en -progname=context -8bit 
> *cont-en.ini' failed
> 
> ############################################################################### 
> 
> fmtutil: Error! Not all formats have been built successfully.
> Visit the log files in directory
>  /usr3/TeX/texmf-var/web2c
> for details.
> ############################################################################### 
> 
> 
> This is a summary of all `failed' messages and warnings:
> `pdfetex -ini  -jobname=cont-en -progname=context -8bit *cont-en.ini' 
> failed
> 
> In file fmtutil.cnf there is the correct line :
> cont-en pdfetex         cont-usr.tex    -8bit *cont-en.ini
> (instead
> cont-en pdfetex         cont-usr.tex    -8bit  cont-en.ini
> works )
> 
> I have cont-en.ini in
> $>kpsewhere cont-en.ini
> /usr3/TeX/texmf-dist/tex/context/config/cont-en.ini
> 
> Any ideas ?
> 
> thanks
> luigi
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Unable to make cont-en.fmt
  2005-08-25  9:07   ` Taco Hoekwater
@ 2005-08-25  9:37     ` luigi.scarso
  2005-08-25 10:43       ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: luigi.scarso @ 2005-08-25  9:37 UTC (permalink / raw)


Taco Hoekwater wrote:

>
> Luigi,
>
> It attempts to read the file "*cont-en.ini", with the star included
> in the name. From personal experience, I know that this will happen
> when pdfetex is not really pdfetex, but a non-etex pdftex ...
> (because of a symlinked executable, i'll wager)

symlink it's the magic word...
Yes, the error happened when I copied latest pdfetex and pdftex:
pdftex is symbolic link to pdfetex.
I was so stupid to remade copy until i didn't read your answer...

Now all it's ok.

Many thanks Taco

luigi

PS:
What do you think about to write a dense guide to programmer on how to add
a pdftex primitive (something like \pdfhelloworld) and how to interface 
to an
external libray (like zlib) ?
I think that this will fill a hole in documentations.

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

* Re: Unable to make cont-en.fmt
  2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
  2005-08-25  9:07   ` Taco Hoekwater
@ 2005-08-25  9:42   ` Vit Zyka
  1 sibling, 0 replies; 10+ messages in thread
From: Vit Zyka @ 2005-08-25  9:42 UTC (permalink / raw)


luigi.scarso wrote:
> Hi, while installing latest pdftex 1.30.1 I have messed with some 
> configs files
> and now I am unable to remade format.
> So
> $> fmtutil --byfmt cont-en
> gives
> 
> running `pdfetex -ini   -jobname=cont-en -progname=context -8bit 
> *cont-en.ini' ...
> This is pdfTeXk, Version 3.141592-1.30.1 (Web2C 7.5.5) (INITEX)
> %&-line parsing enabled.
> ! I can't find file `*cont-en.ini'.
> <*> *cont-en.ini
>               Please type another input file name:
> ! Emergency stop.
> <*> *cont-en.ini
>               No pages of output.
> Transcript written on cont-en.log.
> Error: `pdfetex -ini  -jobname=cont-en -progname=context -8bit 
> *cont-en.ini' failed
> 
> ############################################################################### 
> 
> fmtutil: Error! Not all formats have been built successfully.
> Visit the log files in directory
>  /usr3/TeX/texmf-var/web2c
> for details.
> ############################################################################### 
> 
> 
> This is a summary of all `failed' messages and warnings:
> `pdfetex -ini  -jobname=cont-en -progname=context -8bit *cont-en.ini' 
> failed
> 
> In file fmtutil.cnf there is the correct line :
> cont-en pdfetex         cont-usr.tex    -8bit *cont-en.ini
> (instead
> cont-en pdfetex         cont-usr.tex    -8bit  cont-en.ini
> works )
> 
> I have cont-en.ini in
> $>kpsewhere cont-en.ini
> /usr3/TeX/texmf-dist/tex/context/config/cont-en.ini

Hi,

try
   pdfetex -ini   -jobname=cont-en -progname=context -8bit cont-en.ini
I think now etex does not want stared files. If so, change your fmtutil.cnf

vit

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

* Re: Unable to make cont-en.fmt
  2005-08-25  9:37     ` luigi.scarso
@ 2005-08-25 10:43       ` Taco Hoekwater
  0 siblings, 0 replies; 10+ messages in thread
From: Taco Hoekwater @ 2005-08-25 10:43 UTC (permalink / raw)


luigi.scarso wrote:
> 
> symlink it's the magic word...

Like I said: From personal experience :)

> PS:
> What do you think about to write a dense guide to programmer on how to add
> a pdftex primitive (something like \pdfhelloworld) and how to interface 
> to an external libray (like zlib) ?

It goes roughly like this:

* create pdfetex-main.web from all of the web and change files so you
   have a least a sane source while coding, and make a copy for future
   comparison
* find an existing command who's syntax/semantics are close to the
   one you intend to implement ("extension" is fairly useless for
   anything that actually does have an impact on typesetting, you
   probably want 'convert' or 'last_item').
* hook a new subcode into the processing of that existing command,
* add a call to primitive()
* create a code line to print_cmd_chr()
* when it builds ok, create a change file by running diff on the
   original pdfetex-main.web, and add this change file at the end
   of the change file list in pdfetex.mk

I'll see if it is possible to create a document with a bit more specific
info

Taco

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

* Re: How to customize the default verbatim colors
  2005-08-24 23:55 How to customize the default verbatim colors Eugene Toporov
  2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
@ 2005-08-25 11:23 ` Taco Hoekwater
  2005-08-26 17:17   ` Eugene Toporov
  1 sibling, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2005-08-25 11:23 UTC (permalink / raw)



Hi!


Eugene Toporov wrote:

> I expect there is a way to redefine whole palette or something.

Yes, sure (you need to define an XXXcolorpretty palet for each type
you want to change):

   \definecolor[MYcolorone]  [r=.8,g=.5,b=.5]
   \definecolor[MYcolortwo]  [r=.8,g=.5,b=.2]
   \definecolor[MYcolorthree][r=.8,g=.5,b=.8]
   \definecolor[MYcolorfour] [r=.8,g=.2,b=.5]

   \definepalet[MYcolors]
     [  prettyone=MYcolorone,
        prettytwo=MYcolortwo,
      prettythree=MYcolorthree,
       prettyfour=MYcolorfour]

   \definepalet[XMLcolorpretty] [MYcolors] % the name is magic !

   \setupcolors[state=start]
   \setuptyping[option=color]

   \starttext
   \startXML ... \stopXML
   \stoptext

Cheers, Taco

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

* Re: How to customize the default verbatim colors
  2005-08-25 11:23 ` How to customize the default verbatim colors Taco Hoekwater
@ 2005-08-26 17:17   ` Eugene Toporov
  2005-08-27  9:12     ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Eugene Toporov @ 2005-08-26 17:17 UTC (permalink / raw)



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

Thanks a lot, Taco!

I knew there should be a good way!
Maybe it would be useful to add it to http://contextgarden.net/Verbatim_text?

I also noticed that XML verbatim does not correctly handle tags with 
namespace.
In the xml like <ns:tag attribute="somevalue"> the "ns" gets colored with 
tag-color, the "tag" with attr-color. I think the whole "ns:tag" should be 
of tag-color.

Best wishes,
Eugene

On 8/25/05, Taco Hoekwater <taco@elvenkind.com> wrote:
> 
> 
> Hi!
> 
> 
> Eugene Toporov wrote:
> 
> > I expect there is a way to redefine whole palette or something.
> 
> Yes, sure (you need to define an XXXcolorpretty palet for each type
> you want to change):
>

[-- Attachment #1.2: Type: text/html, Size: 1102 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] 10+ messages in thread

* Re: How to customize the default verbatim colors
  2005-08-26 17:17   ` Eugene Toporov
@ 2005-08-27  9:12     ` Taco Hoekwater
  2005-08-29 11:06       ` Hans Hagen Outside
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2005-08-27  9:12 UTC (permalink / raw)


Eugene Toporov wrote:
> Thanks a lot, Taco!
> 
> I knew there should be a good way!
> Maybe it would be useful to add it to 
> http://contextgarden.net/Verbatim_text ?

Be my guest ;-)

> I also noticed that XML verbatim does not correctly handle tags with 
> namespace.
> In the xml like <ns:tag attribute="somevalue"> the "ns" gets colored 
> with tag-color, the "tag" with attr-color. I think the whole "ns:tag" 
> should be of tag-color.

How about this?

   %% allows XML tag names to continue after colons (namespaces)
   \input verb-xml % TRICK
   \appended\gdef\XMLsetspecials{\setpretty`\:=10 }

   \starttext
   \startXML
     <ns:tag attribute="somevalue" />
   \stopXML
   \stoptext
   %%

You can use  \setpretty`\:=17 instead, if you want the colon to be
indistinguisable from the rest of the tag.

The line I've marked 'TRICK' is needed to make sure that the original
definition of \XMLsetspecials is loaded before the new addition takes
place (verbatim definitions are loaded runtime).

Cheers, Taco

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

* Re: How to customize the default verbatim colors
  2005-08-27  9:12     ` Taco Hoekwater
@ 2005-08-29 11:06       ` Hans Hagen Outside
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen Outside @ 2005-08-29 11:06 UTC (permalink / raw)


Taco Hoekwater wrote:

>
>   %% allows XML tag names to continue after colons (namespaces)
>   \input verb-xml % TRICK
>   \appended\gdef\XMLsetspecials{\setpretty`\:=10 }

thanks, patched 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2005-08-29 11:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-24 23:55 How to customize the default verbatim colors Eugene Toporov
2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
2005-08-25  9:07   ` Taco Hoekwater
2005-08-25  9:37     ` luigi.scarso
2005-08-25 10:43       ` Taco Hoekwater
2005-08-25  9:42   ` Vit Zyka
2005-08-25 11:23 ` How to customize the default verbatim colors Taco Hoekwater
2005-08-26 17:17   ` Eugene Toporov
2005-08-27  9:12     ` Taco Hoekwater
2005-08-29 11:06       ` Hans Hagen Outside

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