Re: [NTG-context] clipping problem

2006-07-06 Thread Peter Rolf
Just as a reminder for an unsolved problem :)

I also tested this on contextgarden, with faulty result. Same with

\clip[hoffset=64bp,voffset=64bp,width=64bp,height=64bp]{\reuseMPgraphic{cliptest}}

So it doesn't look like a rounding problem.

Peter Rolf wrote:
 Hi,
 
 I have some png-graphics, where several (equal sized) icons are arranged
 in array form. When I cut out an icon, I get the icon gfx plus a very
 small part from the surronding icon(s). The attached file shows, that
 the same problem occurs when using a vector based graphic.
 
 Normally I use imagemagic to seperate such files into single gfx, so
 this is not a serious problem for me. But if this is a bug, it should be
 fixed (or if I have missed something, let me know).
 
 Greetings, Peter
 
 
 
 
 % interface=en output=pdftex
 % Time-stamp: Montag, 03 Juli 2006 21:04:46; cliptest.tex
 %
 
 \setupcolors[state=start]
 
 \startreusableMPgraphic{cliptest}
   path p ;
   u:= 64bp ;
   p:= unitsquare xyscaled(u,u) ;
 
   fill p withcolor green ;
   fill p xshifted u  withcolor blue ;
   fill p xshifted 2u withcolor green ;
 
   fill p yshifted u withcolor blue ;
   fill p shifted (u,u)  withcolor red ;
   fill p shifted (2u,u) withcolor blue ;
 
   fill p shifted (0,2u)  withcolor green ;
   fill p shifted (u,2u)  withcolor blue ;
   fill p shifted (2u,2u) withcolor green ;
 \stopreusableMPgraphic
 
 
 \starttext
 
 \reuseMPgraphic{cliptest}
 \blank
 
 \setupclipping[nx=3,ny=3]
 
 \clip[x=1,y=1]{\reuseMPgraphic{cliptest}}
 \blank
 
 \clip[x=2,y=2]{\reuseMPgraphic{cliptest}}
 \blank
 
 \clip[x=2,y=3]{\reuseMPgraphic{cliptest}}
 
 
 
 \stoptext
 
 %%% Local Variables:
 %%% mode: context
 %%% TeX-master: 
 %%% End:
 
 
 
 
 ___
 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: [NTG-context] Metapost label alignment etc.

2006-07-06 Thread Aditya Mahajan
On Wed, 5 Jul 2006, Aditya Mahajan wrote:

  p := textext(\AXIS{z}{3}{Optical Size});
  p := p rotatedaround (z[13], angle(z[5]-z[1])) ;
  % inv tan(1.5/2)
  % Let metapost calculate it for you

  % Ugly kludge
  label(p,z[13]+(0,2labeloffset));

This can be done neatly if one remembers that label is equivalent to 
draw thelabel. Hence,

  p := textext(\AXIS{z}{3}{Optical Size});
  label.top(p,z[13]) rotatedaround (z[13], angle(z[5]-z[1]) ) ;

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


[NTG-context] \bar missing in euler

2006-07-06 Thread Aditya Mahajan
Hi,

%-
\usetypescript[palatino] [ec]
\definetypeface [palatino] [mm] [math] [euler] [euler] [rscale=1.03]
\setupbodyfont[palatino,11pt]

\starttext
$\bar a$
\stoptext
%

gives just a. I do not get any bar over a.

math-eul.tex says

%D This used to be very hackish; it brought in text
%D accents from the well-matched Bitstream Charter.

%D But now, these characters don't exist. I would prefer to pull
%D them from the text font, but  I don't know how.
%D Instead, I'm just pointing to null characters!

