Re: [NTG-context] arab (omega)

2006-06-25 Thread Taco Hoekwater
Idris Samawi Hamid wrote:
 
of course you should not expect proper kerning when isolation is used  
with latin
 
 Why is this?

A figure id like in 1.2 can have kerning between the 1 and dot,
and the dot and 2. But when it is coded as 1{.}2, it won't.

still messed up: math display formulas, strange number reversion and  
swapping l/r [since omega has bugs with math i'm not sure what is the  
reason]

maybe duncan/idris/taco have an idea
 

It looks like the displays in aleph are a bit broken if you mix RL text
with LR math. I'll have a closer look.


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


[NTG-context] Iwona Heavy and Math

2006-06-25 Thread Aditya Mahajan
Hi,
  I am simply trying out different math fonts available, and found 
iwona-heavy to be strange. Look at the output of

\usetypescript [iwona-heavy][ec]
\setupbodyfont[iwona-heavy,ss,11pt]

\starttext
This is some test
\startformula
   \Pr(A = B) = \frac 12
\stopformula
\stoptext

The math is much bolder than the text. Is this by design?

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


Re: [NTG-context] Iwona Heavy and Math

2006-06-25 Thread Aditya Mahajan
On Sun, 25 Jun 2006, Aditya Mahajan wrote:

 Hi,
  I am simply trying out different math fonts available, and found
 iwona-heavy to be strange. Look at the output of

For greater constrast try

\usetypescript [iwona-heavy][ec]
\setupbodyfont[iwona-heavy,ss,11pt]

\starttext
This is some test
$
   \Pr(A = B) = \frac ab
$
\stoptext

 The math is much bolder than the text. Is this by design?
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Calligraphic Font with palatino and euler

2006-06-25 Thread Aditya Mahajan
On Tue, 13 Jun 2006, Aditya Mahajan wrote:

 On Sat, 8 Apr 2006, Aditya Mahajan wrote:

 Hi,
  When I use palatino and euler, I do not get calligraphic font. How
 can I define a typescript to use the calligraphic font from lm.

 This is my setup

 \definetypeface [pal] [rm] [serif] [palatino]
 [default] [encoding=texnansi]

 \definetypeface [pal] [tt] [mono]  [modern]
 [default] [encoding=texnansi,rscale=1.1]

 \definetypeface [pal] [ss] [sans]  [modern]
 [default] [encoding=texnansi,rscale=1.1]

 \definetypeface [pal] [mm] [math]  [euler]
 [euler]   [rscale=1.03]

 \setupbodyfont[pal,10pt]
 \starttext
 ${\cal A}A {\cal B}B$
 \stoptext

 I still do not know what is why calligraphic letters do not come out
 correctly with euler, but the following definition works

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

 \def\mathcal#1{\text{\definedfont[cmsy10]#1\/}}

 and then I can use \mathcal{A} etc.

The caligraphic letters for Euler are defined in eusm (Euler Script). 
For some reason this is not loaded in context. The following works

\definefontsynonym [EulerScript] [eusm10]

\def\mathcal#1{\text{\definedfont[EulerScript]#1\/}}

Why is eusm not used with \cal? Context uses zeusm10 as the sy font 
and zeusm should contain eusm (atleast this is what I understand from 
ftp://tug.ctan.org/pub/tex-archive/fonts/eulervm/source/latex/eulervm/fontinst/fontevm.tex)
What is missing from math-eul.tex?

Aditya

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


Re: [NTG-context] Iwona Heavy and Math

2006-06-25 Thread Taco Hoekwater
Aditya Mahajan wrote:
 On Sun, 25 Jun 2006, Aditya Mahajan wrote:
 
 
Hi,
 I am simply trying out different math fonts available, and found
iwona-heavy to be strange. Look at the output of
 
 
The relevant definition block is missing from type-syn.tex:


\starttypescript [sans] [iwona-heavy] [name]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [Iwona-Heavy] 
[encoding=\typescriptthree]
   \definefontsynonym [SansItalic] [Iwona-HeavyItalic] 
[encoding=\typescriptthree]
   \definefontsynonym [SansBold]   [Iwona-Heavy] 
[encoding=\typescriptthree]
   \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] 
[encoding=\typescriptthree]
   \definefontsynonym [SansCaps]   [Iwona-CapsHeavy] 
[encoding=\typescriptthree]
   \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic] 
[encoding=\typescriptthree]
   \definefontsynonym [SansBoldCaps]   [Iwona-CapsHeavy] 
[encoding=\typescriptthree]
   \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] 
[encoding=\typescriptthree]
\stoptypescript
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Newbie questions

2006-06-25 Thread Mojca Miklavec
On 6/24/06, Thomas Moore wrote:
 1.  I have successfully set up a doublesided layout that has a text
 column and an outer margin for margin notes and some small figures. I
 would like to set up a header that has the chapter number and name
 (e.g.  3. Third Chapter Name) on the inner edge of the text column,
 and the page number aligned with the *outer* edge of the margin and a
 1-pt rule below the entire header (from below the chapter number to
 below the page number). How would one do this elegantly (or even
 inelegantly)?

First forget about the wrong pagenumber positioning. Here's the most
elegant solution for drawing the line:

\setuppagenumbering
[alternative=doublesided,
 location=]

\setupheadertexts
[pagenumber]
[chapter]
[chapter]
[pagenumber]

