[NTG-context] \startvariables failed after the current update

2008-10-28 Thread Zhichu Chen
Hi there,

I haven't updated my ConTeXt distribution for a very long time (for
the internet connection problem here) and somehow my network
worked, so I use ctxtools --update to make an update. During the
updating, I got some error message like I can't find mult-def.tex
and some other files more. Weird, because I do have those files
and kpsewhich can locate them. I just input the needed files WITH
the path and seemed OK. To make sure, I made another ctxtools --update
and this time no error messages.

Anyway, I compiled a used-to-be-working file and failed because
some Undefined control sequence and I found the undefined
macros are the \c!xxx and \v!yyy macros which I defined them
in
\startvariables all
   yyy: yyy
\stopvariables

\startconstants all
   xxx: xxx
\stopconstants

any explanations?

-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Load context format at runtime (from luatex)

2008-10-28 Thread Hans Hagen
Mildred Ki'Lya wrote:

 I want to be able to tun a TeX document which uses macros that are
 specific to the document I create. And I would like to separate the
 macros from the actual document.

you can define your own commands on top of context (as long as you don't 
overload essential low level macros)


-
   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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \startvariables failed after the current update

2008-10-28 Thread Hans Hagen
Zhichu Chen wrote:
 Hi there,
 
 I haven't updated my ConTeXt distribution for a very long time (for
 the internet connection problem here) and somehow my network
 worked, so I use ctxtools --update to make an update. During the
 updating, I got some error message like I can't find mult-def.tex
 and some other files more. Weird, because I do have those files
 and kpsewhich can locate them. I just input the needed files WITH
 the path and seemed OK. To make sure, I made another ctxtools --update
 and this time no error messages.
 
 Anyway, I compiled a used-to-be-working file and failed because
 some Undefined control sequence and I found the undefined
 macros are the \c!xxx and \v!yyy macros which I defined them
 in
 \startvariables all
yyy: yyy
 \stopvariables
 
 \startconstants all
xxx: xxx
 \stopconstants
 
 any explanations?

sure, that interface has gone

\setinterfacevariable{yyy}{yyy}
\setinterfaceconstant{xxx}{xxx}

-
   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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \startvariables failed after the current update

2008-10-28 Thread Zhichu Chen
Oops. Thanks. Although I think it would be much simpler if we can do this
by using comma lists.

On Tue, Oct 28, 2008 at 8:30 AM, Hans Hagen [EMAIL PROTECTED] wrote:
 Zhichu Chen wrote:
 Hi there,

 I haven't updated my ConTeXt distribution for a very long time (for
 the internet connection problem here) and somehow my network
 worked, so I use ctxtools --update to make an update. During the
 updating, I got some error message like I can't find mult-def.tex
 and some other files more. Weird, because I do have those files
 and kpsewhich can locate them. I just input the needed files WITH
 the path and seemed OK. To make sure, I made another ctxtools --update
 and this time no error messages.

 Anyway, I compiled a used-to-be-working file and failed because
 some Undefined control sequence and I found the undefined
 macros are the \c!xxx and \v!yyy macros which I defined them
 in
 \startvariables all
yyy: yyy
 \stopvariables

 \startconstants all
xxx: xxx
 \stopconstants

 any explanations?

 sure, that interface has gone

 \setinterfacevariable{yyy}{yyy}
 \setinterfaceconstant{xxx}{xxx}

 -
   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
 -
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!

 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] tikz and metapost

2008-10-28 Thread Mojca Miklavec
On Sun, Oct 26, 2008 at 4:24 PM, Alan BRASLAU wrote:
 Following some exchange off-list (trying to figure out how tikz under context
 got broken), the subject of understanding pgf/tikz with respect to metapost
 came up. I am posting a follow-up here as it may be of interest to others on
 the mailing list, those who know metapost very well as well as those, like
 myself, who are still learning how to use different graphics tools.

 On Sunday 26 October 2008 11:46:22 Mojca Miklavec wrote:
  I am just starting to learn about metapost, and I can't judge yet
  what pgf/tikz has as advantages and disadvantages.

 Advantages of TikZ:
 1.) many many many many libraries that are ready-to-use. Just take a
 glimpse through the manual and it will be evident to you in the first
 glimpse. If you want to draw a graph, you can do it with a few
 commands. (one command draws you axis, one for function, ...)
 You can achieve the same with metapost, but you need to do everything
 from scratch. However, it's really easy to write your own libraries.
 2.) some special effects like smooth shading works in metapost only
 conditionally (does not work with XeTeX at the moment), and you have a
 wider range with TikZ

 Advantages of metapost:
 1.) rich mathematical machinery (you can write a set of equations and
 metapost will calculate your coordinates)
 2.) easy to write your own macros

 I thought that a major interest of pgf/tikz was the production of portable
 graphics (using many different motors).

Right. That's also true, but portability is more about the source
code of TikZ only had to be written once and you only need to learn
it once when you write with both LaTeX and ConTeXt.