:-(

This is how eulervm.sty defines these characters for T1 encoding.

   \DeclareMathAccent{\acute}{\mathalpha}{operators}{1}
   \DeclareMathAccent{\grave}{\mathalpha}{operators}{0}
   \DeclareMathAccent{\ddot}{\mathalpha}{operators}{4}
   \DeclareMathAccent{\tilde}{\mathalpha}{operators}{3}
   \DeclareMathAccent{\bar}{\mathalpha}{operators}{9}
   \DeclareMathAccent{\breve}{\mathalpha}{operators}{8}
   \DeclareMathAccent{\check}{\mathalpha}{operators}{7}
   \DeclareMathAccent{\hat}{\mathalpha}{operators}{2}
   \DeclareMathAccent{\dot}{\mathalpha}{operators}{10}

I do not know what is the equivalent of 'operators' family in context. 
Any idea how to pull them out of the text fonts?

Aditya



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


Re: [NTG-context] Metapost label alignment etc.

2006-07-06 Thread Mojca Miklavec
On 7/6/06, Idris Samawi Hamid wrote:
 Hi, Aditya,

 (I must admit I'm still struggling with mastering Mojca's approach ;-).

I guess that I should read this as please comment your code better next time

 pair diag[]; diag1 = (2,1.25); diag2=(10,-2.5);

I used diag1 to define the translation between the front and the back
face and diag2 to define the translation between the first and the
second cube.

for i=0 upto 1:
 for j=0 upto 1:
   for k=0 upto 1:
 for l=0 upto 1:
   z[i+2j+4k+8l] = (((i,j) scaled a) shifted (diag1 scaled k)
 shifted (diag2 scaled l)) scaled u;
 endfor;
   endfor;
 endfor;
endfor;

i is the counter for x axes: i=0 means left, i=1 means the right point
j is the counter for y axes: j=0 means bottom, j=2 means the upper point

Original point will thus have coordinates (i,j) and we create 4 points
(sorry, I'm leaving out the braces):

z2---z3
| |
z0---z1

k is the counter for z axes: z=0 means the front face, z=1 means the back face

The original point(s) are translated for diag1: shifted (diag1 scaled
k): if k=0, no translation is present, if k=1 it's translated to the
back.

You then get additional 4 poins, namely

z6---z7
| |
z4---z5

traslated for vector diag1 to form the back face.

Finally, you use the counter l for the first and the second cube.
shifted (diag2 scaled l) doesn't do anything if l=0 (shifted (diag
scaled 0) is same as shifted (0,0) which is identity) and
translates the first cube into the second one when l=1.

z[...+8l] will number the points from 0 to 7 (depending on i,j,k) when
l=1 and from 8 to 15 when l=1, so you get the same points with index
of z increased for 8 if you're in the second cube.


 for i=0 upto 3:
 draw z[4i]--z[4i+1]--z[4i+3]--z[4i+2]--cycle;

this will draw:
- z0--z1--z3--z2--cycle (first cube, the front face)
- z4--z5--z7--z6--cycle (first cube, the front face)
- z8--z9--z11--z10--cycle (second cube, the front face)
- z12--z13--z15--z14--cycle (second cube, the front face)

 % small diagonals
 draw z[i]--z[i+4];
 draw z[i+8]--z[i+12];

this will draw
z0--z4, z1--z5, z2--z6, z3--z7: diagonals connecting the front
face with back face and same for the second cube, only for z[index+8]

 draw z[i]--z[i+8];

this will connect the fron face of the first cube with the fron face
of the second cube (+8)

 draw z[i+4]--z[i+12];

same, bu for the back face; this could be done with the first
definition already if 'i' went from 0 to 7 instead from 0 to 3.

 label (textext(Sans Serif),.5[z[3],z[4]]) ;

z3 is the upper right point in the front face and z4 the lower left
point in the back face, .5 is the point in the middle then.

 label (textext(Serif),.5[z[11],z[12]]) ;

z11 and z12 are the same points (3+8 and 4+8) on the second cube.

Hope that helps,
Mojca

(Asymptote does some conversions directly since it supports 3D, but I
never worked with it, most probably because it's not integrated so
well with ConTeXt, although it seems a bit more optimistic in the last
time.)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \bar missing in euler