\setuplayout
[header=15pt,
 headerdistance=20pt]

\setupbackgrounds
[header]
[text]
[bottomframe=on,
 rulethickness=1pt]

\starttext
\chapter{first}
\dorecurse{50}{\input tufte }
\chapter{second}
\dorecurse{20}{\input tufte }
\stoptext

But I don't know if there's a simple extention to it to draw the
missing line inbetween.


Here's another solution, which is the wrong way of doing things (it's
way too slow and meant for more complex things than a simple rule, but
could be optimezed if useMPgraphic was replaced with reusable or
unique). Also try \showlayout and see meta-pag.tex in the ConTeXt
source.

\startuseMPgraphic{PageFrame}
  StartPage ;
  y1=y2=PaperHeight-TopSpace-HeaderHeight;

  if OnRightPage :
x2 = BackSpace+TextWidth = x1 + LeftMarginDistance +
LeftMarginWidth + TextWidth;
  else:
x2 = BackSpace = x1 - (RightMarginDistance + RightMarginWidth + TextWidth);
  fi;
draw z1--z2 withpen pencircle scaled 1pt;
  StopPage;
\stopuseMPgraphic

\defineoverlay
[PageFrame][\useMPgraphic{PageFrame}]

\setupbackgrounds
[page]
[background=PageFrame]


The trird solutions is probably the way to go, but it influences only
a single page and \getmarking[chapter] has no influence. I guess that
a minor modification is needed to handle both left  right page
properly and to put that layer over all pages, not only on the  first
one:

\definelayer
[page]
[width=\paperwidth,
 height=\paperheight]
\setupbackgrounds
[page]
[background=page]
\setlayerframed
[page]
[voffset=\topspace,
 
hoffset=\the\dimexpr\backspace-\leftmarginwidth-\leftmargindistance\relax,
 preset=lefttop]

[width=\the\dimexpr\textwidth+\leftmarginwidth+\leftmargindistance\relax,
 rulethickness=1pt,
 frame=off,
 bottomframe=on]
{\pagenumber\hfill\getmarking[chapter][first]}

Hoping that someone can fix at least one of the solutions above to
work as intended,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] continuous numbering of subsection

2006-06-25 Thread Ulf Martin
Dear ConTeXt Experts

I am still sometimes confused about how to set up simple things...

I want to have a subsection level head type (topic) with a numbering 
that runs undependently from the section numbering, like so:

1. First Topic
...

I. Section One
...

2. Second Topic
...

3. Third Topic
...

4. Fourth Topic
...

II. Section Two

5. Fifth Topic
...

6. Sixth Topic
...

III. Section Three
...

And so on.

ConTeXtgarden, the manual, etc. show in great detail how to set up the 
/appearence/ of head parts (incl. numbercommand), but I cannot find an 
explanation of the handling of the LaTeX equivalent to counters (their 
definition, incrementing, resetting, etc.). The explanation of 
\setupheadnumber in the manual (p. 172) is quite obscure to me -- how do 
I specify that I do not want higher levels of head to reset my numbering?

Thank you!
Ulf Martin



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


Re: [NTG-context] arab (omega)

2006-06-25 Thread Hans Hagen
Idris Samawi Hamid wrote:
 I found the problem:

 In uni2cuni.otp the numbering handling does two things:

 It DOES isolate non-numerals as separators within a given expression. So  
 placing an Arabic letter between two numbers

 5792ر684

 processes fine; each individual number gets reversed.

 But the otp makes exceptions for the following punctuation:

 + - .

 If we get rid of those exceptions the separator problem will go away. But  
 then math will be messed up. The problem is that the

 + - .

 are ambiguous; sometimes they have a mathematical significance; sometimes  
 a separator significance. We need the exception for math (generally done  
 the usual l-r way) but don't need it for separators (done in the r-l way).
   
isn't it simplier then to disable otp's in math mode
 What I could do is define two filter sequences: UTFArabic and  
 UTFArabicMath. Hans, could you do a conditional that calls up one in math  
 mode and the other everywhere else?
   

\appendtoks
 reset otps 
intialize other sequence of thenm 
\to \everymathematics
 This is a stop-gap solution until we replace otp's with something smarter.  
 Taco, Hans, let me know what you think before I work on this.

 It is really inefficient to have to define an entire ot stack just to  
 change one otp. There must be a better way to abtract things so we can  
 plug a given otp without redoing the entire stack.
   
i suppose that switching is fast, so using a different stack was what came on 
my mind first

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
-

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


Re: [NTG-context] Iwona Heavy and Math

2006-06-25 Thread Hans Hagen
Taco Hoekwater wrote:
 Aditya Mahajan wrote:
   
 On Sun, 25 Jun 2006, Aditya Mahajan wrote:


 
 Hi,
 I am simply trying out different math fonts available, and found
 iwona-heavy to be strange. Look at the output of
   
 
 The relevant definition block is missing from type-syn.tex:

   
ok, added 


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
-

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


Re: [NTG-context] Calligraphic Font with palatino and euler