Usually you don't need to exchange the same figures between LaTeX and
ConTeXt documents anyway. But if you do need to convert, portable code
indeed helps a lot.

  As an experiment, I did try comparing making a graph using
  pgfplot and metagraph, and I did *not* like the result of the second.

 metagraph is old as earth.

 graph.mp,v 1.2 2004/09/19
 Current estimates place the age of the earth at around 4.6 billion years...

Compared to 4.6 billion years it would not matter, but I guess that
mpgraph has been written by Hobby, and the most recent reference that
he's quoting is from 1994. The date you see might be as trivial thing
as Karl Berry adding the svn id on top of file (though I would not
know it).

And in computers 14 years with (almost) no modification ... speaks for itself.

 If I draw graphs is meapost, I do that
 manually. Or I use gnuplot module to draw graphs for me, but graph
 drawing is much easier  more flexible with TikZ if you have
 datapoints ready.

 I myself find gnuplot to be fatally flawed and have never liked using it.

Flawed with/like?
(I started using it since I didn't need to bother about anything. It
just worked out of the box. I don't like most terminals, but with the
right terminal it's quite ok.)

 (I still sometimes produce graphics using an old program written in KR C that
 generates HPGL for pen plotters, with a filter that then creates postscript.
 Now THAT is almost stone age! But this program can also handle an arbitrary
 number of points VERY efficiently, only limited by the size of your storage
 device.)

And by the memory your printer has when you try to print that file ... :) :) :)
(I need to draw some scatter plots now and need to figure a way to
forget about all the tools that I know for creating nice vector plots
... Back to the nice old bitmaps!)

 If you need some complex curve, TikZ is improving in
 that area, but in metapost it's out-of-the-box to draw it.

 Why did Till Tantau write pgf/tikz? Clearly he knew metapost, so another route
 could have been to develop a standard library of metapost macros.

Before mplib came to existance metapost meant that TeX had to:
- write mp code into file
- run metapost to convert your file into PostScript
- run other TeX jobs in background in order to get labels on MP figures

And that is *awfuly* slow when you have to process multiple graphics
with some text labels. Apart from that, you need to have some switch
enabled (write18) that means a security issue when other people submit
code to your server.

The way TikZ is implemented runs faster than metapost with
old-fashioned labels in mkii. Metapost in mkiv is comparable - you
don't need any external program to generate graphics.

What Till Tantau did whas bringing portability and efficiency of
drawing into all formats and all engines of TeX. With a standard
library for metapost he wouldn't gain on portability/efficiency,
though he could clearly implement  a library of the same strength much
easier. TikZ is now *the* choice for drawing anything in (La)TeX.

 I'm asking
 these questions here as there seems to be a preference (or prejudice) towards
 metapost amongst the context community.

- TikZ is rather new
- Hans has a large collection of own macros already (everything that
he ever needed), so there's no point of 

Re: [NTG-context] \startvariables failed after the current update

2008-10-28 Thread Hans Hagen
Zhichu Chen wrote:
 Oops. Thanks. Although I think it would be much simpler if we can do this
 by using comma lists.

(1) slow
(2) when another interface is added, we need to extend all commalists 
(say that you want a chinese user interface)
(3) we now generate definitions from lua tables

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Colored labels with MetaPost in MkII

2008-10-28 Thread Aditya Mahajan
On Mon, 27 Oct 2008, Wolfgang Schuster wrote:

 On Fri, Oct 24, 2008 at 2:15 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:
 On Fri, 24 Oct 2008, Wolfgang Schuster wrote:

 Hi all,

 what is the best method to format MetaPost labels in MkII with 
 \doattributes.

 \startMPenvironment[global]
 \setupcolors[state=start]

 \def\labelstyle{bold}
 \def\labelcolor{red}
 \stopMPenvironment

 This gives you only bold label.

 \starttext
 \startMPcode
 label(textext(\doattributes{label}{style}{color}{Label}),origin) ;
 \stopMPcode
 \stoptext

 Tex colors do not work inside textext. Try

 label(textext(\startcolor[red] red \stopcolor), origin) ;

 One way to get around this is to use \sometxt.

 label(\sometxt{\doattributes{label}{style}{color}{Label}},(5cm,0)) ;

 But then you have to be careful about the differences between \sometxt in
 MKII and MKIV (which I need to  summarize on the wiki).

 Here is a new example where I can't even use \sometxt.

Sometxt does not work appear to work with \startMPdrawing (there is 
no output at all). I think that the reason is that MPdrawing simply writes 
stuff to the MPfile without doing the extra work needed for sometxt.

I will call this is a bug, but I do not know if Hans wants to work on 
TeX-MP interaction in MKII now.

 \setupcolors[state=start]

 \def\labelstyle{bold}
 \def\labelcolor{red}

 \starttext
 \resetMPdrawing
 \startMPdrawing
 label(textext(\doattributes{label}{style}{color}{Label}),origin) ;
 label(\sometxt{\doattributes{label}{style}{color}{Label}},origin) ;
 \stopMPdrawing
 \MPdrawingdonetrue
 \getMPdrawing
 \stoptext