2006-07-06 Thread Adam Lindsay
Aditya Mahajan wrote:

 gives just a. I do not get any bar over a.

Yup. You seem to be the first to have noticed (or complained), as well.

 This is how eulervm.sty defines these characters for T1 encoding.
 ...

That's the key, though, it apparently pulls in the text accents as well, 
and changes the math definitions depending on the text encoding. That 
seems rather opposite to how ConTeXt *should* work.

 I do not know what is the equivalent of 'operators' family in context. 
 Any idea how to pull them out of the text fonts?

Let's open this up to Hans and Taco: any idea? Much of the finer points 
of \definemathsymbol et al are voodoo to me.

The fourth/sixth arguments of \definemathsymbol insist on a (hex) number 
to be in that slot. Anything else (like \textmacron) is a no-go.

So right now, Euler is limited by the math mechanisms/the encoding of 
the font. I can imagine two solutions of differing hack-ish natures:

1) Allow further expansion in \definemathsymbol:
  \definemathsymbol [breve] [accent] [tf] [\textbreve]

2) Do a hack following LaTeX's imperfect lead:
  \definemathsymbol [breve] [accent] [tf] [15] % for texnansi
   % or
  \definemathsymbol [breve] [accent] [tf] [08] % for ec
  etc.

Advice?
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  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] where have the ol' dam' font was Re: urw garamond for distribution

2006-07-06 Thread andrea valle
Hi to all,
I asked to the list how to know which font are installed on my machine.
The reply was that I cannot guess this info from inside tex, but it  
should be possible to grasp information starting form the distro I use.

(I'm using TeXShop, with Gerben distro on macosx)

So, I was tinkering: can anyone suggest a list of widely used font name  
so that at least I can try to call them from inside ConTeXt and see if  
they are present or not?
I was lucky with Palatino, as an example.


Thanks to all

-a-





On 6 Jul 2006, at 00:50, Aditya Mahajan wrote:

 Hi Peter,

 On Tue, 4 Jul 2006, Peter Münster wrote:

 Hello,

 I've put 3 files into http://pmrb.free.fr/tmp/garamond/ :

 t-garamond.tex
 texnansi-urw-garamond.map
 type-ugm.tex

 Would you put them into the distribution? (would be nice)


 I support the idea of including urw-garamond in the distribution.
 Makes it much easier for font newbies like me to use them :)

 BTW, do you plan to add support for math design font for garamond?
 http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=mathdesign- 
 garamond

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


Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]

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


Re: [NTG-context] \bar missing in euler

2006-07-06 Thread Aditya Mahajan
On Thu, 6 Jul 2006, Adam Lindsay wrote:

 Aditya Mahajan wrote:

 gives just a. I do not get any bar over a.

 Yup. You seem to be the first to have noticed (or complained), as well.

 This is how eulervm.sty defines these characters for T1 encoding.
 ...

 That's the key, though, it apparently pulls in the text accents as well,
 and changes the math definitions depending on the text encoding. That
 seems rather opposite to how ConTeXt *should* work.

 I do not know what is the equivalent of 'operators' family in context.
 Any idea how to pull them out of the text fonts?

 Let's open this up to Hans and Taco: any idea? Much of the finer points
 of \definemathsymbol et al are voodoo to me.

 The fourth/sixth arguments of \definemathsymbol insist on a (hex) number
 to be in that slot. Anything else (like \textmacron) is a no-go.

 So right now, Euler is limited by the math mechanisms/the encoding of
 the font. I can imagine two solutions of differing hack-ish natures:

 1) Allow further expansion in \definemathsymbol:
  \definemathsymbol [breve] [accent] [tf] [\textbreve]

 2) Do a hack following LaTeX's imperfect lead:
  \definemathsymbol [breve] [accent] [tf] [15] % for texnansi
   % or
  \definemathsymbol [breve] [accent] [tf] [08] % for ec
  etc.