2006-06-25 Thread Hans Hagen
Taco Hoekwater wrote:
 Aditya Mahajan wrote:
   
 Why is eusm not used with \cal? Context uses zeusm10 as the sy font 
 and zeusm should contain eusm (atleast this is what I understand from 
 ftp://tug.ctan.org/pub/tex-archive/fonts/eulervm/source/latex/eulervm/fontinst/fontevm.tex)
 What is missing from math-eul.tex?
 

 Not missing, but it has a few wrong definitions. It contains

\definemathcharacter [A]   [nothing] [mr] [41]

 but that should be :

\definemathcharacter [A]   [alpha] [mr] [41]
   
ok, i made those few (2*26) changes 

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
-

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


Re: [NTG-context] Newbie questions

2006-06-25 Thread Hans Hagen
Thomas Moore wrote:
 The Six Ideas texts (first edition) were typeset as AppleWorks  
 drawings, if you can believe it. To go to the third edition, I have  
 to migrate to something more modern -- either InDesign or something  
 TeX-based. Problems with figure and equation references, indexing  
 issues, and inconsistent styles were driving me crazy with  
 AppleWorks, and many of these problems would persist in InDesign. I  
 have also been having difficulty setting up mathematics in a  
 satisfactory way. On the other hand, I am a very visual thinker, and  
 I don't remember commands well, so even ConTexT (which seems a lot  
 simpler than LaTeX) is a big stretch for me. We will see...
   
it's a stepwise process 

- first set up a basic page style (next time in a big bookshop i'll take a look 
at the series) and set up a font; that way you get an idea how well things will 
fit  

- then develop the structure + associated style mapping while writing (or 
converting) 

ask yourself: 

- do i need to render this differently
- do i get the feeling that i enter too much code

if so, then add structure 

This is how context itself evolved (after all, it was written in an educational 
context where structure, reuse etc is important). Just don't try to make up the 
style at the beginning, polishing it every now and then is a nice distraction.  

Also, using metapost for the graphics is fun in itself (and may save you lots 
of time). 

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
-

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


Re: [NTG-context] arab (omega)

2006-06-25 Thread Hans Hagen
Idris Samawi Hamid wrote:
 Why is this?

   
tex itself does things, like with fi not being the same as f{}i [no lig 
building] and since otp's may insert things as well abc may different 
may differen from a{}b{}c (i must admit that i don't know when an otp 
stops scanning, i suppose at an unexpandable thingie

(taco knows where what matters -)
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
-

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


Re: [NTG-context] continuous numbering of subsection

2006-06-25 Thread Hans Hagen
Ulf Martin wrote:
 Dear ConTeXt Experts

 I am still sometimes confused about how to set up simple things...

 I want to have a subsection level head type (topic) with a numbering 
 that runs undependently from the section numbering, like so:

 1. First Topic
 ...

 I. Section One
 ...

 2. Second Topic
 ...

 3. Third Topic
 ...

 4. Fourth Topic
 ...

 II. Section Two

 5. Fifth Topic
 ...

 6. Sixth Topic
 ...

 III. Section Three
 ...

 And so on.

 ConTeXtgarden, the manual, etc. show in great detail how to set up the 
 /appearence/ of head parts (incl. numbercommand), but I cannot find an 
 explanation of the handling of the LaTeX equivalent to counters (their 
 definition, incrementing, resetting, etc.). The explanation of 
 \setupheadnumber in the manual (p. 172) is quite obscure to me -- how do 
 I specify that I do not want higher levels of head to reset my numbering?
   

i admit that it's a bit fuzzy ... (some day i'll make this more 
transparent)

\setuphead   [chapter][resetnumber=no]
\setupsection[section][previousnumber=no]

\chapter{Section One}
\section{Second Topic}
\section{Third Topic}
\section{Fourth Topic}

\chapter{Section Two}
\section{Fifth Topic}
\section{Sixth Topic}

\chapter{Section Three}

\stoptext


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

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


Re: [NTG-context] Newbie questions

2006-06-25 Thread Hans Hagen
Mojca Miklavec wrote:

 \definelayer
   [page]
   [width=\paperwidth,
height=\paperheight]
 \setupbackgrounds
   [page]
   [background=page]
 \setlayerframed
   [page]
   [voffset=\topspace,

 hoffset=\the\dimexpr\backspace-\leftmarginwidth-\leftmargindistance\relax,
preset=lefttop]
   
 [width=\the\dimexpr\textwidth+\leftmarginwidth+\leftmargindistance\relax,
rulethickness=1pt,
frame=off,
bottomframe=on]
   {\pagenumber\hfill\getmarking[chapter][first]}

 Hoping that someone can fix at least one of the solutions above to
 work as intended,
   

ok, here is a trick:


\definelayer
  [page]
  [hoffset=\the\dimexpr\backspace-
 \leftmarginwidth-\leftmargindistance\relax,
   voffset=\topspace,
   width=\paperwidth,
   height=\paperheight]

\setupbackgrounds
  [page]
  [background=page]

\startsetups page:setup

\setlayerframed
  [page]
  [preset=lefttop]
  [width=\dimexpr\textwidth+\leftmarginwidth+\leftmargindistance\relax,
   rulethickness=1pt,
   frame=off,
   bottomframe=on]
 {\pagenumber\hfill\getmarking[chapter][first]}

\stopsetups

\setupheadertexts
  [\setups{page:setup}]

so, 

- makea setup (clean) 
- hook it into something that is done each page (maybe i should cook up a hook 
for that) 

now, the left right page problem is up to you ... keep in mind that we have 

\setupbackgrounds
  [leftpage]
  [...]