It may be possible to write your macros without \start-stop-MPdrawing. 
Everything inside \start-stop MP(code|graphic) is first parsed by TeX, so 
you can do things like

\newif\ifcircle \circletrue

\startMPcode
draw \ifcircle fullcircle \else fullsquare \fi xyscaled (5cm,5cm) ;
\stopMPcode

So, instead of writing stuff to MP using start-stop MPdrawing, you can 
simply set some flags in conditionals and chardefs, and then write one 
MP(graphic|code) to write one MP file. This strategy will not work for all 
cases, but can be useful for some.

Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] PhD Thesis in ConTeXt

2008-10-28 Thread Aditya Mahajan
On Tue, 28 Oct 2008, Mohamed Bana wrote:

 Hi Aditya,

 I've tried compiling your thesis. It failed with;

There were a few modules which were missings from the zip file. I have 
created a new zip file with these files. I hope that everything should 
compile now.

http://www.eecs.umich.edu/~adityam/publications/thesis/thesis.tar.gz

 texmfstart texexec thesis.tex

 system : module abr-aditya not found

I have added this

 system : module ctags not found

This is harmless. A module that I wrote to write tag files for vim, but it 
does not work with MKIV.

 system : module mathsets not found

I have added this. You can also download it from 
modules.contextgarden.net/mathsets.

Aditya


 Aditya Mahajan wrote:
 On Tue, 21 Oct 2008, Piotr wrote:

 Hello,

 I have spent some time with google in order to find an answer to the
 following questions. Unfortunatly, I was not satisfied with the
 answers, which I now hope to find here.

 It is my plan not to use the MS Office suite for the production of my
 PhD thesis (in chemistry). I have used Miktex some years ago during my
 studies for some project reports, and I remember beeing quite
 satisfied with the results. My Master thesis, on the other hand, I
 wrote in word.. and although I remember not having too many
 difficulties, there were some nasty obstacles to be overcome.
 Obstacles which I simply do not want to risk having repeated a second
 time on a much bigger scale.
 I this mailing list I read several reports of people who either had
 written their thesis in Latex or ConTeXt. There was a mention of Latex
 beeing designed for mathematic purposes, while ConTeXt was said to be
 better suited for the intergration of graphics or larger/more complex
 layout changes.

 1) Finding the right context
 For now I had quite some difficulties to find that proper Latex
 distribution - a problem that actually led me to the existence of
 ConTeXt. I am wondering which latex distribution I should choose in
 order to work with ConTeXt? I am running Windows Vista (64-bit). Or is
 there a ConTeXt stand alone package that will absolutely satisfy my me
 in my needs? In principle, all I need is

 2) The right editor
 What is the preferred editor for ConTeXt? for such a project? Is there
 any loss in functionality when using Texniccenter with ConTeXt than
 with MikTex instead?

 Depends on what functions you need. There are a few editors which have
 basic support for ConTeXt (compile document, view pdf, jump to error,
 etc.). Hans uses Scite and includes a context enabled scite in the
 windows distribution available on prama-ade.com. Irdis has written support
 for Notepad++. Vim and emacs have some basic support. I do not know what
 features texniccenter and winedit provide for context.

 3) I have seen some thesis templates/examples in this mailinglist. Can
 anyone point me to additional sources regarding the creation of a PhD
 Thesis with ConTeXt?

 Each institute has different requirements for phd thesis, so one template
 is not going to fit the bill. I did my thesis in context, and you can have
 a look at the sources and the output:

 http://www.eecs.umich.edu/~adityam/publications/thesis/thesis.pdf
 http://www.eecs.umich.edu/~adityam/publications/thesis/thesis.tar.gz

 The easier way to go about this will be to look at the formatting
 specifications of the thesis, and try to understand how to implement them
 in context one by one.

 What is the advantage over Latex, what are the
 disadvantages? Is there a win-win distribution somewhere on the table?

 Advantage: In most cases, others have written a style for what you want,
 so you don't have to create a style on your own.

 Disadvantage: When you do have to create a style on your own, it can be
 difficult, even in packages which are supposed to be easy to configure

 4) Has anyone used a typesetting suite like ContTeXt with CVS?

 As others have said, the source files are simply text files. So you can
 use any version control that you want.

 5) Is the ConTeXt reference system compatible with Endnote?

 I have no experience with endnote. I have seen endnote to bibtex
 converters. If you can convert to bibtex, then using the references with
 context is relatively easy.

 Is there any point to have latex installed, when context can do the
 trick?

 As Mojca said, you may want to submit something to a journal which accepts
 latex files.

 Or lets ask the devils advocate the other way around: What is
 the point of installing context, when latex could do the trick?

 Again I agree with what Mojca said. If latex can do the job, use it. If
 you are happy with one of the defaul latex styles, do not use too many
 figures in your document, do not want text wrapping around figures, use
 latex.

 Apart
 that I have to re-learn latex anyway.. what is better with Context?

 Context has a more consistent interface to all the commands. This makes it
 easier to remember how to configure things.

 Aditya