I have no knowledge of how Context's font stuff works. The first 
definition looks better to me, as one would not need to worry about 
the encoding while defining symbols (one needs to worry about the 
encoding while defining \textbreve etc, anyway). Though the second 
does have the advantage that it works right away, so there is no need 
to change the definition of \definemathsymbol.

Right now I will use

\definemathsymbol [bar] [accent] [tf] [09]

which seems to work with my present setup.

Thank you.

Aditya

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


[NTG-context] alignment

2006-07-06 Thread Hans van der Meer
Question:  Why does this gives an error	\midaligned{%	\starttabulate[|r|c|l|]	\NC abc \NC : \NC PQR \NC\NR	\NC def \NC : \NC XYZ \NC\NR	\stoptabulate	}! Missing } inserted.inserted text                 }to be read again                    \vskip \whitespace ...\parskip \zeropoint \relax \vskip                                                   \parskip \fi \dofinalstarttabulate ...efloat \else \whitespace                                                   \getvalue {\??tt \currentt...to be read again                    \NC l.22 	\NC          abc \NC : \NC PQR \NC\NRWithout the \midaligned the tabulate works out ok.Hans van der Meer ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] positionoverlays problem

2006-07-06 Thread Hans van der Meer
I want to use the positionoverlay mechanism in several different figures (according to the metafun manual "Anchors and layers").The problem is that the overlays show up in the last figure only, not in the first.If I do not typeset the second overlayseries, the first does appear.It looks like only the last overlayseries is kept.Why is this and how to remedy this?Like this with several names overlay names:	\def\startoverlaygraphics#1{%		\startpositionoverlay{#1}%	}	\def\stopoverlaygraphics#1{%		\stoppositionoverlay		\defineoverlay[#1][\positionoverlay{#1}]		\setupbackgrounds[page][background="">	} Using it in:\startoverlaygraphics{graphics-1}	\setMPpositiongraphic{A1}{syllabus:arrow}{to=B1}etc.\stopoverlaygraphics{graphics-1}...\hpos{A1}{}...\hpos{B1}{}...\startoverlaygraphics{graphics-2}	\setMPpositiongraphic{E1}{syllabus:arrow}{to=F1}etc.\stopoverlaygraphics{graphics-2}...\hpos{E1}{}...\hpos{F1}{}...Arrows drawn with:\setupMPvariables[syllabus:arrow]%	[linestyle={dashed evenly},%		linesize=\tableframethickness,		coloring=FrameColor,%		axoff=0pt, ayoff=0pt, bxoff=0pt, byoff=0pt]\startMPpositiongraphic{syllabus:arrow}{coloring}	pair a, b;	initialize_box(\MPpos{\MPvar{from}});	a := cxy;	initialize_box(\MPpos{\MPvar{to}});	b:= cxy;	pickup pencircle scaled \MPvar{linesize};	drawarrow (a + (\MPvar{axoff},\MPvar{ayoff})) -- 		(b + (\MPvar{bxoff},\MPvar{byoff})) 		\MPvar{linestyle} withcolor \MPvar{coloring};	anchor_box(\MPanchor{\MPvar{from}});\stopMPpositiongraphic\endinputHans van der Meer ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Metapost label alignment etc.

2006-07-06 Thread Idris Samawi Hamid
On Thu, 06 Jul 2006 08:39:04 -0600, Mojca Miklavec  
[EMAIL PROTECTED] wrote:

 On 7/6/06, Idris Samawi Hamid wrote:
 Hi, Aditya,

 (I must admit I'm still struggling with mastering Mojca's approach ;-).

 I guess that I should read this as please comment your code better next  
 time

Thank you so much, Mojca, for your detailed explanations. It really helps  
me (and others for sure) get a handle on things!

All the Best
Idris

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] What to do with math-ext.tex

2006-07-06 Thread David Arnold
All,

I have a file in my document directory called math-ext.tex. Isn't  
this part of the core now? Can I get rid of it?

It starts out like this:

%D \module
%D   [   file=math-ext,
%Dversion=2006.01.14,
%D  title=\CONTEXT\ Math Macros,
%D   subtitle=Extra Macros,
%D author={Hans Hagen \ Taco Hoekwater},
%D   date=\currentdate,
%D  copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%M \ifx\startalign\undefined \input math-ext.tex \fi

% some simple math constructs (based on user requests)
%
% preliminary

\unprotect

% adapted stuff

% we need to make this plain code a bit more 'readable'

\def\openup
   {\afterassignment\dopenup\scratchdimen=}

\def\dopenup
   {\advance\lineskip \scratchdimen
\advance\baselineskip \scratchdimen
\advance\lineskiplimit\scratchdimen}

\def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name)

[EMAIL PROTECTED]

[EMAIL PROTECTED] % \presetdisplayspacing or so
   [EMAIL PROTECTED]
\openup\jot
\mathsurround\zeropoint
\everycr{\noalign{%
   [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 \ifdim\prevdepth-\thousandpoint
   \vskip-\lineskiplimit
   \vskip\normallineskiplimit
 \fi
   \else
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Numbering

2006-07-06 Thread David Arnold
All,

Let's say I have some enumerations that are numbered, for  
definitions, examples, theorems, etc. Let's say I want everything in  
a section numbered consecutively, except figures. So, numbering would  
proceed like this:

Definition 1.1

Where the first number is the section number.

Now, by consecutive, I mean:

Definition 1.1

f(x)=3x+2  (1.2)

Example 1.3

Definition 1.4

Definition 1.5

f(x)=x^2  (1.6)

Figure 1

Example 1.7

Example 1.8

Definition 1.9

Figure 2

etc.

Hope this give the right idea.

Question: What would be the Context Way to go about this?

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


[NTG-context] conversion and formulas

2006-07-06 Thread Aditya Mahajan
Hi,

I have a presentation in which only a few numbered formulas so I 
wanted to number them as (*) (**) etc. The only way I could get that 
to work was

\setupnumber[formula][conversion=set 1]

The natural \setupformulas[conversion=set 1] does not work

Why isn't conversion inherited from \setupformulas? Can this be added 
to core-mat.tex?

\definenumber % \definelabel
   [\v!formula]
   [\c!text=\v!formula,
\c!way=\@@fmway,
\c!blockway=\@@fmblockway,
\c!location=\v!intext,
\c!conversion=\@@fmconversion] %%% New


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


[NTG-context] Stopper not working

2006-07-06 Thread David Arnold
Hans et all,

I don't get my period after item numbers with this file:

\setupoutput[pdf]

\setuplabeltext[question=]

\defineenumeration
[question]
[location=inleft,
text=\labeltext{question},
headcolor=green]

\setupenumerations
[question]
[location=inleft,
headcolor=green,
stopper=.,
way=bysection,
sectionnumber=no]


\starttext
\startquestion
Foo
\stopquestion
\startquestion
Bar
\stopquestion
\startquestion
Baz
\stopquestion
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Stopper not working

2006-07-06 Thread Aditya Mahajan
On Thu, 6 Jul 2006, David Arnold wrote:

 Hans et all,

 I don't get my period after item numbers with this file:

This is because the code for placing stopper is commented in 
core-des.tex. Why?

Add this to your document

\unprotect
\def\domakednnumber
   {\descriptionparameter\c!left
\strut\doshowdnnumber
\descriptionparameter\c!stopper
\descriptionparameter\c!right}

\protect

This may break something else and the line with stopper is commented 
in the code. Another option is to use right=. instead of stopper=.

Aditya

 \setupoutput[pdf]

 \setuplabeltext[question=]

 \defineenumeration
   [question]
   [location=inleft,
   text=\labeltext{question},
   headcolor=green]

 \setupenumerations
   [question]
   [location=inleft,
   headcolor=green,
   stopper=.,
   way=bysection,
   sectionnumber=no]


 \starttext
 \startquestion
 Foo
 \stopquestion
 \startquestion
 Bar
 \stopquestion
 \startquestion
 Baz
 \stopquestion
 \stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context