\setupbackgrounds
  [rightpage]
  [...]




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

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


Re: [NTG-context] Calligraphic Font with palatino and euler

2006-06-25 Thread Aditya Mahajan
On Sun, 25 Jun 2006, Hans Hagen wrote:

 Taco Hoekwater wrote:
 Aditya Mahajan wrote:

 Why is eusm not used with \cal? Context uses zeusm10 as the sy font
 and zeusm should contain eusm (atleast this is what I understand from
 ftp://tug.ctan.org/pub/tex-archive/fonts/eulervm/source/latex/eulervm/fontinst/fontevm.tex)
 What is missing from math-eul.tex?


 Not missing, but it has a few wrong definitions. It contains

\definemathcharacter [A]   [nothing] [mr] [41]

 but that should be :

\definemathcharacter [A]   [alpha] [mr] [41]

 ok, i made those few (2*26) changes

Thanks, no need for home brewed recipies for Euler anymore :)

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


Re: [NTG-context] Iwona Heavy and Math

2006-06-25 Thread Aditya Mahajan
On Sun, 25 Jun 2006, Taco Hoekwater wrote:

 Aditya Mahajan wrote:
 On Sun, 25 Jun 2006, Aditya Mahajan wrote:


 Hi,
 I am simply trying out different math fonts available, and found
 iwona-heavy to be strange. Look at the output of


 The relevant definition block is missing from type-syn.tex:


 \starttypescript [sans] [iwona-heavy] [name]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [Iwona-Heavy]
 [encoding=\typescriptthree]
   \definefontsynonym [SansItalic] [Iwona-HeavyItalic]
 [encoding=\typescriptthree]
   \definefontsynonym [SansBold]   [Iwona-Heavy]
 [encoding=\typescriptthree]
   \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic]
 [encoding=\typescriptthree]
   \definefontsynonym [SansCaps]   [Iwona-CapsHeavy]
 [encoding=\typescriptthree]
   \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic]
 [encoding=\typescriptthree]
   \definefontsynonym [SansBoldCaps]   [Iwona-CapsHeavy]
 [encoding=\typescriptthree]
   \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic]
 [encoding=\typescriptthree]
 \stoptypescript

Thanks, this looks more consistent

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


Re: [NTG-context] continuous numbering of subsection

2006-06-25 Thread Ulf Martin
Hi

Hans Hagen schrieb:
  \setuphead   [chapter][resetnumber=no]
  \setupsection[section][previousnumber=no]

Ok, I undestand. I apologise that my example was too short. I'd like to 
have things more flexible:

If an arbitrary and irregular number of levels is introduced (sections, 
subsections, etc., numbered hierarchically as usual), the topic 
numbering should remain continuous and unaffected
(that's why I thought, a separate definition, as in 
\definehead[topic][...], would be appropriate).

Conceptually, though, topic is a section-like subdivision, so, for 
example, should appear in the TOC.

This is typical e.g. in (German) law texts (here with § as a topic 
marker but this is not the point), Example:

I. ... Chapter
 § 1 ...
1 ... Section
 § 2 ...  Topic in section
  1.1 ... Subsection
 § 3 ...  Topic in subsection
 § 4 ...
  1.2  ...
 § 5 ...
2 ...
 § 6 ...
 § 7 ...
  2.1  ...
 § 8 ...
II. ...
 § 9 ...  Topic in chapter
1 ...
 § 10 ...
 § 11 ...
  1.1  ...
 § 12 ...

Of course, referencing, entry in TOC, index etc. should be correct.

It would be even more preferable if one could attach the topic 
numbering to a specified level, say, chapters. The above example then 
would become:

I. ... Chapter
 § 1 ...  Topic in chapter
1 ... Section
 § 2 ...  Topic in section
  1.1 ... Subsection
 § 3 ...  Topic in subsection
 § 4 ...
  1.2  ...
 § 5 ...
2 ...
 § 6 ...
 § 7 ...
  2.1  ...
 § 8 ...
II. ...
 § 1 ...  First topic in second chapter
1 ...
 § 2
 § 3
  1.1  ...
 § 4  ...


Thank you  sorry for the incomplete first question!
Ulf


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


Re: [NTG-context] arab (omega)

2006-06-25 Thread Idris Samawi Hamid
On Sun, 25 Jun 2006 02:08:37 -0600, Taco Hoekwater [EMAIL PROTECTED]  
wrote:

 My guess is you could just remove the punctuation support from the
 current OTP. If a user really needs to say 1.2 million, (s)he can
 just write  $1.2$ instead, which is more or less standard TeX
 practice anyway.

 It is my understanding that the contents of $$ is unaffected by
 OTPs (and if it is not, it should be made so. Math is a language
 on its own).

ok, it's done. The new ocp is here:  
http://wiki.contextgarden.net/images/2/27/Uni2cuni.zip

and the instructions are here:

http://wiki.contextgarden.net/Aleph_Guide#Installing

Now, in normal text, +, -, and . are treated as separators, not plus sign,  
minus, and decimal point. If you want math use $$ etc. but then you will  
get the math font not omarb (which is standard practice in the  
Arabic-script world).

I have no idea if this affects Hans' solution (have not upgraded yet);  
this is all experimental so things may change.

