Re: [NTG-context] shading in meta[post/play] & PDF

2005-01-20 Thread Mojca Miklavec
Hans Hagen wrote:
Mojca Miklavec wrote:
How can I make shading inside metapost(play) to produce exactly what's 
in the attached picture (smooth shades). Or more generally: how can I 
"hardcode" some PS/PDF code in .mp, not (yet) supported by 
metapost(play)?

certain kind of native level 2 shaded can be done with the metafun 
macros (circular and linear vector based)

a couple of years ago mathew baker and i played with more advanced 
features using functions and such but i need to locate that code;

if you're willing to figure out what (in pdf) functionality is needed i 
can extend the current metapost shading handler with a few more 
alternatives [the function based ones, since that's what you're looking 
for])
I'm not sure if I understood the question correctly (about what should I 
figure out).

I would like to draw a sphere (possibly with different colors on 
different points of the sphere; which would then be interpolated across 
the whole surface).

Problem description:
I have a computer program, which carries the data about the grid points 
on a sphere (possibly with different colors defined in these points) and 
how the points are connected with each other to form a grid. I would 
take these triangles (or quadrilaterals), draw them transformed on the 
plane (with curves, not with straight lines) and fill them with the 
appropriate shading pattern (colors defined in corners of the triangles 
(darker according to normal vector) simply interpolated between the 
three points). Yet another possibility would probably be to use 
function-based shading and define a function which knows how the points 
have to be shaded on the sphere, but the latter seems more complicated 
and less universal.

Problem reduction:
Fill a mp closed path with any more complex shading.
So I would probably need Type 6 or 7 shading (Type 4 would be OK as the 
picture can be clipped within metapost, so that the resulting sphere 
borders are not composed of straight lines; the articles on 
http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/ which 
inspired me to do something so crazy actually use Type 4 shading). Type 
one is probably the most general one, so it should be OK too, just 
complicated to do.

However: I'm not sure if, say, a (sampled) function to be passed to PDF 
can be specified in metapost elegantly.

Page 746 of PDF Reference, version 1.6 also defines an interesting new 
feature: 3D objects (3D Artwork as they call it), but I haven't found 
anything else about that.

In dvipdfm there's an example of using:
\special{pdf: bt rotate 90 xscale 2.0 }
These lines are to be used in TeX. MetaPost also knows a "special" 
command, I just don't know how to use it. (This is probably the 
"communication channel" to PDF when trying to implement some more exotic 
shadings.)

I glimpsed the mp-spec.mp file, but I didn't yet understand how the 
parameters are passed to PDF.

[more a context mailing list issue than a metapost list issue]
So I left the metapost group out. Actually, 90% on the people here 
probably think I posted that to the wrong group anyway (in the sense of 
"Are you sure you didn't want to post that question to the 3D studio max 
mailing list?" :) The example above is probably not the most descriptive 
one, but having the possibility to add some more advanced shading 
patterns would be great.

Thank you,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: Re[2]: [NTG-context] Greek font in Footnote problem

2005-01-20 Thread Alan Bowen
Guiseppe and Thomas—
A quick run though with my test file indicates that
	\def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
will work in the body text, but only if one enters the Greek code using 
double braces as follows:
		{\localgreek{Greek code}}
With single braces either the Greek turns on and stays on thereafter or 
the breathings get messed up with initial spaces.

Still no Greek in the footnotes, though.
Alan
On Jan 19, 2005, at 7:05 AM, Giuseppe Bilotta wrote:
Wednesday, January 19, 2005 Thomas A.Schmitz wrote:

On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:

enablegreek relies on catcode changes, so it cannot work inside
commands. It should be redefined to make use of e-TeX's
\scantoken feature so that it can re-parse its input.

Giuseppe,

I'll be too bust the next three weeks to look into this, but would 
love
to correct my quick and dirty hack. Can you give me a hint where I can
learn more about \scantoken and how I can implement it for my Greek
stuff?
Ehehehe. The reason why I was so generic in my answer is
precisely the same :)
Something like
\def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
could work.
--
Giuseppe "Oblomov" Bilotta
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re[2]: [NTG-context] Greek font in Footnote problem