An aside: Classical Arabic is more sensical. Consider the number 3721. In  
classical Arabic one says, one and twenty and and seven hundred and three  
thousand, which makes much more sense for a r-l language. So one would  
write the numeral from r to l and it would look the same. How decimals  
would be handled in the classical case needs a bit of research

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


Re: [NTG-context] arab (omega)

2006-06-25 Thread Idris Samawi Hamid
On Sun, 25 Jun 2006 10:01:03 -0600, Hans Hagen [EMAIL PROTECTED] wrote:

 isn't it simplier then to disable otp's in math mode
 What I could do is define two filter sequences: UTFArabic and
 UTFArabicMath. Hans, could you do a conditional that calls up one in  
 math
 mode and the other everywhere else?


 \appendtoks
  reset otps 
 intialize other sequence of thenm
 \to \everymathematics

Sometimes someone may want to use the numerals from the omarb in a  
mathematical context so this may still be useful. Will work on it...

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] Clipping again

2006-06-25 Thread David Arnold
Hi,

I confess I got some earlier advice on this issue, but I've never  
been able to apply it to find a resolution. In the buffer that  
follows, I define a clipping box:

% clipping path
path cpath;
cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle;
cpath:=cpath scaled 1u;

A function is created and scaled:

% scale and draw graph
P:=P scaled u;
draw P withcolor blue;

The picture is clipped and saved:

% clip and save current picture
picture pic;
clip currentpicture to cpath;
pic:=currentpicture;

Then it is redrawn later.

% redraw line
draw pic;

Unfortunately, even though this works, mathematicians really want  
arrows at each end of the graph. Easy enough to do with drawdblarrow  
P withcolor blue, but the arrows then get clipped. What I really need  
is to adapt the code below so that my function is clipped to the  
boundary box, but then redrawn with arrows at each end of it. If  
anyone can adjust my code to do that, it would be much appreciated,  
and it would break down a barrier I've faced for years with metapost  
coding.

Note that I've tried some stuff with cutbefore and cutafter with some  
success. But I should remark that the code below is generated by a  
perl script and some special coding we've set up to generate these  
graphics on the fly for student quizzes. This is not a situation  
where I can tweak an individual plot or two. Rather, our script might  
generate 100 sets of the code below, all with different parameters.  
So this magnifies the problem.

Again, any ideas would be greatly appreciated.





\startbuffer
numeric w,h;
w=4cm;h=4cm;
% inititialize numerator and denominator of the slope of f
numeric a;
a=2;

% initialize choice of function
numeric choice;
choice=1;

% initialize type of reflection
numeric reflect;
reflect=2;

% define linear function f
vardef f(expr x)=
a*x*x
enddef;

% define linear function g
vardef g(expr x)=
a*abs(x)
enddef;

% define linear function h
vardef h(expr x)=
a*x*(x-2)*(x+2)/2
enddef;

% define paths for functions f, g, and h, respectively
path P, F, G, H;

F:=(-5,f(-5));
for x=-5 step .1 until 5:
F:=F--(x,f(x));
endfor;

G:=(-5,g(-5));
for x=-5 step .1 until 5:
G:=G--(x,g(x));
endfor;

H:=(-5,h(-5));
for x=-5 step .1 until 5:
H:=H--(x,h(x));
endfor;

% choose the function to use, f, g, or h
if (choice=1):
P:=F;
elseif (choice=2):
P:=G;
else:
P:=H;
fi;

% choose the type of reflection
if (reflect=1):
P:=P;
elseif (reflect=2):
P:=P reflectedabout((0,0),(1,1));
elseif (reflect=3):
P:=P reflectedabout((0,0),(1,-1));
else:
P:=P reflectedabout((-1,0),(1,0));
fi;

% initialize scale
numeric u; 10u=w;

% scale and draw graph
P:=P scaled u;
draw P withcolor blue;

% clipping path
path cpath;
cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle;
cpath:=cpath scaled 1u;

% clip and save current picture
picture pic;
clip currentpicture to cpath;
pic:=currentpicture;

% erase currentpicture
currentpicture:=nullpicture;

% draw grid
for k=-5u step 1u until 5u:
draw (-5u,k)--(5u,k) withcolor mygridcolor;
draw (k,-5u)--(k,5u) withcolor mygridcolor;
endfor;

% draw axes
drawarrow (-5u,0)--(5u,0);
drawarrow (0,-5u)--(0,5u);

% label axes
label.rt(btex $x$ etex, (5.2u,0));
label.top(btex $y$ etex, (0,5.2.u));
label.bot(btex $5$ etex, (5u,0));
label.lft(btex $5$ etex, (0,5u));

% redraw line
draw pic;

% draw vertical line test
numeric xvert;
if (reflect=3):
xvert:=-1;
else:
xvert:=1;
fi;

% vertical line
path vert;
vert:=(xvert,-5)--(xvert,5);
vert:=vert scaled u;

pickup pencircle scaled 2pt;
drawdblarrow vert withcolor red;
pickup defaultpen;

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


Re: [NTG-context] Clipping again

2006-06-25 Thread Mojca Miklavec
On 6/25/06, David Arnold wrote:
 Unfortunately, even though this works, mathematicians really want
 arrows at each end of the graph. Easy enough to do with drawdblarrow
 P withcolor blue, but the arrows then get clipped. What I really need
 is to adapt the code below so that my function is clipped to the
 boundary box, but then redrawn with arrows at each end of it. If
 anyone can adjust my code to do that, it would be much appreciated,
 and it would break down a barrier I've faced for years with metapost
 coding.

Just for clarification: What would you do with a mexican hat
(x^4-4*x^2+4, y between 0 and 3) it if would cut the boundary 4 times?
Use 4 arrows or just the two at the end?

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


[NTG-context] inside halign

2006-06-25 Thread Hans van der Meer
This works:\def\dodotablexrule[#1][#2]{\noalign{\color[#2]{\hrule height#1 [EMAIL PROTECTED]But doing inside halign (tables) things like:\def\tablexrule{\dodoubleargument\dotablexrule}\def\dotablexrule[#1][#2]{%	\doifemptyelse{#2}%		{\dodotablexrule[#1][\@@tbxframecolor]}%		{\dodotablexrule[#1][#2]}%	}\def\dodotablexrule[#1][#2]{\noalign{\color[#2]{\hrule height#1 [EMAIL PROTECTED]I get the error:	! Misplaced \noalign.\dodotablexrule [#1][#2]-\noalign                                    {\color [#2]{\hrule height#1 depth\z@ }}I get the impression that none if these argument related stuff works inside the halign template.Is there a remedy? Or do I just have to give up hope using a unified macro and will have to resort  to separate macro's for default/chosen parameters? Hans van der Meer ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] arab (omega)

2006-06-25 Thread Idris Samawi Hamid
Dear gang,

I have redone this. Now there are two filter sequences, one for main text  
and one for using the arabic-font digits in math mode.

http://wiki.contextgarden.net/Aleph_Guide#Installing

has been updated, get the new uni2cuni.zip. I'll update m-gamma soon so  
this will be part of the distro if Hans accepts-)

Here is a test file that works here. Note (see the sqrt example) that  
omarb apparently does not have U+066B, the Arabic decimal point. And the  
Arabic comma maps to the lm comma in math mode (since omarb maps the  
arabic comma to U+002C in the omarb virtual
font-sigh). So there is further work needed to get this all just right,  
including recompiling the fonts etc...

Best
Idris

==
% tex=aleph output=dvipdfmx

\usetypescriptfile[type-omg]
\usetypescript[OmegaArab]
\hoffset=0pt

%% Individual Filters
% Input filters (from what you type)
\definefiltersynonym [UTF8]  [inutf8]

% Contextual filter
\definefiltersynonym [UniCUni][uni2cuni]

\definefiltersynonym [UniCUniMath][uni2cuni-math]

% Output filters (font mapping)
\definefiltersynonym [CUniArab]   [cuni2oar]

%% Filter Sequences
\definefiltersequence
   [UTFArabic]
   [UTF8,UniCUni,CUniArab]

\definefiltersequence
   [UTFArabicMath]
   [UTF8,UniCUniMath,CUniArab]

\appendtoks
 \clearocplists
 \usefiltersequence[UTFArabicMath]
\to \everymathematics

% For global Arabic script

\def\ArabicDirGlobal{%
\pagedir TRT\bodydir TRT\textdir TRT\pardir TRT }%

\def\ArabicUTF{\ArabicDirGlobal\usefiltersequence[UTFArabic]
 \reversesectionnumberstrue\switchtobodyfont[omarb]}

\ArabicUTF

\starttext

5792-684 $5792-684$ ${\tf 5792-684}$

2.5 $\sqrt{\tf 2.5}$

2,5 $\sqrt{\tf 2،5}$ $\sqrt{\tf 2,5}$

\stoptext
==

On Sun, 25 Jun 2006 11:38:37 -0600, Idris Samawi Hamid  
[EMAIL PROTECTED] wrote:

 On Sun, 25 Jun 2006 02:08:37 -0600, Taco Hoekwater [EMAIL PROTECTED]
 wrote:

 My guess is you could just remove the punctuation support from the
 current OTP. If a user really needs to say 1.2 million, (s)he can
 just write  $1.2$ instead, which is more or less standard TeX
 practice anyway.

 It is my understanding that the contents of $$ is unaffected by
 OTPs (and if it is not, it should be made so. Math is a language
 on its own).

 ok, it's done. The new ocp is here:
 http://wiki.contextgarden.net/images/2/27/Uni2cuni.zip

 and the instructions are here:

 http://wiki.contextgarden.net/Aleph_Guide#Installing

 Now, in normal text, +, -, and . are treated as separators, not plus  
 sign,
 minus, and decimal point. If you want math use $$ etc. but then you will
 get the math font not omarb (which is standard practice in the
 Arabic-script world).

 I have no idea if this affects Hans' solution (have not upgraded yet);
 this is all experimental so things may change.

 An aside: Classical Arabic is more sensical. Consider the number 3721. In
 classical Arabic one says, one and twenty and and seven hundred and  
 three
 thousand, which makes much more sense for a r-l language. So one would
 write the numeral from r to l and it would look the same. How decimals
 would be handled in the classical case needs a bit of research

 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


Re: [NTG-context] Clipping again

2006-06-25 Thread David Arnold
Mojca,

Good question of course.

However, I am using this for intermediate algebra students so the  
graphs will be lines, absolute value, quadratics, polynomials,  
rational functions, radical functions, exponential and logarithmic  
functions.