2005-01-20 Thread Giuseppe Bilotta
Wednesday, January 19, 2005 Thomas A.Schmitz wrote:


> On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:

>> enablegreek relies on catcode changes, so it cannot work inside
>> commands. It should be redefined to make use of e-TeX's
>> \scantoken feature so that it can re-parse its input.

> Giuseppe,

> I'll be too bust the next three weeks to look into this, but would love
> to correct my quick and dirty hack. Can you give me a hint where I can
> learn more about \scantoken and how I can implement it for my Greek
> stuff?

Ehehehe. The reason why I was so generic in my answer is
precisely the same :)

Something like

\def\localgreek#1{\scantokens{\Gf\enablegreek#1}}

could work.

-- 
Giuseppe "Oblomov" Bilotta

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] french hyphenation after l-apostrophe doesn't work

2005-01-20 Thread Peter Münster
On Thu, 20 Jan 2005, Steffen Wolfrum wrote:

> when, in a french project, the line ends with e.g. l'int\'{e}r^{e}t
> then context doesn't hyphenate "l'interet" and the line gets stretched.
> (If I wouldn't have the l-apostroph construction then the word is
> hyphenated "in-teret", so its hyphenation is know to TeX.)

Hello Steffen,
perhaps you just need a font with "real" accented characters, such as
Latin-Modern. This works for me:

\enableregime[il1]
\usetypescript[modern][texnansi]
\setupbodyfont[modern]
\starttext
\dorecurse{50}{l'intérêt }
\stoptext

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
_
FilmSearch engine: http://f-s.sf.net/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] french hyphenation after l-apostrophe doesn't work

2005-01-20 Thread Steffen Wolfrum
Hi,

when, in a french project, the line ends with e.g. l'int\'{e}r^{e}t
then context doesn't hyphenate "l'interet" and the line gets stretched.
(If I wouldn't have the l-apostroph construction then the word is hyphenated 
"in-teret", so its hyphenation is know to TeX.)

But for I have a lot of this "l-apostroph" constructions at line endings in my 
document it is impossible to type individually \- at the best breaking points 
(here after "in-"). I need to have a global option that re-activates the 
hyphenation even if the word starts with l-apostroph.

When I typeset the apostrophe like a slash: l|'|int\'{e}r^{e}t
then the line gets broken, but after "l'" and I was told this is wrong in 
french.

So what else could be done to automatically break int\'{e}r^{e}t again but 
*not* after l' ?


Thank you for any help,

Steffen
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] UTF-8 XML to IL2

2005-01-20 Thread Adam Lindsay
Vit Zyka said this at Thu, 20 Jan 2005 16:06:55 +0100:

>
>please, I have UTF-8 XML file and I want to typeset with IL2 (czech) 
>font. What I have to do?
>
>Thank you
>Vit Zyka
>
>P.S. I tried:
>   \useregime[utf]
>   \defineXMLenvironment[doc] \starttext \stoptext
>   \processXMLfile{manaana.xml}

It depends on how your il2 font is defined locally (like in terms of the
typescript), but it should work with something like:

\useregime[utf]
\usetypescript [all] [latin-modern] [il2]
\setupbodyfont[reset] 
\setupbodyfont[cmr]

\defineXMLenvironment...(etc.)

>But I guess the Unicode -> IL2 mapping is missing.

There's a Unicode -> ConTeXt named glyph mapping (unic-*),
and a ConTeXt named glyph -> ISO Latin 2 mapping (enco-il2),
so it *should* work!
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] UTF-8 XML to IL2

2005-01-20 Thread Vit Zyka
Dear ConTeXters,
please, I have UTF-8 XML file and I want to typeset with IL2 (czech) 
font. What I have to do?

Thank you
Vit Zyka
P.S. I tried:
  \useregime[utf]
  \defineXMLenvironment[doc] \starttext \stoptext
  \processXMLfile{manaana.xml}
But I guess the Unicode -> IL2 mapping is missing.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] ConTeXt tool for enabling comments in PDF ?