In each case, I would adjust the window to see all important behavior  
of the function, extrema, etc. So, for example, if I needed to draw  
y=12-x^2, I would not clip this to the boundary (-10,-10)--(10,-10)-- 
(10,10)--(-10,10)--cycle, because that would chop off the top of the  
parabola, and if I added arrows, it would look like I had two  
branches. Rather, I might clip y=12-x^2 to the boundary (-10,-20)-- 
(10,-20)--(10,20)--(-10,20)--cycle in order to see the turning  
point of the parabola.

That is, I would choose a boundary that would present arrow heads at  
each end of the curve. In the case of rational functions, I would  
clip each branch separately.

I hope this answers the question.

Thanks.

On Jun 25, 2006, at 12:37 PM, Mojca Miklavec wrote:

 On 6/25/06, David Arnold wrote:
 Unfortunately, even though this works, mathematicians really want
 arrows at each end of the graph. Easy enough to do with drawdblarrow
 P withcolor blue, but the arrows then get clipped. What I really need
 is to adapt the code below so that my function is clipped to the
 boundary box, but then redrawn with arrows at each end of it. If
 anyone can adjust my code to do that, it would be much appreciated,
 and it would break down a barrier I've faced for years with metapost
 coding.

 Just for clarification: What would you do with a mexican hat
 (x^4-4*x^2+4, y between 0 and 3) it if would cut the boundary 4 times?
 Use 4 arrows or just the two at the end?

 Mojca
 ___
 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] Clipping again

2006-06-25 Thread Mojca Miklavec
On 6/25/06, David Arnold wrote:
 That is, I would choose a boundary that would present arrow heads at
 each end of the curve. In the case of rational functions, I would
 clip each branch separately.

 I hope this answers the question.

So that necessary means an arrowhead each time when a function crosses
the boundary if I understand correctly (i.e. 1/x would have 4
arrowheads)?

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


Re: [NTG-context] Clipping again

2006-06-25 Thread Hans Hagen
David Arnold wrote:
 Hi,

 I confess I got some earlier advice on this issue, but I've never  
 been able to apply it to find a resolution. In the buffer that  
 follows, I define a clipping box:

 % clipping path
 path cpath;
 cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle;
 cpath:=cpath scaled 1u;

 A function is created and scaled:

 % scale and draw graph
 P:=P scaled u;
 draw P withcolor blue;

 The picture is clipped and saved:

 % clip and save current picture
 picture pic;
 clip currentpicture to cpath;
 pic:=currentpicture;

 Then it is redrawn later.

 % redraw line
 draw pic;

 Unfortunately, even though this works, mathematicians really want  
 arrows at each end of the graph. Easy enough to do with drawdblarrow  
 P withcolor blue, but the arrows then get clipped. What I really need  
 is to adapt the code below so that my function is clipped to the  
 boundary box, but then redrawn with arrows at each end of it. If  
 anyone can adjust my code to do that, it would be much appreciated,  
 and it would break down a barrier I've faced for years with metapost  
 coding.

 Note that I've tried some stuff with cutbefore and cutafter with some  
 success. But I should remark that the code below is generated by a  
 perl script and some special coding we've set up to generate these  
 graphics on the fly for student quizzes. This is not a situation  
 where I can tweak an individual plot or two. Rather, our script might  
 generate 100 sets of the code below, all with different parameters.  
 So this magnifies the problem.
   
as you sat, the basics are in: 

P := (P cutbefore cpath) ;
P := (P cutafter cpath) ;
drawdblarrow P withcolor green;

it should not be too hard for a mathematician to make sure that this works ok; 
i think that as long as one makes sure that the directions are  right (do a 
reverse P if needed) 

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
-

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


[NTG-context] INstall minimal context system.

2006-06-25 Thread John R. Culleton
I downloaded the justtex.zip and the context-linux.zip files
into a work directory /usr/local/cont and unzipped them. Then I
cd to the tex directory under that work directory. I made the  
the setuptex file executable and executed it with no apparent
effect. Then I changed the path to point to
/usr/local/cont/tex/texmf-linux/bin and ran mktexlsr. It followed
the new path. I ran texexec --make --alone and it seemed to be
successful. Ran mktexlsr again. Then I ran a test program in
another directory. It could not find cont-en.fmt. In fact this
file or anything similar to this file does not exist in this
tree, although it existed in my previous tetex tree and exists in
my texlive tree. 

How do I create and/or download this file?

-- 
John Culleton


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


Re: [NTG-context] INstall minimal context system.

2006-06-25 Thread Idris Samawi Hamid
On Sun, 25 Jun 2006 17:27:41 -0600, John R. Culleton  
[EMAIL PROTECTED] wrote:

 I downloaded the justtex.zip and the context-linux.zip files
 into a work directory /usr/local/cont and unzipped them. Then I
 cd to the tex directory under that work directory. I made the
 the setuptex file executable and executed it with no apparent
 effect. Then I changed the path to point to
 /usr/local/cont/tex/texmf-linux/bin and ran mktexlsr. It followed
 the new path. I ran texexec --make --alone and it seemed to be
 successful.

Just a guess: since you used the --alone switch, is there a path to the  
current directory from which you invoked
texexec --make --alone

Without the --alone switch the fmt file should go into \texmf-linux\web2c  
or \texmf-linux\web2c\pdfetex, depending on your texexec.ini setup.

(I use Windows but the principle should be the same)

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


Re: [NTG-context] Clipping again

2006-06-25 Thread David Arnold
Not necessary. Let me add comments to my code in places where I need  
help. My comments are marked with [DA 6/25].

\startbuffer
numeric w,h;
w=4cm;h=4cm;
% inititialize numerator and denominator of the slope of f
numeric a;
a=1.5;

% initialize choice of function
numeric choice;
choice=2; %=[DA 6/25]Test to see if code  
works for 1, 2, or 3.

% initialize type of reflection
numeric reflect;
reflect=3;   %==[DA 6/25]Test to see if code  
works for 1, 2, 3, or 4

% define linear function f
vardef f(expr x)=
a*x*x
enddef;

% define linear function g
vardef g(expr x)=
a*abs(x)
enddef;

% define linear function h
vardef h(expr x)=
a*x*(x-2)*(x+2)/2
enddef;

% define paths for functions f, g, and h, respectively
path P, F, G, H;

F:=(-5,f(-5));
for x=-5 step .1 until 5:
F:=F--(x,f(x));
endfor;

G:=(-5,g(-5));
for x=-5 step .1 until 5:
G:=G--(x,g(x));
endfor;

H:=(-5,h(-5));
for x=-5 step .1 until 5:
H:=H--(x,h(x));
endfor;

% choose the function to use, f, g, or h
if (choice=1):
P:=F;
elseif (choice=2):
P:=G;
else:
P:=H;
fi;

% choose the type of reflection
if (reflect=1):
P:=P;
elseif (reflect=2):
P:=P reflectedabout((0,0),(1,1));
elseif (reflect=3):
P:=P reflectedabout((0,0),(1,-1));
else:
P:=P reflectedabout((-1,0),(1,0));
fi;

% initialize scale
numeric u; 10u=w;

% scale and draw graph
P:=P scaled u;
draw P withcolor blue;

% clipping path
path cpath;
cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle;
cpath:=cpath scaled 1u;


%[DA 6/25]Replace this code from here to next mark with new  
clipping routine
% clip and save current picture
picture pic;
clip currentpicture to cpath;
pic:=currentpicture;

% erase currentpicture
currentpicture:=nullpicture;
%[DA 6/25]End of code to replace with new clipping routine

%[DA 6/25] Put new clipping routine here. It should return P clipped  
to clipping path
%[DA 6/25] for all choices of choice and reflect:

% draw grid
for k=-5u step 1u until 5u:
draw (-5u,k)--(5u,k) withcolor mygridcolor;
draw (k,-5u)--(k,5u) withcolor mygridcolor;
endfor;

% draw axes
drawarrow (-5u,0)--(5u,0);
drawarrow (0,-5u)--(0,5u);

% label axes
label.rt(btex $x$ etex, (5.2u,0));
label.top(btex $y$ etex, (0,5.2.u));
label.bot(btex $5$ etex, (5u,0));
label.lft(btex $5$ etex, (0,5u));

%[DA 6/25]==Replace with draw pic command with  
drawdblarrow P
% redraw line
draw pic;

\stopbuffer

\startlinecorrection[blank]
\midaligned{\processMPbuffer}
\stoplinecorrection





On Jun 25, 2006, at 1:14 PM, Mojca Miklavec wrote:

 On 6/25/06, David Arnold wrote:
 That is, I would choose a boundary that would present arrow heads at
 each end of the curve. In the case of rational functions, I would
 clip each branch separately.

 I hope this answers the question.

 So that necessary means an arrowhead each time when a function crosses
 the boundary if I understand correctly (i.e. 1/x would have 4
 arrowheads)?

 Mojca
 ___
 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] INstall minimal context system.

2006-06-25 Thread Aditya Mahajan
On Sun, 25 Jun 2006, Idris Samawi Hamid wrote:

 On Sun, 25 Jun 2006 17:27:41 -0600, John R. Culleton
 [EMAIL PROTECTED] wrote:

 I downloaded the justtex.zip and the context-linux.zip files
 into a work directory /usr/local/cont and unzipped them. Then I
 cd to the tex directory under that work directory. I made the
 the setuptex file executable and executed it with no apparent
 effect. Then I changed the path to point to
 /usr/local/cont/tex/texmf-linux/bin and ran mktexlsr. It followed
 the new path. I ran texexec --make --alone and it seemed to be
 successful.

setuptex just sets some system variables (TEXMF, TEXMFMAIN, TEXMFLOCAL 
and so on) and modifies the PATH, so you will not get any immediate 
feedback on whether it ran correctly or not. Depending on your shell 
you may have to source setuptex path-to-setuptex or just setuptex 
path-to-setuptex As a quick check to see if everything went fine, do
echo $TEXMF before and after sourcing setuptex.

 Just a guess: since you used the --alone switch, is there a path to the
 current directory from which you invoked
 texexec --make --alone

 Without the --alone switch the fmt file should go into \texmf-linux\web2c
 or \texmf-linux\web2c\pdfetex, depending on your texexec.ini setup.

IIRC, the new (ruby) texexec does not read texexec.ini. One 
possibility is that $TEXMFLOCAL is not set (as you did not run 
setuptex) so texexec did not know where to place the format files. 
This also happens with Miktex and texexec creates a directory pdfetex 
in the current directory and dumps the format files there. You can try 
moving the fmt files to /usr/loca/cont/tex/texmf-local/web2c/pdfetex

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