2005-01-20 Thread Vit Zyka
h h extern wrote:
Vit Zyka wrote:
So, to do that, pdfTeX should start to calc document diggest and there 
should be standard(?) process of signing this value.
how is that one calculated, imagine that in the %! fields you fill in 
placeholders like hereshouldgosomemagiccode, then one can run a script 
over the pdf, calculate that magic, and replace the string; maybe this 
can be hooked into  xpdflib

Hans
Yes, I agree, postprocessing is possible. But I did not find any digest 
computing alg in the range of C/C++ or Perl. Also do not known links to 
xpdflib.

Vit Zyka
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to learn ConTeXt?

2005-01-20 Thread Marcin Borkowski
Hello everyone!

My question is as in subject: how to learn ConTeXt?  And another ones:

How to install ConTeXt?  Manually or from, e.g., TeXlive?

I would like to typeset in Antykwa Torunska or Antykwa Poltawskiego.  
Setting \setupbodyfont[...] yields errors about missing ec-ant* fonts (I 
use the TeXlive 2004 installation, the same thing happened in TeXlive 
2003).

Greetings

-- 
Marcin Borkowski
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Setting up a sombined list ...

2005-01-20 Thread Willi Egger
Hi,
I am trying to setup a special TOC which should show the version instead 
of a pagenumber. My approach was to setup newheads with \definehead[][]
and defining a new combined list.
The struggle is that I can't manage to get the list entries numbered and 
the lower level listentries are not indented as intended.

Could some one give me a clue where I am missing the proper options.
Please try the attached minimal file.
Tanks and kind regards
Willi
%test

\def\Version{20-01-2005}

\definehead[Mypart][part]
\setuphead[Mypart][number=yes,placehead=no]
\definehead[Mychapter][chapter]
\definehead[Mysection][section]
\definecombinedlist[Mycontent][Mypart,Mychapter,Mysection]
\setuplist[Mycontent]
[level=Mypart,pagenumber=no]
\setuplist[Mycontent]
[level=Mychapter,distance=4em]
 \setuplist[Mychapter][pagenumber=no]
 \setuplist[Mysection][pagenumber=no]


\starttext
\completeMycontent[criterium=all]

\expanded{\writetolist[Mypart]{Test Part 1}{}}

\dorecurse{3}{%
\chapter[Ch-Test]{Test}
\expanded{\writetolist[Mychapter]{Test \recurselevel}{\hfill 
Version:~ \Version}}
\input ward
}

\section{Problems seen:}

\startitemize[2,packed]
\item With the configuration above, the Mypart has still a 
pagenumber in the TOC.
\item In the \type{\completeMycontent} the chapters are not 
indented.
\item I would expect that the TOC entries would be numbered.
\stopitemize
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context][metapost] shading in meta[post/play] & PDF

2005-01-20 Thread Laurence Finston
On Wed, 19 Jan 2005, Mojca Miklavec wrote:

>
> How can I make shading inside metapost(play) to produce exactly what's
> in the attached picture (smooth shades). Or more generally: how can I
> "hardcode" some PS/PDF code in .mp, not (yet) supported by metapost(play)?
>

This is a very difficult question.  For an excellent introduction
to shading and other subjects I recommend:

Jones, Huw.
_Computer Graphics through Key Mathematics_.
Springer-Verlag London Limited 2001.
ISBN 1-85233-422-3.

>
> Here's the corresponding PostScript code:
>

Sorry, I don't know PostScript.

>
> >>The spheres drawn directly in PostScript as in the examples above still
> >>have straight lines (well, I agree that with some mathematics it would
> >>be possible to draw them with proper splines as well).
> >>

To the best of my knowledge, spline curves are drawn by means of
calculating short line segments.  You can make the "time" parameter
as small as you like, but you can't make it 0.

I believe plotters can draw genuine curves---and it's a lot more
fun to watch them work (it's like magic).
They're not so great at filling in regions,
though.  Much to my regret, the computer center here got rid of
the plotter.  They're probably as obsolete as the ENIAC now, except
perhaps for very high-quality work.

> Thank you,

My pleasure.

Laurence
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context