[NTG-context] Can I just put a footnote without marking in the main text?

2022-05-17 Thread Zhichu Chen via ntg-context

Hi everybody,


After some attempts to put footnotes in a mixed 1&2 columns layout, I 
decide to put marks in the one-column environment and flush them when 
entering the two-column environment.



The code is ugly but the result is acceptable. Except that the invisible 
footnote marks do generate something in the main text, so there's a 
blank line for each footnote.



Here's an MWE:


=

\definenote[address]
\setupnote[address][rule=off,location=text]



\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote]%[footnote] % if footnotes need to be grouped, 
uncomment the second argument and the line after \the\titlefootnotes

\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]


\newtoks\titlefootnotes


\def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}
\def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}



\appendtoks
  \setcounter[footnote][0] % this looks stupid because it has no effect
  %\setupnotation[footnote][numberconversion=numerals]
\to \titlefootnotes

\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}


\starttext



\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress


The Title\thanks{Work supported by somebody.}

Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd] 




\placenotes[address]

\blank[medium]

\startcolumns


\the\titlefootnotes

%\setcounter[footnote][0] % why it's necessary to set the counter 
outside the token if I define [putjustnote] as [footnote]?



test\footnote{test}

\input knuth



\stopcolumns

\stoptext

=

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] upload

2022-05-11 Thread Zhichu Chen via ntg-context

Hi Hans,


Thanks for the update. But I noticed that the XITS fonts were still the 
old ones:




zhichu@large /opt/context-lmtx/tex/texmf/fonts/opentype/public/xits $ 
fc-query -f '%{fontversion}\n' XITS-Regular.otf  | perl -E 'printf 
"%.3f\n", <>/65536.0'

1.200




According to

https://github.com/aliftype/xits/releases

the final release is version 1.302. Maybe I don't care the new changes 
since 1.200, but every time I compile my file, I get the warnings I 
don't like:




mathematics > tweak > 'XITSMath-Regular', size 6pt, math size 3, 
version 'Version 1.200' found, version 'Version 1.302' expected
mathematics > tweak > 'XITSMath-Bold', size 6pt, math size 3, 
version 'Version 1.109' found, version 'Version 1.302' expected



Do you mind get the new ones in the next beta?


Best regards,

Zhichu


On 5/9/22 23:41, Hans Hagen via ntg-context wrote:

Hi,

I uploaded a new version of lmtx (also because some users have to test 
some new metapost functionality). In the next upload metafun will use 
'double' mode (and scaledfun will be the traditional one). The 
advantage is less dager for overflows and in the meantime running in 
double mode is often also faster.


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___ 


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \placenotes ends up in wrong place when mixing one- and two- column layouts.

2022-05-10 Thread Zhichu Chen via ntg-context

Thanks Hans, works perfectly.


Sorry for the late reply. Still working on the template and got another 
one. Again, sorry.



The journal is in two-column form and the title, authors, and addresses 
are spanned to


the full width. Very common. But the title may acknowledge to some 
fund(s) and the


authors may have email addresses. If I use \note[thanks] and 
\note[email] to do that,


only the markers are shown. That's expected. So I tried to put 
\postponenotes before


the title and insert\placenotes[thanks] and \placenotes[email] after 
\startcolumns. The


notes did show up but in wrong position.


I hope there's another magic switch, or I have to put the marks in the 
title head and


put "real" but invisible notes in the two-column texts.



Thanks again, Hans.


Yours,

Zhichu


MWE (not that minimal):

===

\definenote[address]
\setupnote[address][rule=off,location=text]

\definenote[thanks]
\setupnote[thanks][location=firstcolumn]
\setupnotation[thanks][numberconversion=set 2]
\definenote[email][thanks]


\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\edef\currentaddress{#1}%
 {\setnotetext[address][#1]{\addressparameter{name}}}%
    \endgraf
    }

\starttext


\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress

\postponenotes

The Title\thanks{Work supported by somebody.}

%\startlocalnotes[address]
Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
%\placelocalnotes[address]
%\stoplocalnotes

\placenotes[address]

\startcolumns

\placenotes[thanks]
\placenotes[email]


\input knuth
\stopcolumns

\stoptext

===


On 5/8/22 17:20, Hans Hagen via ntg-context wrote:

On 5/8/2022 6:55 AM, Zhichu via ntg-context wrote:

Hi,

I am going to convince the Board of a journal to consider ConTeXt as 
an additional option.
I want to make a module before I say anything. Right now I have this 
title problem.


The journal requires the titles to be CAPITALISED, except for the 
acronyms. I'm currently
using backticks`...`to wrap it and replace it with\egroup 
...\WORD\bgroup{} with
lpeg. This kinda works, but that's so ugly. Besides, the actual story 
is that I also want to

add markdown as an option, so the backticks actually have meanings.

I also checked thetypo-cap.luafile to get a clue. But I used to use 
TeX exclusively

and I have to admit that it's so overwhelming for a newbie.

I really like the way wherebibtextreats words enclosed in curly 
braces are ignored.
Or are there something that's less aggressive than\WORDso the LaTeX 
trick works:

\def\NoCaseChange#1{\noexpand\NoCaseChange{\noexpand#1}}

\starttext

\protected\def\casing[#1]{\groupedcommand{\setcharactercasing[#1]}{}}
    \protected\def\nocasing 
{\groupedcommand{\setcharactercasing[reset]}{}}


    \setuphead[chapter][textstyle=\WORD]

    \chapter{some \nocasing{kept} text or \casing[Word]{more} text}

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___ 


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Is there a "smart" capitalisation implementation?

2022-05-07 Thread Zhichu via ntg-context
Hi,

I am going to convince the Board of a journal to consider ConTeXt as an 
additional option.
I want to make a module before I say anything. Right now I have this title 
problem.

The journal requires the titles to be CAPITALISED, except for the acronyms. I'm 
currently
using backticks `...` to wrap it and replace it with \egroup ...\WORD\bgroup{} 
with
lpeg. This kinda works, but that's so ugly. Besides, the actual story is that I 
also want to
add markdown as an option, so the backticks actually have meanings.

I also checked the typo-cap.lua file to get a clue. But I used to use TeX 
exclusively
and I have to admit that it's so overwhelming for a newbie.

I really like the way where bibtex treats words enclosed in curly braces are 
ignored.
Or are there something that's less aggressive than \WORD so the LaTeX trick 
works:
\def\NoCaseChange#1{\noexpand\NoCaseChange{\noexpand#1}}

Best wishes,
ℤhichu ℂhen

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

2019-07-05 Thread Zhichu
Hi Hans,

I simply put the unicode character there and everything works pretty well.

I was using only 5 Chinese characters in a document: 中國科學院, which means Chinese 
Academy of Sciences. Looked up their unicode number:

for c in u'中國科學院': print(ord(c))
20013
22283
31185
23416
38498

and draw every glyph carefully in a metapost file "cas-chars.mp":

beginglyph(20013,1000,1000,0);
  % a lot of fillings and drawingsendglyph;

then call them in a test file:

\definemetafont[cas-logo][cas-chars.mp]
\startTEXpage
\definefont[cas][cas@cas-logo]
\cas 中國科學院\stopTEXpage

If I remove the beginglyph(38498,1000,1000,0) part in the mp file and “\cas 
中國科學” will generate the correct output. or if I change 
beginglyph(38498,1000,1000,0) to  beginglyph(32767,1000,1000,0) and “\cas 
中國科學\char"7FFF” also gives the right output.

I'm looking forward to “some” module :-)
--
From:Hans Hagen 
Send Time:2019 Jul. 5 (Fri.) 17:03
To:陈之初 ; mailing list for ConTeXt users 

Subject:Re: [NTG-context] I (metapost) can't handle numbers bigger than 
32767.8

On 7/5/2019 8:32 AM, Zhichu wrote:
> Hi everyone,
> 
> I was using metapost to generate some symbols, as in 
> "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex"

How do you use these symbols in a document? Do you call them up by 
number somehow? Using some glyph interface doesn't make much sense I 
think, as the font stuff comes from mf which is 8 bit. So, these 
character numbers (and simensions) are not really saying much, other 
than that they're properties of a figure.

(In context lmtx there will likely be some module for mp fonts. We can 
already do a lot but there is some more potential.)

Hans


> Occasionally, I want to customize a glyph whose charcode is a little large, 
> say the character " 
> 院":
> 
> ~~~IPython
> In [1]: for c in u'院': print(ord(c))
> 38498
> 
> 
> so I wrote:
> 
> beginglyph(38498,2,4,0) ; % high voltage
>  interim ahlength := 1 ;
>  drawarrow (1,4) -- (0,2) -- (2,3) -- (1,0) withcolor darkred ;
> endglyph ;
> 
> 
> and I got:
> 
> ! Enormous number has been reduced.
> l.60 beginzhglyph(38498
> );
> I can't handle numbers bigger than 32767.8;
> so I've changed your constant to that maximum amount.
> 
> 
> So charcode is a 15-bit integer?
> 
> Currently, I use `beginglyph(32767,2,4,0) ;` and call it with \char"7FFF. Not 
> an elegant way I think.
> 
> Is there a fix? I checked the metapost manual and found that charcode is only 
> used to set the filename to something like %{jobname}.%{charcode} I can't see 
> why there's a limit for charcode.
> 
> 
> 
> 
> 
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
> 


-- 

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

2019-07-04 Thread Zhichu
Hi everyone,

I was using metapost to generate some symbols, as in 
"tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex"

Occasionally, I want to customize a glyph whose charcode is a little large, say 
the character "院":

~~~IPython
In [1]: for c in u'院': print(ord(c))
38498


so I wrote:

beginglyph(38498,2,4,0) ; % high voltage
interim ahlength := 1 ;
drawarrow (1,4) -- (0,2) -- (2,3) -- (1,0) withcolor darkred ;
endglyph ;


and I got:

! Enormous number has been reduced.
l.60 beginzhglyph(38498
);
I can't handle numbers bigger than 32767.8;
so I've changed your constant to that maximum amount.


So charcode is a 15-bit integer?

Currently, I use `beginglyph(32767,2,4,0) ;` and call it with \char"7FFF. Not 
an elegant way I think.

Is there a fix? I checked the metapost manual and found that charcode is only 
used to set the filename to something like %{jobname}.%{charcode} I can't see 
why there's a limit for charcode.





___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Extend figure to margin, or extend figure from margin to text

2019-05-30 Thread Zhichu
Dear Wolfgang,

I've made an MWE. It seems that once I changed the layout, the output would be 
a little strange:
* The edgefigure (default=outer) on the odd pages can't be moved to the margin. 
Those on the even pages are fine as long as I use 
"leftmargindistance=-\innercombitotal"
* the marginfigure (default={outermargin, hanging}) on the odd pages are fine, 
but those on the even pages have a weird offset.
* by the way, the offset of the marginfigure on the even pages are the same as 
the edgefigure on the even pages if I set "leftmargindistance=-\outercombitotal"

I managed to make the marginfigure work by adding (just in this case)
  leftmargindistance=\dimexpr\outercombitotal-\innercombitotal\relax,
 rightmargindistance=0pt

But I could never make edgefigure work. Its different behavior on odd and even 
pages really bothers me.

Although the output is acceptable now, I'm still concerned that the settings 
are not logical (to a human being). I'm afraid that one day it won't work out 
like that.


Here's the MWE:
===
\showframe

\setuppagenumbering
 [alternative=doublesided]
\definepapersize
 [911]
 [width=9in,
 height=11in]
\setuppapersize
 [911]
\setuplayout
 [backspace=1in%
 ,leftmargin=.5in%
 ,leftmargindistance=0.25in%
 ,width=5.5in%
 ,rightmargindistance=0.25in%
 ,rightmargin=2in%
 ]

\definefloat
 [edgefigure]
 [figure]
\setupfloat
 [edgefigure]
 [rightmargindistance=-\outercombitotal
 ,leftmargindistance=-\innercombitotal
 ,default={outer,low,high,none}]

\definefloat
 [marginfigure]
 [figure]
\setupfloat
 [marginfigure]
 [default={outermargin,hanging,none}]

\startbuffer[fitframe]
\framed[width=\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkgreen]{\tt
 width=rightmarginwidth}
\stopbuffer

\startbuffer[wideframe]
\framed[width=2\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkred]{\tt
 width=2*rightmarginwidth}
\stopbuffer

\starttext

\chapter{edge}

\dorecurse{10}{
\startplaceedgefigure
\getbuffer[fitframe]
\stopplaceedgefigure

\input knuth
}

\chapter{margin}

\dorecurse{10}{
\startplacemarginfigure
\getbuffer[fitframe]
\stopplacemarginfigure
\input knuth
}

\dorecurse{10}{
\startplacemarginfigure
\getbuffer[wideframe]
\stopplacemarginfigure
\input knuth
}

\stoptext
===
--
From:Wolfgang Schuster 
Sent At:2019 May 29 (Wed.) 17:55
To:陈之初 ; mailing list for ConTeXt users 

Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin 
to text


Zhichu  schrieb am Mi., 29. Mai 2019, 10:30:


Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some 
graphics are too big to fit in the margin. I was wondering whether there's an 
elegant way to use some room of the text body?

Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm

Wolfgang



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Extend figure to margin, or extend figure from margin to text

2019-05-29 Thread Zhichu
Dear Wolfgang,

That's quick. Thank you so much.

Best regards,
Zhichu


--
From:Wolfgang Schuster 
Sent At:2019 May 29 (Wed.) 17:55
To:陈之初 ; mailing list for ConTeXt users 

Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin 
to text


Zhichu  schrieb am Mi., 29. Mai 2019, 10:30:


Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some 
graphics are too big to fit in the margin. I was wondering whether there's an 
elegant way to use some room of the text body?

Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm

Wolfgang



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Extend figure to margin, or extend figure from margin to text

2019-05-29 Thread Zhichu

Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some 
graphics are too big to fit in the margin. I was wondering whether there's an 
elegant way to use some room of the text body?

The output is close to the following, but the caption should be as wide as the 
figure and the part in the margin should not affect other marginal notes:


\showframe

\starttext

Hello\inright{Very very very long test notes.}, world!

\startplacefigure
 [reference=fig:whatever,
 title={Test figure.},
 location=outer]
\hbox{%
\framed
 [frame=on%
 ,offset=0pt%
 ,width=\dimexpr\rightmarginwidth+\rightmargindistance\relax
 ,height=\rightmarginwidth
 ]{Extended Part}%
\framed
 [frame=on%
 ,offset=0pt%
 ,width=\rightmarginwidth
 ,height=\rightmarginwidth
 ]{My Figure Here}%
\kern-\rightmargindistance
\kern-\rightmarginwidth
}
\stopplacefigure

\input knuth

\stoptext


Lua codes are also welcomed.

Best Regards,
Zhichu Chen
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Increasing the textwidth locally

2016-04-09 Thread Zhichu Chen

Dear Joas,

On 04/09/2016 08:47 PM, joasyann...@gmail.com wrote:


Dear everyone,

I am looking for a functionality similar to the \adjustwidth command 
in LaTeX ables to reduce or increase the \textwidth locally. I know 
that ConTeXt has \startnarrower, which reduces the \textwidth. But how 
to increase it?



\startnarrower[-1*left,-2*right]
...
\stopnarrower

surprise...


All the best,

Joas



___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] unwanted head behavior

2016-04-09 Thread Zhichu Chen

Dear Hans,


On 04/07/2016 06:31 PM, Hans Hagen wrote:
\def\currentsectioncountervalue 
{\clf_depthnumber\numexpr\thenamedheadlevel\currenthead\relax}
%def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\currenthead+\minusone\relax} 

\def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\previoushead\relax} 



\let\previoushead\empty

\def\strc_sectioning_handle_page_nop
  {\edef\p_continue{\headparameter\c!continue}%
   \ifx\p_continue\v!yes
 \ifx\currenthead\previoushead % not really needed
\strc_sectioning_check_layout
 \else\ifnum\previoussectioncountervalue=\zerocount
\strc_sectioning_check_layout
 \else\ifnum\currentsectioncountervalue>\zerocount
\strc_sectioning_check_layout
 \fi\fi\fi
   \else
 \strc_sectioning_check_layout
   \fi
   \globallet\previoushead\currenthead}

\def\strc_sectioning_handle_page_yes
  {\ifconditional\c_strc_sectioning_ignore_page
 \setfalse\c_strc_sectioning_ignore_page
   \else
 % beware, these numbers are not yet know here
 \strc_sectioning_handle_page_nop
 \edef\p_aligntitle{\headparameter\c!aligntitle}%
 \ifx\p_aligntitle\v!float
 \ifconditional\c_strc_sectioning_auto_break
   \vspacing[\v!samepage-\currentheadlevel]%
 \fi
 \headparameter\c!before\relax
 \indent
 \else
 \page_otr_command_flush_side_floats
 \ifconditional\c_strc_sectioning_auto_break
   \vspacing[\v!samepage-\currentheadlevel]%
 \fi
 \headparameter\c!before\relax
 \fi
 \global\c_strc_sectioning_preceding_level\currentheadlevel
   \fi
   \globallet\previoushead\currenthead}

but it really needs testing with other cases
Tested and confirmed working in my project and this MWE. Thanks for the 
work.




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] unwanted head behavior

2016-04-06 Thread Zhichu Chen
If I understand correctly, the "continue=yes" key prevents a new page 
generated by a lower-level structure, e.g., section, following a 
higher-level structure, e.g., chapter.


Then why the checking is so complex in strc-sec.mkiv:
==
\def\strc_sectioning_handle_page_nop
  {\edef\p_continue{\headparameter\c!continue}%
   \ifx\p_continue\v!yes
 \ifnum\previoussectioncountervalue=\zerocount
   \strc_sectioning_check_layout
 \else\ifnum\currentsectioncountervalue>\zerocount
   \strc_sectioning_check_layout
 \fi\fi
   \else
 \strc_sectioning_check_layout
   \fi}
==

I temporarily changed the definition to:
==
\newcount\previousheadlevel
\previousheadlevel\plusone
\def\strc_sectioning_handle_page_nop
  {\edef\p_continue{\headparameter\c!continue}%
   \ifx\p_continue\v!yes
 \ifnum\currentheadlevel>\previousheadlevel\else
   \strc_sectioning_check_layout
 \fi
   \else
 \strc_sectioning_check_layout
   \fi
   \previousheadlevel\currentheadlevel}
==

Seems fine.



PS: irrelevant to my problem, but I just wish ConTeXt to be perfect. So:
1, line 1060, file strc-sec.mkiv:
\global\setfalse\c_strc_rendering_continue
shouldn't this line be "\global\setfalse\c_strc_rendering_continuous"?
2, a lot of \.._strc_sectioniong_... macros in strc-sec.mkiv. I think 
changing the "sectioniong" to "sectioning" may prevent potential typos.




On 04/05/2016 01:19 PM, Zhichu Chen wrote:


Dear Hans and Wolfgang,

The following code generates a pdf that I cannot understand.

1. Although "placehead" is set to "no," the \part macro still makes an empty 
line.
2. The first \chapter does not open a new page, but if we switch the first 
\title
 and the first \chapter, the result seems to be all right.

Is there a simple fix?

Thanks in advance.

==
\setuphead
   [part,chapter,title,section]
   [continue=yes,page=yes,number=no]

\setuphead[part][placehead=no]


\showframe

\starttext

\input ward\page

\part{TITLE}\input ward\par
\title{Title}
\chapter{Title}
\chapter{Title}
\title{Title}
\chapter{Title}

\stoptext
==

ConTeXt minimal information:


context -version

mtx-context | ConTeXt Process Management 0.63
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2016.03.26 13:51


luatex -version
This is LuaTeX, Version beta-0.90.0 (TeX Live 2016)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your option)
any later version. For more information about these matters, see the file
named COPYING and the LuaTeX source.

LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team.
--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888





___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] unwanted head behavior

2016-04-06 Thread Zhichu Chen

Hi,

I found the empty line is due to the definition of 
\strc_rendering_place_head_empty in strc-ren.mkiv:


\unexpanded\def\strc_rendering_place_head_empty
  {\hbox \headreferenceattributes {\getheadsyncs}}


The definition in strc-sec.mkiv works fine (put the following lines just 
before \starttext)


\unexpanded\def\strc_rendering_place_head_empty
  {\setheadmarking
   \getheadsyncs}


Isn't that a bug?


On 04/05/2016 01:19 PM, Zhichu Chen wrote:












Dear Hans and Wolfgang,

The following code generates a pdf that I cannot understand.

1. Although "placehead" is set to "no," the \part macro still makes an empty 
line.
2. The first \chapter does not open a new page, but if we switch the first 
\title
 and the first \chapter, the result seems to be all right.

Is there a simple fix?

Thanks in advance.

==
\setuphead
   [part,chapter,title,section]
   [continue=yes,page=yes,number=no]

\setuphead[part][placehead=no]


\showframe

\starttext

\input ward\page

\part{TITLE}\input ward\par
\title{Title}
\chapter{Title}
\chapter{Title}
\title{Title}
\chapter{Title}

\stoptext
==

ConTeXt minimal information:

zhichu  ~  context -version

mtx-context | ConTeXt Process Management 0.63
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2016.03.26 13:51
  zhichu  ~  luatex -version
This is LuaTeX, Version beta-0.90.0 (TeX Live 2016)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your option)
any later version. For more information about these matters, see the file
named COPYING and the LuaTeX source.

LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team.

  zhichu  ~ 

--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888





___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] unwanted head behavior

2016-04-04 Thread Zhichu Chen









Dear Hans and Wolfgang,

The following code generates a pdf that I cannot understand.

1. Although "placehead" is set to "no," the \part macro still makes an empty 
line.
2. The first \chapter does not open a new page, but if we switch the first 
\title
and the first \chapter, the result seems to be all right.

Is there a simple fix?

Thanks in advance.

==
\setuphead
  [part,chapter,title,section]
  [continue=yes,page=yes,number=no]

\setuphead[part][placehead=no]


\showframe

\starttext

\input ward\page

\part{TITLE}\input ward\par
\title{Title}
\chapter{Title}
\chapter{Title}
\title{Title}
\chapter{Title}

\stoptext
==

ConTeXt minimal information:

zhichu  ~  context -version

mtx-context | ConTeXt Process Management 0.63
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2016.03.26 13:51
 zhichu  ~  luatex -version
This is LuaTeX, Version beta-0.90.0 (TeX Live 2016)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your option)
any later version. For more information about these matters, see the file
named COPYING and the LuaTeX source.

LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team.

 zhichu  ~ 

--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888



___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Customize grid layout

2016-02-28 Thread Zhichu Chen

Dear TeXers,

Is it possible to define the layout like:
\setuplayout
  [grid=yes%
  ,lines=6%
  ,gridstyle={1,1,1,3.5,1,1}%
  ]
so that I can have 6 lines per page, but the 4th line skips will be 
3.5\baselineskip.
For your information, the blank between the first 3 lines and the rest 
ones is used to

display the page number (it's not a joke although April is close).

I was thinking putting an invisible rule after each CJK glyph as a font 
feature, and
the height of the rule changes every 6 lines starting from 4. But 
\linenumber seems to

be an MKII-only counter.

Any suggestions?

--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Character rotation font feature available?

2016-02-14 Thread Zhichu Chen

Hi Marco,

On 02/15/2016 05:30 AM, Marco Patzer wrote:

On Mon, 15 Feb 2016 04:42:31 +0800
Zhichu Chen  wrote:


I have some special needs that requires all the characters be rotated
by 90 degrees. I've searched around the web and maybe adding
/FontMatrix [0 1 -1 0 0 0]
to the font descriptor dictionary is helpful. But I can't find a
\pdf??? primitive that can achieve this. (Am I wrong about this?)

Another solution might be the "vrt2" font feature. There's no
difference between the results with or without enabling the feature.
But I do see the font has the feature by using the shell command:
otfinfo -f 

I don't know exactly how it's supposed to look like, especially
kerning, vertical spacing, etc. Just making sure you know about
\applytocharacters:

I didn't know the command, thank you for sharing.


\starttext
   \applytocharacters\rotate{Foo Bar}
\stoptext

as well as \handletokens Foo Bar\with\rotate

Maybe that's already sufficient for your use case.

Marco
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Character rotation font feature available?

2016-02-14 Thread Zhichu Chen

Dear list,

I have some special needs that requires all the characters be rotated by 
90 degrees. I've searched around the web and maybe adding

/FontMatrix [0 1 -1 0 0 0]
to the font descriptor dictionary is helpful. But I can't find a \pdf??? 
primitive that can achieve this. (Am I wrong about this?)


Another solution might be the "vrt2" font feature. There's no difference 
between the results with or without enabling the feature. But

I do see the font has the feature by using the shell command:
otfinfo -f 


May I put my temporary unsatisfying code here and ask for optimization?

Thanks in advance.









===
\startluacode


pdf.setcompresslevel(0)
pdf.setobjcompresslevel(0)

local registerotffeature = fonts.handlers.otf.features.register
--local registerafmfeature = fonts.handlers.afm.features.register

local setmetatableindex  = table.setmetatableindex



local function jian(tfmdata,value)
if value then
local characters = tfmdata.characters
local resources  = tfmdata.resources
local additions  = { }
local private= resources.private
for unicode, old_c in next, characters do
private = private + 1
local width  = old_c.width  or 0
local height = old_c.height or 0
local depth  = old_c.depth  or 0
local htsp,wdsp,dpsp = 
(height/65536)*(72.0/72.27),(width/65536)*(72.0/72.27),(depth/65536)*(72.0/72.27)

local bboxrulewd = 0.5
local baserulewd = 0.9
local new_c
new_c = {
width= width,
height   = height,
depth= depth,
commands = {
{ "push" },
{ "right", width },
{ "special", "pdf: q 0 0 1 RG 0 0 1 rg " .. 
bboxrulewd .. " w 0 " .. -dpsp .. " m 0 " .. htsp .. " l " .. -wdsp .. " 
" .. htsp .. " l " .. -wdsp .. " " .. -dpsp .. " l s 1 0 1 RG 1 0 1 rg " 
.. baserulewd .. " w [2 1] 0 d 0 0 m " .. -wdsp .. " 0 l S Q" },

{ "pop" },
{"special", "pdf: q 0 1 -1 0 0 0 cm"},
{ "down", 0.9*width },
{ "right", -0.1*width },
{ "slot", 1, private },
{ "down", -0.9*width },
{ "right", -0.9*width },
{"special", "pdf: 1 0 0 1 0 0 cm Q"},
}
}
setmetatableindex(new_c,old_c)
characters[unicode] = new_c
additions[private]  = old_c
end
for k, v in next, additions do
characters[k] = v
end
resources.private = private
end
end

registerotffeature {
name= "jian",
description = "rotate glyphs",
manipulators = {
base = jian,
node = jian,
}
}

\stopluacode

\definefontfeature
  [vertical]
  [default]
  [jian=yes]


\definefallbackfamily [mainface] [serif] [Adobe Ming Std]
  [range={0x00400-0x2FA1F}%
  ,force=yes%
  ,features=vertical%
  ]
\definefallbackfamily [mainface] [sans] [Adobe Heiti Std]
  [range={0x00400-0x2FA1F}%
  ,force=yes%
  ,features=vertical%
  ]
\definefallbackfamily [mainface] [mono] [Adobe Fangsong Std]
  [range={0x00400-0x2FA1F}%
  ,force=yes%
  ,features=vertical%
  ]


\definefontfamily
  [mainface]
  [serif]
  [TeX Gyre Termes]
  [features=vertical]
\definefontfamily
  [mainface]
  [sans]
  [TeX Gyre Heros]
  [features=vertical]
\definefontfamily
  [mainface]
  [mono]
  [TeX Gyre Cursor]
  [features=vertical]
\definefontfamily
  [mainface]
  [math]
  [TeX Gyre Termes Math]
  [features=vertical]


\setscript
  [hanzi]

\startsetups footnote:hanzi
  \setscript[hanzi]
\stopsetups

\setupnote[footnote][setups={footnote:hanzi}]

\setupalign[hz,hanging]
\setupbodyfont[mainface,20pt]


\showframe

\starttext



裴駰曰凡是徐氏義稱徐姓名以別之餘者悉是駰%
注解并集衆家義。司馬貞索隱曰紀者記也本其%
%
事而記之故曰本紀又紀理也絲縷有紀而帝王書%
稱紀者言爲後代綱紀也。正義曰鄭玄注中候勅%
%
省圖云德合五帝坐星者稱帝又坤靈圖云德配天%
地在正不在私曰帝按太史公依世本大戴禮以黃%
%
帝顓頊帝嚳唐堯虞舜爲五帝譙周應劭宋均皆同%
而孔安國尚書序皇甫謐帝王世紀孫氏注世本並%
%
以伏犧神農黃帝爲三皇少昊顓頊高辛唐虞爲五%
帝裴松之史目云天子稱本紀諸侯曰世家本者繫%
%
其本系故曰本紀者理也統理衆事繫之年月名之%
曰紀第者次序之目一者舉數之由故曰五帝本紀%
%
第一。又曰禮云動則左史書之言則右史書之正%
義云左陽故記動右隂故記言言爲尚書事爲春秋%
%
按春秋時置左右%
史故云史記也%
%
%
裴駰曰凡是徐氏義稱徐姓名以別之餘者悉是駰%
注解并集衆家義。司馬貞索隱曰紀者記也本其%
%
事而記之故曰本紀又紀理也絲縷有紀而帝王書%
稱紀者言爲後代綱紀也。正義曰鄭玄注中候勅%
%
省圖云德合五帝坐星者稱帝又坤靈圖云德配天%
地在正不在私曰帝按太史公依世本大戴禮以黃%
%
帝顓頊帝嚳唐堯虞舜爲五帝譙周應劭宋均皆同%
而孔安國尚書序皇甫謐帝王世紀孫氏注世本並%
%
以伏犧神農黃帝爲三皇少昊顓頊高辛唐虞爲五%
帝裴松之史目云天子稱本紀諸侯曰世家本者繫%
%
其本系故曰本紀者理也統理衆事繫之年月名之%
曰紀第者次序之目一者舉數之由故曰五帝本紀%
%
第一。又曰禮云動則左史書之言則右史書之正%
義云左陽故記動右隂故記言言爲尚書事爲春秋%
%
按春秋時置左右%
史故云史記也%


\stoptext

--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

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

Re: [NTG-context] conTeXt Mkiv: the number of parameters can not be more than 9?

2015-07-04 Thread Zhichu Chen

Hi Dillon,

First of all, I'm against defining such a complex macro, since that can 
be very

confusing when you use it. I personal prefer the key-value definition:
\def\DEFINETEST[#1]{%
  \getXXXparameters
[paraA=defaultValueForParameterA%
,paraB=% or just empty
,#1]%
  \doSomethingWith[\XXXparameter\paraA]%
  \doSomethingElse...
}
You might want to refer to the following link and other valuable 
materials on the

wiki for more information:
http://wiki.contextgarden.net/System_Macros/Key_Value_Assignments

If you insist on that, I guess you can define a temporary macro inside 
your macro.

That's very dirty, but can be a little more efficient? I'm not sure.

I was given to understand that the ConTeXt MKVI now accepts parameters 
such as
#position#color rather than meaningless #1#2. I GUESS that's lua-based, 
so maybe

it'll break the TeX limitation.

On 07/05/2015 09:55 AM, 土卜皿 wrote:


hi, all

For testing, I have a definition:

|\define[9]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9}|

|context test| can work fine, when I modify the above into:

|\define[10]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9,#10}|

I got a error:

|test.tex: ! Illegal parameter number in definition of\DEFINETEST|

From StackExchange, I got a answer:

Since ConTeXt is based on TeX, the maximum number of 9 parameters is 
inherited


So, in Context mkiv, what should I do for more than 9 parameters?

Thanks!

Best Regards

Dillon



___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___



--
Best regards,
ℤh𝕚chu ℂh𝕖n

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Virtual font question

2015-06-24 Thread Zhichu Chen

Hi everybody,

I finally got my typescript work. It was the "serif" typeface that 
failed me. When I defined the fixed size type:

===
\definetypeface [mathtimespro] [rm] [serif] [times] [default]
\definetypeface [mathtimespro] [ss] [sans] [helvetica] 
[default] [rscale=0.9]
\definetypeface [mathtimespro] [tt] [mono] [courier]   
[default] [rscale=1.1]
\definetypeface [mathtimespro] [mm] [math] [mathtimespro]
[default]

===
where mathtimespro in the last line was defined as:
===
\definefontsynonym [MathTimeProA-Regular] 
[MTP06A-Regular@mtpro06a-regular]

===
Everything was fine. But the designsize version needs to be:
===
\definetypeface [mathtimespro] [rm] [serif] [times] 
[default][designsize=auto]
\definetypeface [mathtimespro] [ss] [sans]  [helvetica] 
[default] [rscale=0.9]
\definetypeface [mathtimespro] [tt] [mono]  [courier] [default] 
[rscale=1.1]
\definetypeface [mathtimespro] [mm] [math] [mathtimespro]
[default][designsize=auto]

===
Without the last parameter in the serif definition, the math font could 
not be remapped (WHY???).


Fix me if I'm wrong about this conclusion.


Best regards,
Zhichu

On 06/23/2015 01:20 PM, Zhichu Chen wrote:

Hi Aditya,


On 06/23/2015 11:57 AM, Aditya Mahajan wrote:
I don't have the fonts, so I cannot describe the exact method. But 
see below and also have a look at Section 5 of
https://www.tug.org/TUGboat/tb30-2/tb95mahajan-cmath.pdf The 
description is old, and some of the file locations have changes, but 
the basic infrastructure is still the same.

Thank you for sharing this article. It seems that the
===
return {
mathematics = {
mapfiles = {
"mtpro2.map",
},
virtuals = {
["mtpro06a-regular"] = {
...
===
codes may have done the job in the mathematics.make_font function.

In this snippet:
===
\definefontsynonym
  [LMMathRoman10-Regular]
  [LMMath10-Regular@lmroman10-math]
===
I know that LMMathRoman10-Regular will be used as the font synonym, 
@lmroman10-math is the
virtual font, but what does LMMath10-Regular stand for? I chose some 
random names in my typescript

but maybe there's some magic there?
The vectors mptpro2-mi etc are not defined. Look at math-ttv.lua for 
a list of predefined vectors (mapping type1 fonts to unicode symbols. 
It is quite likely that the mtpro fonts would follow the "standard" 
mappings; if not, you will need to create an approrpriate mapping for 
each font. This is not difficult (just monotonous).
I've already defined these vectors in the same .lfg file. What a 
tedious work it was, by the way. I thought
that would be irrelevant, so I skipped those codes. I'm sorry I didn't 
make that clear.


I almost forgot to mention. The font has its own \Relbar and \relbar 
characters rather than the equality
and the dash marks. What is the best way to use them? I currently put 
them in a private-use-area slot

in the vectors' definitions, but I'm not sure that's a good solution.



===
I guess the suffixes "f" "s" and "t" may correspond to "five" 
"seven" and "ten", but that's
not important. I could use one of them as the virtual font in the 
typescript:


Once this is done, rest of the typescript should work. It may be a 
good idea to try to see if you can get roman letters from mtpro.

If I claimed the font synonym with the virtual font directly:
===
# typescripts
\definefontsynonym [\s!MathRoman] [MTPro10a-Regular@mtpro10a-regular]
===
the 10-size-version fonts were loaded without any problem. But if I 
want to use the designsize feature:

===
-- lfg
designsizes = {
["MathTimeProA-Regular"] = {
["4pt"]  = "MTPro06a-Regular@mtpro06a-regular",
["5pt"]  = "MTPro06a-Regular@mtpro06a-regular",
["6pt"]  = "MTPro06a-Regular@mtpro06a-regular",
...
# type

Re: [NTG-context] Virtual font question

2015-06-22 Thread Zhichu Chen

Hi Aditya,


On 06/23/2015 11:57 AM, Aditya Mahajan wrote:
I don't have the fonts, so I cannot describe the exact method. But see 
below and also have a look at Section 5 of
https://www.tug.org/TUGboat/tb30-2/tb95mahajan-cmath.pdf The 
description is old, and some of the file locations have changes, but 
the basic infrastructure is still the same.

Thank you for sharing this article. It seems that the
===
return {
mathematics = {
mapfiles = {
"mtpro2.map",
},
virtuals = {
["mtpro06a-regular"] = {
...
===
codes may have done the job in the mathematics.make_font function.

In this snippet:
===
\definefontsynonym
  [LMMathRoman10-Regular]
  [LMMath10-Regular@lmroman10-math]
===
I know that LMMathRoman10-Regular will be used as the font synonym, 
@lmroman10-math is the
virtual font, but what does LMMath10-Regular stand for? I chose some 
random names in my typescript

but maybe there's some magic there?
The vectors mptpro2-mi etc are not defined. Look at math-ttv.lua for a 
list of predefined vectors (mapping type1 fonts to unicode symbols. It 
is quite likely that the mtpro fonts would follow the "standard" 
mappings; if not, you will need to create an approrpriate mapping for 
each font. This is not difficult (just monotonous).
I've already defined these vectors in the same .lfg file. What a tedious 
work it was, by the way. I thought
that would be irrelevant, so I skipped those codes. I'm sorry I didn't 
make that clear.


I almost forgot to mention. The font has its own \Relbar and \relbar 
characters rather than the equality
and the dash marks. What is the best way to use them? I currently put 
them in a private-use-area slot

in the vectors' definitions, but I'm not sure that's a good solution.



===
I guess the suffixes "f" "s" and "t" may correspond to "five" "seven" 
and "ten", but that's
not important. I could use one of them as the virtual font in the 
typescript:


Once this is done, rest of the typescript should work. It may be a 
good idea to try to see if you can get roman letters from mtpro.

If I claimed the font synonym with the virtual font directly:
===
# typescripts
\definefontsynonym [\s!MathRoman] [MTPro10a-Regular@mtpro10a-regular]
===
the 10-size-version fonts were loaded without any problem. But if I want 
to use the designsize feature:

===
-- lfg
designsizes = {
["MathTimeProA-Regular"] = {
["4pt"]  = "MTPro06a-Regular@mtpro06a-regular",
["5pt"]  = "MTPro06a-Regular@mtpro06a-regular",
["6pt"]  = "MTPro06a-Regular@mtpro06a-regular",
...
# typescripts
\definefontsynonym [\s!MathRoman] [\v!file:mathtimeproa-regular]
===
the mathtimeproa-regular font could not be remapped to the correct 
virtual font with the appropriate size.
I just want to know how type-imp-ebgaramond.mkiv managed to remap the 
designsize filename

"file:ebgaramond-regular" to "file:EBGaramond12-Regular".


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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Virtual font question

2015-06-22 Thread Zhichu Chen
ot;]  = "MTPro06a-Regular@mtpro06a-regular",
["7pt"]  = "MTPro08a-Regular@mtpro08a-regular",
["8pt"]  = "MTPro08a-Regular@mtpro08a-regular",
["9pt"]  = "MTPro08a-Regular@mtpro08a-regular",
["10pt"] = "MTPro10a-Regular@mtpro10a-regular",
["11pt"] = "MTPro10a-Regular@mtpro10a-regular",
["12pt"] = "MTPro10a-Regular@mtpro10a-regular",
default  = "MTPro10a-Regular@mtpro10a-regular"
},
===
and modified the typescript:
===
\definefontsynonym [\s!MathRoman] [\v!name:MathTimeProA-Regular] 
[\s!goodies=math-times-pro-math]

===
It failed as expected:
===
fonts   > defining > start stage one: MathRoman mo 1
fonts   > defining > specification 'MathRoman mo 1', lookup 
'file', name 'MathRoman', sub '', method '', detail ''

fonts   > defining > stop stage one
fonts   > defining > start stage two: name:MathTimeProA-Regular 
(size 393216)
fonts   > names > font with name 'mathtimeproaregular' cannot be 
found
fonts   > names > font database has matching configuration and 
file hashes
fonts   > defining > trying (reader sequence driven) type 'otf' 
for 'MathTimeProA-Regular' with file ''
fonts   > names > font database has matching configuration and 
file hashes
fonts   > defining > trying (reader sequence driven) type 'ttf' 
for 'MathTimeProA-Regular' with file ''
fonts   > names > font database has matching configuration and 
file hashes
fonts   > defining > trying (reader sequence driven) type 'afm' 
for 'MathTimeProA-Regular' with file ''
fonts   > names > font database has matching configuration and 
file hashes
fonts   > names > font database has matching configuration and 
file hashes
fonts   > defining > loading tfm with name 
'MathTimeProA-Regular' fails
fonts   > defining > trying (reader sequence driven) type 'tfm' 
for 'MathTimeProA-Regular' with file ''
fonts   > names > font database has matching configuration and 
file hashes
fonts   > defining > loading tfm with name 
'MathTimeProA-Regular' fails
fonts   > defining > trying (reader sequence driven) type 'lua' 
for 'MathTimeProA-Regular' with file ''

fonts   > lua loading > using lua reader for 'MathRoman mo 1'
fonts   > defining > font with asked name 'MathTimeProA-Regular' 
is not found using lookup 'name'
fonts   > defining > not loaded and hashed: mathtimeproa-regular 
@ normal:goodies=math-times-pro-math @ 393216
fonts   > defining > unknown font 'MathTimeProA-Regular', 
loading aborted
fonts   > defining > unable to define 'MathTimeProA-Regular' as 
'math-times-pro-11pt-mm-mr--3'

fonts   > defining > memory usage after: 45 MB (ctx: 45 MB)
fonts   > defining > stop stage two
===
I get it. There's no MathTimeProA-Regular file. I've tried the built-in 
"ebgaramond"

typescript which also comes with the "designsizes" field. Interesting, the
"ebgaramond-regular" is remapped to "EBGaramond12-Regular" magically:
===
fonts   > defining > start stage two: file:ebgaramond-regular 
(size 720896)
fonts   > defining > remapping name 'ebgaramond-regular', 
specification 'auto', size 720896, designsize 'file:EBGaramond12-Regular'

===

Well, what am I missing? How to get the designsize names recognized? 
What is the right

way to make the virtual fonts?

Thanks for noticing.

Best regards,
Zhichu

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Position of integral limits

2014-04-29 Thread Zhichu Chen
\setupmathematics[integral=nolimits]


On Wed, Apr 30, 2014 at 12:54 PM, Darksair  wrote:

> Hi,
>
> I notice today that in display math, \int_a^b places a and b completely
> below and above the integral symbol, rather than offsets them to the
> right at the bottom and top as LaTeX does by default.  I also notice
> that I can use \int\nolimits to achieve the LaTeX result.
>
> Is this the supposed behavior of ConTeXt?  Because I remember this was
> not the case 2 years ago.  Also can I somehow let ConTeXt use that
> \nolimits by default?
>
> Thanks.
>
> --
> Fear is the path to the dark side.
> Fear leads to anger,
> Anger leads to hate,
> Hate leads to suffering
>
> ___
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Unnumbered chapters before the ToC

2014-01-15 Thread Zhichu Chen
Hi Robert,


On Thu, Jan 16, 2014 at 5:51 AM, Robert Blackstone <
blackstone.rob...@gmail.com> wrote:

>
> On 15 Jan 2014, at 21:54 , Wolfgang Schuster 
>  wrote:
>
> Am 15.01.2014 um 15:36 schrieb Robert Blackstone <
> blackstone.rob...@gmail.com>:
>
> Dear all,
>
> Is there, in a book-project, a way to place unnumbered chapters, in casu
> Acknowledgements and Abstract, in the FrontMatter before the ToC, but still
> mentioned in the ToC?
>
>
> \definehead[prechapter][chapter]
> \setuphead [prechapter][number=no,incrementnumber=list]
>
> \starttext
>
> \prechapter{Unnumbered chapter}
>
> \title{Contents}
>
> \placelist[prechapter,chapter]
>
> \chapter{Numbered chapter}
>
> \stoptext
>
> Wolfgang
>
>
> Thank you Wolfgang. This works and it will very likely also work for my
> project.
> I'm afrraid though that I left out an important detail, namely that the
> ToC itself must be mentioned in the ToC.
> What I'm expected to emulate is the following: (with real pagenumbers of
> course)
>
> *CONTENTS*
>
> *Acknowledgements* i
> *Abstract* ii
> *Contents* iii
> *List of Illusttratiions* iv
> *List of Tables* v
> *Abbreviations and Library sigla* vi
> *Preface* vii
>
> Chapter 1 8
> Chapter 2 etc.
>
> So my real question should have been: Is there a way to place the ToC in
> an unnumbered chapter, which should not be at the very beginning of the
> book?
> But you have suggested the answer already: Changing \title{Contents} to
> \prechapter{Contents} does just that. Clean solution for an, imho,  odd
> request.
>
Please use:
\completecontent[criterium=all]
to generate the ToC, and set
\setupcombinedlist
  [content]
  [list={title,chapter,section,subsection}]
to include the entries you want.

>
> Best regards,
> Robert Blackstone
>
>
> ___
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Weird page numbering

2014-01-12 Thread Zhichu Chen
minimal code:
===
\setuppagenumbering[alternative=doublesided]

\starttext

\startstandardmakeup
TITLE
\stopstandardmakeup

\startfrontmatter
  \chapter{Preface}
  \completecontent[criterium=all]
\stopfrontmatter

\stoptext
===
The page number of the preface chapter shown in the table of contents is 0
in my recent ConTeXt:
context -version

mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2014.01.11 23:58


I'm currently fine with that feature but


-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Simplefonts

2013-10-13 Thread Zhichu Chen

On 10/13/2013 01:39 AM, Wolfgang Schuster wrote:


Am 12.10.2013 um 15:04 schrieb Zhichu Chen <mailto:zhichu.c...@gmail.com>>:



Hi Wolfgang,

Good to know that, but I might have some questions.


On Fri, Oct 11, 2013 at 2:02 AM, Wolfgang Schuster 
mailto:wolfgang.schus...@gmail.com>> wrote:


Hi all,

\definefallbackfamily [mainface] [serif] [DejaVu Serif]
[range=cyrillic,force=yes]

What if I want to use the CJK font? The code in "font-sel.mkvi" hints 
I could use range=chinese but it didn't work. I have to use interval 
{0x00400-0x2FA1F} explicitly.


When you take a look into char-def.lua you can see names certain 
character ranges and “range=cyrillic”

used such a name.

For a chinese font you need 
“range={cjkunifiedideographs,cjkunifiedideographsextensiona,…}".
Because the list with names is very long you do this setup only once 
with the \definefontfamilypreset

command, e.g.

\definefontfamilypreset[chinese][range={cjkunifiedideographs,cjkunifiedideographsextensiona,…}]

and load this setup when you set the font with 
\definefontfamilyfallback, e.g.


  \definefontfamilyfallback[][

Re: [NTG-context] Simplefonts

2013-10-12 Thread Zhichu Chen
Hi Wolfgang,

Good to know that, but I might have some questions.


On Fri, Oct 11, 2013 at 2:02 AM, Wolfgang Schuster <
wolfgang.schus...@gmail.com> wrote:

> Hi all,
>
> I’m happy to announce a new version of the simplefonts code. Thew new
> version of the code
> is a complete rewrite and brings many changes.
>
> 1. The module is now part of the core and no external module is needed
> anymore.
>
> 2. The commands to select a font have changed to commands which fit better
> to context normal syntax.
>
> 3. I removed the keys to enable font expansion and protrusion, when you
> need them use \definefontfeature.
>
>
> To use a font with the simplefonts code two ways are available. The first
> method is to create
> one or more typefaces and load it with \setupbodyfont. A complete example
> for this is:
>
> \definefontfamily [mainface] [serif] [DejaVu Serif]
> \definefontfamily [mainface] [sans]  [DejaVu Sans]
> \definefontfamily [mainface] [mono]  [DejaVu Sans Mono] [feature=none]
>
It seems the keyword here is "features"? Only the plural version works here
in my newest beta.

> \definefontfamily [mainface] [math]  [TeX Gyre Pagella Math]
>
> \setupbodyfont[mainface]
>
> \starttext
> \startlines
> \rm DejaVu Serif
> \ss DejaVu Sans
> \tt DejaVu Sans Mono
> \m{c^2 = a^2 + b^2}
> \stoplines
> \stoptext
>
>
> The second method is similar to the old commands of the simplefonts module
> (e.g. \setmainfont)
> where the font is enabled after it was set and no \setupbodyfont is
> necessary. Below is a example
> for this method but I recommend to avoid this method because it’s slow
> when you set font a font
> for each style in your document.
>
> \setupfontfamily [serif] [DejaVu Serif]
> \setupfontfamily [sans]  [DejaVu Sans]
> \setupfontfamily [mono]  [DejaVu Sans Mono] [feature=none]
> \setupfontfamily [math]  [TeX Gyre Pagella Math]
>
> \starttext
> \startlines
> \rm DejaVu Serif
> \ss DejaVu Sans
> \tt DejaVu Sans Mono
> \m{c^2 = a^2 + b^2}
> \stoplines
> \stoptext
>
>
> Another feature of simplefonts is the ability to set a fallback font when
> you need certain glyphs
> from a different font (e.g. for cyrillic ) which aren’t available in the
> mainfont of the document.
> To set such a fallback font the code provides the \definefallbackfamily
> command where you
> can set in the fourth argument the range for the replacement characters.
>
> \definefallbackfamily [mainface] [serif] [DejaVu Serif]
> [range=cyrillic,force=yes]
>
What if I want to use the CJK font? The code in  "font-sel.mkvi" hints I
could use range=chinese but it didn't work. I have to use interval
{0x00400-0x2FA1F} explicitly.

And how can I assign the boldfont, italicfont and bolditalicfont? I'm
currently using the Adobe Song Std as the regular font but it didn't come
with a bold version or else, hence I might need this feature.

> \definefontfamily [mainface] [serif] [TeX Gyre Pagella]
>
> \setupbodyfont[mainface]
>
> \starttext
>
> \input knuth
>
> Традиционная систематика лишайников оказывается во многом условна и
>
> \stoptext
>
>
> Wolfgang
>
> ___
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___




-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] simpleslides bug?

2013-02-21 Thread Zhichu Chen
On Thu, Feb 21, 2013 at 5:38 PM, Thomas A. Schmitz <
thomas.schm...@uni-bonn.de> wrote:

> On 02/21/2013 09:31 AM, Hans Hagen wrote:
>
>> On 2/21/2013 2:21 AM, Zhichu Chen wrote:
>>
>>  This must be a consequence of the new MP instance code. I can
>>> reproduce the error, but I can't isolate it. I think the lines
>>>
>>> Thanks for the tip. After I've committed the lines with
>>> Field[Text][Text] in simpleslides-s-BigNumber.tex, it could compile
>>> successfully. I think this is a metafun bug?
>>>
>>
> Do you mean "commented"?

Sure. I have no idea why I typed "committed."

>
>
>
>> Make sure that you run the latest beta. Indeed there has been a change
>> to these Page related areas because in a recent mp there were several
>> issues (most related to memory leaks), so I made a less demanding
>> implementation. In the meantime Taco has fixed a lot of mp issues so
>> upcoming luatex/mplib are okay (performance and memory wise). It all
>> relates to mp now having scaled and double mode.
>>
>> (Alan is testing the mp double mechanisms.)
>>
>
> So it makes sense to wait a couple of days before looking into this?
>

>
> Thomas
> __**__**
> ___
> 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 <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : 
> http://foundry.supelec.fr/**projects/contextrev/<http://foundry.supelec.fr/projects/contextrev/>
> wiki : http://contextgarden.net
> __**__**
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] simpleslides bug?

2013-02-20 Thread Zhichu Chen
On Wed, Feb 20, 2013 at 4:54 PM, Thomas A. Schmitz <
thomas.schm...@uni-bonn.de> wrote:

> Maybe this is my fault. The simpleslides module works just fine these days
>> and I "accidentally" updated the ConTeXt to the latest version:
>>
>> context --version
>>
>> mtx-context | ConTeXt Process Management 0.60
>> mtx-context |
>> mtx-context | main context file: /opt/context/tex/texmf-**
>> context/tex/context/base/**context.mkiv
>> mtx-context | current version: 2013.02.13 18:06
>>
>> and this small piece of code failed to compile:
>>
>> \usemodule[simpleslides][**style=BigNumber]
>> \starttext
>> \SlideTitle{Test}
>> test
>> \stoptext
>>
>
>
> This must be a consequence of the new MP instance code. I can reproduce
> the error, but I can't isolate it. I think the lines

Thanks for the tip. After I've committed the lines with Field[Text][Text]
in simpleslides-s-BigNumber.tex, it could compile successfully. I think
this is a metafun bug?

>
>
> metapost> initializing instance 'metafun' using format 'metafun'
> metapost> loading 'metafun': /opt/context/tex/texmf-**
> context/metapost/context/base/**metafun.mpiv, using method: default
> metapost> initializing number mode "scaled"
>
> point to the source of the error, but I don't know where to look.
>
>
> On 02/18/2013 01:54 PM, Jaroslav Hajtmar wrote:
>
>> With older version:
>> ConTeXt ver: 2013.01.02 18:19 MKIV fmt: 2013.1.7 int: english/english
>> works too! (Win7 64b).
>> In actual TeXlive 2012 version this example work too.
>>
>>
>> It seems that we gradually stop working other variations simpleslides
>> module.
>>
>> Jaroslav Hajtmar
>>
>
> I have no idea what this is supposed to mean.
>
> Thomas
>
>
> __**__**
> ___
> 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  : 
> http://foundry.supelec.fr/**projects/contextrev/
> wiki : http://contextgarden.net
> __**__**
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] simpleslides bug?

2013-02-17 Thread Zhichu Chen
Maybe this is my fault. The simpleslides module works just fine these days
and I "accidentally" updated the ConTeXt to the latest version:

context --version

mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2013.02.13 18:06

and this small piece of code failed to compile:

\usemodule[simpleslides][style=BigNumber]
\starttext
\SlideTitle{Test}
test
\stoptext

and gave me the following error message:

simpleslides> loading Big Number style
system  > command \NormalHeight is already defined
system  > command \NormalWidth is already defined
system  > command \PictureFrameHeight is already defined
system  > command \PictureFrameWidth is already defined
colors  > rgb color space is supported
colors  > cmyk color space is supported
))
fonts   > bodyfont 24.0414pt is defined (can better be done global)
metapost> initializing instance 'metafun' using format 'metafun'
metapost> loading 'metafun':
/opt/context/tex/texmf-context/metapost/context/base/metafun.mpiv, using
method: default
metapost> initializing number mode "scaled"
*** glibc detected *** luatex: double free or corruption (fasttop):
0x057da5a0 ***
=== Backtrace: =
/lib64/libc.so.6(+0x7d836)[0x7ff8ff104836]
luatex(mp_free_node+0x3b)[0x6406fb]
luatex[0x66637c]
luatex[0x6743be]
luatex[0x6724b8]
luatex[0x670210]

there're more and if it is important for the diagnostics please let me know
and I will provide the whole message which I thought was relevant.


Anyone can confirm this?

-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Limitation of mixedcolumns?

2012-07-28 Thread Zhichu Chen
The "nested mixedcolumns" does not work properly when it reaches the
bottom of the "outer mixedcolumns" here:
$ context --version

mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file:
d:/ConTeXt/tex/texmf-local/tex/context/base/context.mkiv
mtx-context | current version: 2012.07.24 15:58

here is the minimal example (mostly copied from page-mix.mkiv
===
\setupbodyfont[5pt]


\starttext

\setupmixedcolumns
  [boxedcolumns]
  [n=2,
   balance=no]

\definemixedcolumns
  [nestedboxedcolumns]
  [boxedcolumns]
  [n=2,
   background=color,
   backgroundcolor=yellow,
   color=red,
   strut=yes,
   balance=yes,
   backgroundoffset=0mm]

\startboxedcolumns
%\dorecurse{10}{\input zapf \par \input ward \par} \obeydepth
\startnestedboxedcolumns
\dorecurse{15}{\input zapf\par}
\stopnestedboxedcolumns
\par \input zapf \par \obeydepth
\startnestedboxedcolumns
\input zapf
\stopnestedboxedcolumns
\par \input zapf
\stopboxedcolumns

\stoptext

-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Is there a replacement for \tracechinesetrue in mkiv?

2011-12-30 Thread Zhichu Chen
Well, that's just perfect, only it's not what I'm looking for :( What
I need is a fully customable way to debug some of my inputs rather
than everything as a font feature.

I found a "cleaner" way now: to use the "whatsit" node, I hope it's
useful for someone so I paste the function here:


local function trace_boundingbox (head)
for n in node.traverse (head) do
if n.id == node.id ('glyph') then
  local ht,wd,dp = n.height,n.width,n.depth
  local htsp,wdsp,dpsp = ht/65536,wd/65536,dp/65536
  local w = node.new("whatsit","pdf_literal")
  w.data = "q 1 0 1 RG 1 0 1 rg 0.1 w 0 " .. -dpsp .. " m 0 "
.. htsp .. " l " .. -wdsp .. " " .. htsp .. " l " .. -wdsp .. " " ..
-dpsp .. " l s  0 1 0 RG 0 1 0 rg 0.1 w [2 1] 0 d 0 0 m " .. -wdsp ..
" 0 l S Q"
  node.insert_after (head, n, w)
end
end
end




On Thu, Dec 29, 2011 at 10:18 PM, Hans Hagen  wrote:
> On 29-12-2011 04:22, Zhichu Chen wrote:
>>
>> All right, after some readings, I came out with a node solution. The
>> major idea is listed below and works just fine. "n" from node_traverse
>> (head) and n.id==node.id ('glyph')
>>
>> My question is: is there a better way? Because these codes are so
>> dirty. I prefer mplib but I have no clue how to do that.
>
>
> Using mp would be pretty complex too and all solutions are rather
> inefficient (bloat the pdf) .. attached another solution (I'll add it to the
> next beta).
>
>
> Hans
>
> -
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Is there a replacement for \tracechinesetrue in mkiv?

2011-12-28 Thread Zhichu Chen
All right, after some readings, I came out with a node solution. The
major idea is listed below and works just fine. "n" from node_traverse
(head) and n.id==node.id ('glyph')

My question is: is there a better way? Because these codes are so
dirty. I prefer mplib but I have no clue how to do that.

=
  local ht,wd,dp = n.height,n.width,n.depth ;
  local rwd = .5*65536
  local k1 = node.new('kern')
  k1.kern = -wd-.5*rwd
  local r1 = node.new("rule")
  r1.width, r1.height, r1.depth = rwd, ht, dp
  local k2 = node.new('kern')
  k2.kern = -r1.width
  local r2 = node.new("rule")
  r2.width, r2.height, r2.depth = wd+rwd, ht+.5*rwd, -ht+.5*rwd
  local k3 = node.new('kern')
  k3.kern = -r2.width
  local r3 = node.new("rule")
  r3.width, r3.height, r3.depth = wd+rwd, -dp+.5*rwd, dp+.5*rwd
  local k4 = node.new('kern')
  k4.kern = -.5*rwd
  local r4 = node.new("rule")
  r4.width, r4.height, r4.depth = rwd, ht, dp
  local k5 = node.new('kern')
  k5.kern = -.5*rwd
  k1.next = r1
  r1.prev = k1
  r1.next = k2
  k2.prev = r1
  k2.next = r2
  r2.prev = k2
  r2.next = k3
  k3.prev = r2
  k3.next = r3
  r3.prev = k3
  r3.next = k4
  k4.prev = r3
  k4.next = r4
  r4.prev = k4
  r4.next = k5
  k5.prev = r4
  local box = node.hpack(k1)
  local tb = node.vpack(box)
  insert_after (head, n, tb)
=====

On Thu, Dec 22, 2011 at 6:47 AM, Hans Hagen  wrote:
> On 21-12-2011 12:16, Zhichu Chen wrote:
>>
>> Hi,
>>
>> I wrote some CJK vertical typesetting macros in mkii a long time ago
>> and I want to adopt it to mkiv. Sadly the \iftracechinese is gone. Can
>> I still draw boxes of each glyph to see if they are aligned in my way?
>> Drawing a line in the background is so not cool.
>
>
> mkiv does things completely different
>
> Hans
>
>
>
> -
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Is there a replacement for \tracechinesetrue in mkiv?

2011-12-21 Thread Zhichu Chen
Interesting, so I guess I should write some lua code? Since I have
little experience in that area, could you provide a minimal example
just to show me how to draw the baseline of each glyph?

Thanks

On Thu, Dec 22, 2011 at 6:47 AM, Hans Hagen  wrote:
>
> mkiv does things completely different
>
> Hans
>
>
>
> -
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Is there a replacement for \tracechinesetrue in mkiv?

2011-12-21 Thread Zhichu Chen
Hi,

I wrote some CJK vertical typesetting macros in mkii a long time ago
and I want to adopt it to mkiv. Sadly the \iftracechinese is gone. Can
I still draw boxes of each glyph to see if they are aligned in my way?
Drawing a line in the background is so not cool.

-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] writing a label with a subscript in MetaFun.

2011-04-19 Thread Zhichu Chen
try

label (textext("$z_{" & decimal (i) & "}$" ), z[i]) ;

On Wed, Apr 20, 2011 at 10:03 AM, Jeong Dalyoung  wrote:

> Dear all,
>
> I'd like to write a label with a subscript in MetaFun where the subscript
> is a variable.
>
> I tried in several way but not succeed. The best which I made is
>
> for i= 0 upto 8:
> label( "z" & decimal i, z[i]);
> endfor;
>
> So the output is z1, z2, z3, ...
> And, the following commands are not working.
>
> label(btex z_i etex, z[i]);  no error but the value of i is not listed.
> label(btex z_\MPvar{i} etex, z[i]);  error
>
> Is there a good way to do that?
>
> Thank you for reading.
>
> Best regards,
>
> Dalyoung
>
>
> ___
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] problem with publication

2011-04-12 Thread Zhichu Chen
The following code generates an error about "! LuaTeX error
...onTeXt/tex/texmf-local/tex/context/base/bibl-tra.lua:192: attempt to
compare number with string"

\startpublication[k=1,t=article,a={{Test},{}},y=2012]
\artauthor[]{Test}[T.]{}{Test}
\pubyear{2012}
\arttitle{Test}
\journal{Test}
\pages{1}
\stoppublication
\starttext
abc\cite[1]
\placepublications[criterium=text]
\stoptext

I also tried the bibtex alternative, and it got the same error as well.
$ context --version
mtx-context | main context file:
d:/ConTeXt/tex/texmf-local/tex/context/base/context.mkiv
mtx-context | current version: 2011.04.11 18:55
-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] columnset failed in the latest beta

2011-03-31 Thread Zhichu Chen
Minimal code:

\definecolumnset[columntest][n=2,balance=yes]
\definecolumnsetspan[wide][n=2]
\starttext
\startcolumnset[columntest]
\startcolumnsetspan[wide]
\dorecurse{3}{\input knuth\par}
\stopcolumnsetspan
\dorecurse{10}{\input knuth\par}
\stopcolumnset
\stoptext

There is no columnsetspan, and a wide frame shows up instead.


-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-obsolete & mkii problem

2011-03-31 Thread Zhichu Chen
I think I've reported that feature a few days ago. It could be \m!systems,
so I have to define \m!system as \m!systems before loading the bib module.

On Thu, Mar 31, 2011 at 6:55 PM, Mojca Miklavec <
mojca.miklavec.li...@gmail.com> wrote:

> Dear Hans,
>
> would it be possible to change the following line in m-obsolete.tex
>\writestatus\m!system{skipping obsolete module}
> so that it wouldn't generate errors (undefined m!system) when
> compiling with mkii? (I suspect that it is connected with bib module,
> but I'm not sure).
>
> Thanks a lot,
>   Mojca
>
> ___
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] m-obsolete.tex has an undefined control sequence

2011-03-02 Thread Zhichu Chen
Hi Hans,

I guess it should be
\writestatus\m!system{skipping obsolete module}

but somehow the file in the latest beta reads
\writestatus\m!systems{skipping obsolete module}

I have to define this macro to
\def\m!systems{\m!system}
before loading the bib module so that I can keep the system untouched.

-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] "focus" is gone in \setupinteraction?

2010-09-28 Thread Zhichu Chen
Well, focus=width doesn't work in my test file:

\setupinteraction
 [state=start,
  focus=fit,
  openaction=FitWidth]

\starttext
\goto{link}[page(5)]
\dorecurse{10}{\input knuth \page}
\stoptext



I also checked
http://wiki.contextgarden.net/Reference/en/setupinteraction
and no focus option

-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] beta

2010-09-11 Thread Zhichu Chen
Fine, I see what's the problem: I can't find my fonts.

I run
mtxrun --script fonts --reload
and
luatools AdobeSongStd-Light.otf
get
d:/ConTeXt/tex/texmf-fonts/fonts/opentype/public/Adobe/AdobeSongStd-Light.otf
But when I run
mtxrun --script fonts --list --file Adobe
I get nothing ironically.

Did I miss something? I've put the texmfcnf.lua under texmf/web2c.

On Sat, Sep 11, 2010 at 12:19 PM, Zhichu Chen  wrote:

>
>
> On Fri, Sep 10, 2010 at 11:59 PM, Hans Hagen  wrote:
>
>> On 10-9-2010 10:43, Zhichu Chen wrote:
>>
>>> My apology. I attach the test file here and hope that's gonna help.
>>> I extract everything from the font package to
>>> $texmf-fonts/fonts/data/bh/lucida
>>> and that's it.
>>>
>>
>> works ok here
>>
>> did you run mtxrun --generate etc?
>
> Yes, I did. But weird thing happened when I run the command manually again.
> I
> got the following message:
> ===
> systems : begin file untitled-2.tex at line 3
>
> {d:/ConTeXt/tex/texmf-fonts/fonts/map/dvips/bh/lucida/lucida.map}
>
> fontnames > font database does not match configuration and file hashes
>
> fontnames > warnings are disabled (tracker 'fonts.warnings')
>
> fontnames > identifying tree font files with suffix otf
> ===
>
>
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] beta

2010-09-10 Thread Zhichu Chen
On Fri, Sep 10, 2010 at 11:59 PM, Hans Hagen  wrote:

> On 10-9-2010 10:43, Zhichu Chen wrote:
>
>> My apology. I attach the test file here and hope that's gonna help.
>> I extract everything from the font package to
>> $texmf-fonts/fonts/data/bh/lucida
>> and that's it.
>>
>
> works ok here
>
> did you run mtxrun --generate etc?

Yes, I did. But weird thing happened when I run the command manually again.
I
got the following message:
===
systems : begin file untitled-2.tex at line 3

{d:/ConTeXt/tex/texmf-fonts/fonts/map/dvips/bh/lucida/lucida.map}

fontnames > font database does not match configuration and file hashes

fontnames > warnings are disabled (tracker 'fonts.warnings')

fontnames > identifying tree font files with suffix otf
===


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



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] beta

2010-09-09 Thread Zhichu Chen
Works funny on my Lucida fonts, something about
=
structure   : section @ level 3 : 0.0.9 -> References
define fonts> font with name LucidaBright is not found
define fonts> unknown font LucidaBright, loading aborted
define fonts> unable to define LucidaBright as \*lucida8ptrmtfa*
=
the funny part is, I can get the math symbols and the lucida bright fonts in
the
pdf file, but there're no bold, italic and small caps, and the whole
document
is using the same font size, the titles aren't enlarged.

On Fri, Sep 10, 2010 at 6:08 AM, Hans Hagen  wrote:

> Hi,
>
> I uploaded a beta. There have been some changes in the initial font loading
> code (mostly an experiment and hopefully compatible). The default
> load->cache method is unchanged (and tagged table') but you can configure
> others (given tat you run luatex 0.63)
>
> There are three optional levels of intermediate garbage collection:
>
>  \enabledirectives[fonts.otf.loader.cleanup=1] % true|false 1 2 3
>
> The higher the number, the less memory is used (I'm preparing a chapter for
> hybrid.pdf that discusses these methods and gives some statistics). By
> default cleanup is turned off. Garbage collection efficiency differs per
> situation and is somewhat platform dependent.
>
> There are three methods but only table and sparse make sense:
>
>  \enabledirectives[fonts.otf.loader.method=table]
>  \enabledirectives[fonts.otf.loader.method=mixed]
>  \enabledirectives[fonts.otf.loader.method=sparse]
>
> In some cases sparse might save a bit of memory but at the cost of runtime
> and even then it only concerns making a font cache-ready so in practice it
> is seldom needed to change the defaults.
>
> Only mess around with these directives if you are convinced that it will
> improve your situation. As said, these are the results of an experiment so
> we keep them around.
>
> If no serious problems are found in the beta I will release a current, so
> that we're nicely in sync with todays luatex beta.
>
> Hans
>
>
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] My mtx-fonts.lua script is broken?

2010-08-23 Thread Zhichu Chen
On Mon, Aug 23, 2010 at 5:26 PM, Taco Hoekwater  wrote:

> On 08/23/2010 10:33 AM, Zhichu Chen wrote:
>
>> virtual math > font LMMath8-Regular, no parameters set
>> ! TeX capacity exceeded, sorry [parameter stack size=60].
>>
>
>  ==
>> Well, can you give me a hint what's wrong here?
>>
>
> Wild guess: you installed a zip from the website, but did not
> copy contextcnf.lua to the name texmfcnf.lua (should be next to
> texmf.cnf). The context minimals does this for you automatically.
>
Yea, you're right. I copy the file to where you suggested to put and it
works just fine. Interesting.

Thank you very much and may I suggest that it's time for the "ctxtools"
update script to be updated.

>
> Best wishes,
> Taco
>



-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] My mtx-fonts.lua script is broken?

2010-08-23 Thread Zhichu Chen
It may have happened a long time ago. I just updated my context and could
not compile my document with \setupbodyfont[lucida], something like:

===
define fonts> forced type afm of stmary10 not found
define fonts> font with name stmary10 is not found
load otf> loading:
d:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroma
n8-bold.otf (hash: lmroman8-bold)
load otf> font loaded okay
load otf> file size: 112404
load otf> enhancing ...
load otf> saving in cache:
d:/ConTeXt/tex/texmf/fonts/opentype/public/l
m/lmroman8-bold.otf
report | lua: compiling
d:/ConTeXt/tex/texmf-cache/luatex-cache/context/04a4119
fb83ff6c1c1b215f165317af6/fonts/otf/lmroman8-bold.tma into
d:/ConTeXt/tex/texmf
-cache/luatex-cache/context/04a4119fb83ff6c1c1b215f165317af6/fonts/otf/lmroman8
-bold.tmc
virtual math> font LMMath8-Regular, no parameters set
! TeX capacity exceeded, sorry [parameter stack size=60].
\xdodefinebodyfont [#1][#2][#3]->
 \checkrelativefontsize {#2}\ifcsname
#2\end...

\dododododefinedefaultbodyfont ...csname {4pt}{rm}
  \fi
\next7 #1,->\dododododefinedefaultbodyfont {#1}
   \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
  ]\relax \global \advance
\...

\next6 #1,->\dodododefinedefaultbodyfont {#1}
 \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
  ]\relax \global \advance
\...
...
l.22 \setupbodyfont[lucida]

!  ==> Fatal error occurred, no output PDF file produced!
MTXrun | fatal error: return code: 1
===

Last time I saw this message, I was preparing a document in a hurry so
I just download an old cont-tmf.zip and it's okay again.

I got a font AdobeSongStd-Light.otf and after
==
mtxrun --script fonts --reload
==
I still could not find it:
======
zhi...@zhichu-pc /context/tex
$ mtxrun --locate AdobeSongStd-Light.otf
tree:///d:/ConTeXt/tex/texmf-fonts/fonts/opentype/public/Adobe/AdobeSongStd-Light.otf
zhi...@zhichu-pc /context/tex
$ mtxrun --script fonts --list --pattern=Adobe*

zhi...@zhichu-pc /context/tex
$
==
Well, can you give me a hint what's wrong here?


-- 
Best Regards
Chen
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] PDF Custom Page Numbering

2010-06-09 Thread Zhichu Chen
On Thu, Jun 10, 2010 at 12:35 PM, Aditya Mahajan  wrote:

> On Wed, 9 Jun 2010, Hartmut Henkel wrote:
>
>  On Wed, 9 Jun 2010, Andreas Schneider wrote:
>>
>>  while reading through the PDF to ISO-9075-1 (SQL99), I noticed
>>> something I had never seen before in a PDF: the page numbers displayed
>>> by Acrobat matched exactly the ones in the document ... the beginning
>>> was even numbered with roman numbers and the actual content started
>>> again at "Page 1". From a quick research it seems that this
>>> functionality is in PDF since Acrobat 4 (that should be PDF 1.3,
>>> right?) and is most likely called "Custom Page Numbering". It would be
>>> amazing if ConTeXt/LuaTeX supports that too - especially if you
>>> produce documents for screen reading.
>>>
>>> Unfortunately I don't have access to the PDF Specification currently
>>> to give you more info - so I don't even know for sure how that feature
>>> is officially called.
>>>
>>> Anyway, I hope that idea/suggestion/wish finds positive reactions ...
>>> and I somehow hope that it isn't actually too hard to implement :-)
>>>
>>
>> it's named "Page Labels" (never seen before, thanks for the pointer), in
>> the PDF Reference 5th ed. it's in section 8.3.1, the example 8.3 there
>> typed into \pdfcatalog{} works right away, so no luatex engine
>> modification needed.
>>
>
> IIRC, the hyperref package in LaTeX supports this. I do not know if there
> is a direct ConTeXt support.
>

Not direct, but ConTeXt CAN do this:
http://www.ntg.nl/pipermail/ntg-context/2008/036947.html
http://archive.contextgarden.net/message/20081016.174838.bff55fc9.en.html


>
> 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Math in MKIV - HOWTO

2010-03-02 Thread Zhichu Chen
On Tue, Mar 2, 2010 at 11:23 PM, Mojca Miklavec
 wrote:
> On Tue, Mar 2, 2010 at 15:28, Hans Hagen wrote:
>> On 2-3-2010 14:49, Mojca Miklavec wrote:
>>
>> hm, but for me name compatibility with every latex math package is no
>> objective; i'd rather that we're unicode math compiant (and i don't care too
>> much what route latex follows)
>
> I would not care too much about LaTeX either, but what does Unicode
> compliance mean?
>
> \symbol{DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW}?
>
>>> Out of the whole vector only some 5-10% of glyphs works now.
>>
>> is it that bad? interesting is that lucida was one of the first fonts
>> context supported so the transition from yandy->tug has really messed up
>> things then
>
> It's not about messing things up, but about missing "mathname=" in
> char-def.lua for all the unicode entries for special glyphs. If those
> glyphs worked in MKII from the very beginning, they won't work before
> one adds several entries to
>
> But of course they should work flawlessly when they are entered as
> unicode characters. They only fail to work when one enters
> \zrangeantirestriction for example.

I'm sorry, this is just my comment from the unicode chart. I'm pretty sure
that won't work. I download the chart, compare the symbols in the tables
one by one without even knowing the meanings. Is there like a table of
macros of all symbols?


>
> Mojca
>



-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Math in MKIV - HOWTO

2010-03-02 Thread Zhichu Chen
On Tue, Mar 2, 2010 at 6:45 PM, Hans Hagen  wrote:
> On 1-3-2010 17:26, Zhichu Chen wrote:
>>
>> Hi, I got some time today and checked some symbols of hlcra.tfm
>> (LucidaNewMath-Arrows), and got this table:
>
> so that table replaces lbr-ma in math-vfu?
yes. And don't forget the correction:
Correction:
[0x021D5] = 0x65, -- Downrightarrow
It's wrong, should be:
[0x021D8] = 0x65, -- Downrightarrow
>
> mojca/aditya: can you check this and send me an updated/patch for math-vfu?
>
> -
>                                          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
> -
>



-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Math in MKIV - HOWTO

2010-03-01 Thread Zhichu Chen
Correction:
[0x021D5] = 0x65, -- Downrightarrow
It's wrong, should be:
[0x021D8] = 0x65, -- Downrightarrow

On Tue, Mar 2, 2010 at 12:26 AM, Zhichu Chen  wrote:
> Hi, I got some time today and checked some symbols of hlcra.tfm
> (LucidaNewMath-Arrows), and got this table:
>
> 
> fonts.enc.math["lucida-ma"] = {
>    [0x025CB] = 0x00, -- circle
>    [0x025CF] = 0x01, -- blackcircle
>    [0x025A1] = 0x02, -- square
>    [0x025A0] = 0x03, -- blacksquare
>    [0x025B3] = 0x04, -- triangleup
>    [0x025B2] = 0x05, -- blacktriangleup
>    [0x025BD] = 0x06, -- triangledown
>    [0x025BC] = 0x07, -- blacktriangledown
>    [0x02B28] = 0x08, -- lozenge
>    [0x02B27] = 0x09, -- blacklozenge
>    [0x02B29] = 0x0A, -- blackdiamond
>    [0x02571] = 0x0B, -- upright
>    [0x02572] = 0x0C, -- downright
>    [0x022E4] = 0x0D, -- squareimageofnoteq
>    [0x022E5] = 0x0E, -- squareoriginalofnoteq
>    [0x02A4F] = 0x0F, -- dblsquareunion
>    [0x02A4E] = 0x10, -- dblsquareintersection
>    [0x02A64] = 0x11, -- zdomainantirestriction
>    [0x02A65] = 0x12, -- zrangeantirestriction
>    [0x022EE] = 0x13, -- verticalellipsis
>    [0x022EF] = 0x14, -- ellipsis
>    [0x022F0] = 0x15, -- uprightellipsis
>    [0x022F1] = 0x16, -- downrightellipsis
>    [0x022D5] = 0x17, -- equalparallel
>
>
>    [0x0225B] = 0x1A, -- stareq
>    [0x00127] = 0x1B, -- hbar
>    [0x022F6] = 0x1C, -- barelementof
>    [0x02209] = 0x1D, -- notelementof
>    [0x022FD] = 0x1E, -- barcontains
>    [0x0220C] = 0x1F, -- notcontain
>    [0x02204] = 0x20, -- nexists
>    [0x02194] = 0x21, -- leftrightarrow
>    [0x02195] = 0x22, -- updownarrow
>    [0x0219E] = 0x23, -- leftleftarrow
>    [0x0219F] = 0x24, -- upuparrow
>    [0x021A0] = 0x25, -- rightrightarrow
> --~     [0x00026] = 0x26, -- amperand
>    [0x021A1] = 0x27, -- downdownarrow
>    [0x021A2] = 0x28, -- leftarrowtail
>    [0x021A3] = 0x29, -- rightarrowtail
>    [0x021A4] = 0x2A, -- leftarrowbar
>    [0x021A6] = 0x2B, -- rightarrowbar
>    [0x021A5] = 0x2C, -- uparrowbar
> --~     [0x02212] = 0x2D, -- minus
> --~     [0x0002D] = 0x2D, -- minus
>    [0x021A7] = 0x2E, -- downarrowbar
>    [0x021E4] = 0x2F, -- barleftarrow
>    [0x021E5] = 0x30, -- barrightarrow
>
>    [0x021E0] = 0x38, -- dashleftarrow
>    [0x021E1] = 0x39, -- dashuparrow
>    [0x021E2] = 0x3A, -- dashrightarrow
>    [0x021E3] = 0x3B, -- dashdownarrow
>    [0x021A9] = 0x3C, -- hookleftarrow
> --~     [0x0003D] = 0x3D, -- equalto
>    [0x021AA] = 0x3E, -- hookrightarrow
>    [0x021AB] = 0x3F, -- looparrowleft
>    [0x021AC] = 0x40, -- looparrowright
>    [0x1D538] = 0x41, -- A                     (blackboard A)
>    [0x1D539] = 0x42, -- B
>    [0x02102] = 0x43, -- C
>    [0x1D53B] = 0x44, -- D
>    [0x1D53C] = 0x45, -- E
>    [0x1D53D] = 0x46, -- F
>    [0x1D53E] = 0x47, -- G
>    [0x0210D] = 0x48, -- H
>    [0x1D540] = 0x49, -- I
>    [0x1D541] = 0x4A, -- J
>    [0x1D542] = 0x4B, -- K
>    [0x1D543] = 0x4C, -- L
>    [0x1D544] = 0x4D, -- M
>    [0x02115] = 0x4E, -- N
>    [0x1D546] = 0x4F, -- O
>    [0x02119] = 0x50, -- P
>    [0x0211A] = 0x51, -- Q
>    [0x0211D] = 0x52, -- R
>    [0x1D54A] = 0x53, -- S
>    [0x1D54B] = 0x54, -- T
>    [0x1D54C] = 0x55, -- U
>    [0x1D54D] = 0x56, -- V
>    [0x1D54E] = 0x57, -- W
>    [0x1D54F] = 0x58, -- X
>    [0x1D550] = 0x59, -- Y
>    [0x02124] = 0x5A, -- Z                     (blackboard Z)
>    [0x0231C] = 0x5B, -- ulcorner
>    [0x0231D] = 0x5C, -- urcorner
>    [0x0231E] = 0x5D, -- llcorner
>    [0x0231F] = 0x5E, -- lrcorner
>    [0x02225] = 0x5F, -- parallel, Vert, lVert, rVert, arrowvert
>    [0x021D5] = 0x60, -- Updownarrow
>    [0x021D4] = 0x61, -- Leftrightarrow
>    [0x021D6] = 0x62, -- Upleftarrow
>    [0x021D7] = 0x63, -- Uprightarrow
>    [0x021D9] = 0x64, -- Downleftarrow
>    [0x021D5] = 0x65, -- Downrightarrow
>    [0x021CD] = 0x66, -- nLeftarrow
>    [0x021CE] = 0x67, -- nLeftrightarrow
>    [0x021CF] = 0x68, -- nRightarrow
> --~     [0x021CE] = 0x69, -- nLeftrightarrow -- what's the difference
> between this and 0x0067[0x021CE]
>    [0x021DA] = 0x6A, -- Lleftarrow
>    [0x1D55C] = 0x6B, -- k                     \Bbbk (blackboard k)
>    [0x021DB] = 0x6C, -- Rrightarrow
>    [0x021C4] = 0x6D, -- rlarrow
>    [0x021C6] = 0x6E, -- lrarrow
>    [0x021C5] = 0x6F, -- udarrow
> --~     [0x021C5] = 0x70, -- duarrow
>    [0x021C7] = 0x71, -- llarrow
>    [0x021C8] = 0x72, -- uuarrow
>    [0x021C9] = 0x73, -- rrarrow
>    [0x021CA] = 0x74, -- ddarrow
>    [0x021BE] = 0x75, -- rupharpoon
>    [0x021BF] = 0x76, -- lupharpoon
>    [0x021C2] = 0x77, -- rdownharp

Re: [NTG-context] Math in MKIV - HOWTO

2010-03-01 Thread Zhichu Chen
us
[0x0293C] = 0x8A, -- rightarcarrowminus
[0x021BA] = 0x8B, -- anticlockwise
[0x021BB] = 0x8C, -- clockwise

[0x02260] = 0x94, -- noteq
[0x02262] = 0x95, -- notidentical
[0x02241] = 0x96, -- nottilde
[0x02244] = 0x97, -- notasymptoticallyequal
[0x02249] = 0x98, -- notalmostequal
[0x02247] = 0x99, -- notapproximatelyeq
[0x0226E] = 0x9A, -- nless
[0x0226F] = 0x9B, -- ngtr
[0x02270] = 0x9C, -- nleq
[0x02271] = 0x9D, -- ngeq
[0x022E6] = 0x9E, -- lnsim
[0x022E7] = 0x9F, -- gnsim
[0x02605] = 0xAB, -- black star
[0x02713] = 0xAC, -- check
[0x02277] = 0xC5, -- gtlt
[0x02284] = 0xC6, -- nsubsetof
[0x02285] = 0xC7, -- nsupsetof
[0x02288] = 0xC8, -- nsubseteq
[0x02289] = 0xC9, -- nsupseteq

[0x0228A] = 0xCC, -- subsetneq
[0x0228B] = 0xCD, -- supsetneq

--~ [0x0228A] = 0xD0, -- subsetneq
--~ [0x0228B] = 0xD1, -- supsetneq

[0x02270] = 0xD6, -- nleq
[0x02271] = 0xD7, -- ngeq

[0x02268] = 0xDC, -- lneqq
[0x02269] = 0xDD, -- gneqq

[0x022E6] = 0xE0, -- lnsim
[0x02219] = 0xE1, -- bullet
[0x022E7] = 0xE2, -- gnsim

[0x02280] = 0xE5, -- nprec
[0x02281] = 0xE6, -- nsucc

[0x022E8] = 0xEB, -- precnsim
[0x022E9] = 0xEC, -- succnsim

[0x022EA] = 0xEF, -- nnormalsub
[0x022EB] = 0xF0, -- ncontainnormalsub
[0x022EC] = 0xF1, -- nnormalsubeq
[0x022ED] = 0xF2, -- ncontainnormalsubeq

[0x02226] = 0xF7, -- nparallel
[0x022AC] = 0xF8, -- nvdash
[0x022AE] = 0xF9, -- nVdash
[0x022AD] = 0xFA, -- nvDash
[0x022AF] = 0xFB, -- nVDash
}

The empty lines indicate that there're some symbols I can't find in
the unicode chart,
the commented lines indicate that I'm not sure about that.

I don't know if you were working on that. I almost went blind after
this and I hope
you won't go through the same work.

On Wed, Feb 24, 2010 at 8:27 PM, Mojca Miklavec
 wrote:
>>> The double stroke A--Z from U+1D538 -- U+02124 in hlcra.tfm(lbma.pfb)
>>> from 0x41--0x5a are missing, even though I added to the lbr-ma vector
>>> :(
>>
>> you should coordinate this with mojca
>
> Just go on ... I'll check once I finish a few important task (and that
> most probably won't be today), but I promise to do a precise check
> (whether or not the vector will be complete by then - of course it
> will be much easier if Zhichu does the work :).
>
> Mojca
>



-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Math in MKIV - HOWTO

2010-02-24 Thread Zhichu Chen
On Wed, Feb 24, 2010 at 6:24 PM, Hans Hagen  wrote:
> On 24-2-2010 10:01, Hans Hagen wrote:
>
> i uploaded a beta with mkiv lbr vectors (quick and dirty conversion hackery)
>
> \usemodule[fnt-25]
>
> \starttext
>    \setupbodyfont[lucida,12pt]
>    \showmathfontcharacters
> \stoptext
>
> up to others to check and complete them

The double stroke A--Z from U+1D538 -- U+02124 in hlcra.tfm(lbma.pfb)
from 0x41--0x5a are missing, even though I added to the lbr-ma vector
:(

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



-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Math in MKIV - HOWTO (was: Lucida Fonts with MKIV)

2010-02-23 Thread Zhichu Chen
Thanks for the guidance, I finally get my Lucida Math work.

After the \showfont step, I found that I didn't have the "tex-ma"
vector font, and the last two lines in math-vfu.lua should be changed
to:
{ name = "hlcra.tfm", vector = "tex-mb" },
{ name = "hlcrm.tfm", vector = "tex-mi" },
in my case.

By the way, there's a typo in fonts.enc.math["tex-mi"] in
math-vfu.lua, the comment "righttharpoonup" has an extra "t" and I
just wish it could be perfect.

On Tue, Feb 23, 2010 at 7:02 AM, Mojca Miklavec
 wrote:
> These basic set of rules should also apply to fourier or any other
> font that still needs better math support. I'm posting them on the
> list for future reference (for when the next volunteer pops up).
>
>
> On Fri, Feb 19, 2010 at 14:50, Troy Henderson wrote:
>>
>> I have followed the first set of instructions at
>>
>> http://wiki.contextgarden.net/Lucida
> ...
>> Is there an easy way to adapt the configuration file(s) for MKII to MKIV?
>> If this is possible but just requires a tedious process, I'm willing
>> to do this, but I have no clue of the steps needed.
>
> So here are some basic instructions:
>
> Step 1: check what's in the fonts
> =
>
> The file lucida.map includes the following lines:
>
> hlcda LucidaNewMath-Arrows-Demi  hlcdim LucidaNewMath-DemiItalic  hlcdima LucidaNewMath-AltDemiItalic  hlcdm LucidaNewMath-Demibold  hlcdy LucidaNewMath-Symbol-Demi  hlcra LucidaNewMath-Arrows  hlcrim LucidaNewMath-Italic  hlcrima LucidaNewMath-AltItalic  hlcrm LucidaNewMath-Roman  hlcrv LucidaNewMath-Extension  hlcry LucidaNewMath-Symbol 
> After short inspection you may notice that some are just bold
> variants, so you are basically left with only 6 files that you need to
> take care of:
>
> hlcrm LucidaNewMath-Roman  hlcrim LucidaNewMath-Italic  hlcrima LucidaNewMath-AltItalic 
> hlcrv LucidaNewMath-Extension  hlcry LucidaNewMath-Symbol  hlcra LucidaNewMath-Arrows 
> You may want to visualize the content of those fonts by using:
>
> \loadmapfile[lucida.map]
> \starttext
> \showfont[hlcrm]
> \showfont[hlcrim]
> \showfont[hlcrima]
> \showfont[hlcrv]
> \showfont[hlcry]
> \showfont[hlcra]
> \stoptext
>
> Step 2: compare
> =
>
> It might be interesting to know what's in LM (so that you know what
> you need to modify):
>
> \starttext
> \showfont[rm-lmr10]
> \showfont[lmmi10]
> \showfont[lmex10]
> \showfont[lmsy10]
> \stoptext
>
> as well as seing what's in ams fonts perhaps. Now all the info that
> describes the content of these files is in math-tex.mkii (for MKII)
> and math-vfu.lua (for MKIV):
>
> mathematics.make_font ( "lmroman10-math", {
>    { name = "lmroman10-regular.otf", features = "virtualmath", main = true },
>    { name = "rm-lmr10.tfm", vector = "tex-mr-missing" } ,
>    { name = "lmmi10.tfm", vector = "tex-mi", skewchar=0x7F },
>    { name = "lmmi10.tfm", vector = "tex-it", skewchar=0x7F },
>    { name = "lmsy10.tfm", vector = "tex-sy", skewchar=0x30,
> parameters = true } ,
>    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
>    { name = "msam10.tfm", vector = "tex-ma" },
>    { name = "msbm10.tfm", vector = "tex-mb" },
>  -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } ,
>    { name = "lmroman10-bold.otf", vector = "tex-bf" } ,
>    { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
>    { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true },
>    { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true },
>    { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
>    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
> } )
>
> You may want to check any tfm font mentioned here as well as any
> vector="..." mentioned.
>
> fonts.enc.math["tex-mi"] = {
>    [0x1D6E4] = 0x00, -- Gamma
>    [0x1D6E5] = 0x01, -- Delta
>    [0x1D6E9] = 0x02, -- Theta
>    [0x1D6F3] = 0x02, -- varTheta (not present in TeX)
>    [0x1D6EC] = 0x03, -- Lambda
>    [0x1D6EF] = 0x04, -- Xi
>    [0x1D6F1] = 0x05, -- Pi
>
> There's a very precious source of information available for unicode
> mappings for many fonts that might be worth considering:
>     tex4ht/ht-fonts/unicode/
>
> Step 3: make use of available glyph information
> =
>
> 3a)
> You may use lucidabr.sty as a pretty reliable source of information to
> extract the mapping between:
> - glyph name (in LaTeX)
> - font
> - slot
>
> 3b)
> In char-def.lua there are some mappings between context commands and
> unicode points. If any mapping is missing, you need to add it anyway
> (else you won't be able to use that particular command), for all other
> commands you already have unicode point, so when you find "rightarrow"
> or some other glyph in font, you may look it up in char-def.lua to
> determine the unicode number.
>
> You may want to use both the comprehensive TeX symbol list as well as
> the Unicode Standard to help you out if there are some glyphs you
> don't know.
>
> Step 4: fix math-lbr
> =
>
> Step 5: complete the vectors in math-vfu.lua
> =
>
> I'm 

Re: [NTG-context] What is the luatex version of \pdfescapehex

2010-01-06 Thread Zhichu Chen
Sorry to my previous posts. I found a LaTeX package named pdftexcmds
and the lua script works just fine.
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] What is the luatex version of \pdfescapehex

2010-01-06 Thread Zhichu Chen
Thank you Hans,

On Wed, Jan 6, 2010 at 4:38 PM, Hans Hagen  wrote:
> On 6-1-2010 2:33, Zhichu Chen wrote:
>>
>> Hi,
>>
>> I've written a very old module which used a lot of pdf primitives like
>> \pdfescapehex
>> and \pdfescapename etc. and it turns out not they don't work in mkiv.
>> So I just want
>> to know are there any alternatives?
>
> just lua code as placeholders for primitives will not show up in context
> mkiv
>
> \startluacode
>    local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
>    local gsub, format, byte = string.gsub, string.format, string.byte
>    function commands.hexify(str)
>        texsprint(ctxcatcodes,(gsub(str,".",function(s) return
> format("%0X",byte(s)) end)))
>    end
> \stopluacode
>
> \long\def\hexify#1{\ctxlua{commands.hexify([[#1]])}}
>
>
> \hexify{I wonder why this is needed.}
>
>
> btw, if your old module produces pdf and uses other \pdf... primitives it's
> unlikely to work with mkiv anyway so you'd better check if it's still needed
Yes, \pdffilemoddate, \pdffilesize, \pdfmdfivesum are kind of disabled as well,
I'm not familiar with lua at all, so I don't know how to replace them with the
lua version. I did change your code format("%0X",byte(s)) with
format("%s",byte(s))
and it worked as \pdfescapename. I hope I'm not too wrong.

Anyway, my ancient module just write directly with pdfobj, I just commented
the /ModDate parameters and seems just fine now.

I think I really need to learn some lua. Thank you again for your 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
> -
>



-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] What is the luatex version of \pdfescapehex

2010-01-05 Thread Zhichu Chen
Hi,

I've written a very old module which used a lot of pdf primitives like
\pdfescapehex
and \pdfescapename etc. and it turns out not they don't work in mkiv.
So I just want
to know are there any alternatives?

TIA

-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to "unfill" a picture?

2009-06-24 Thread Zhichu Chen
Hi Nicola,

Thank you very much for your example and the idea. It's amazing,
I thought it's just a metafont thing and metapost just can't do that.

Thank you for your information again.

On Wed, Jun 24, 2009 at 10:12 PM, Nicola wrote:
> In article
> <769ba7780906240342s4939ac2foe7bfd783ad2e8...@mail.gmail.com>,
>  Zhichu Chen  wrote:
>
>> Well, my example is too simple. Actually, I was trying to draw a
>> treble clef
>
> If your goal is to draw a path with pens of varying width (kind of
> calligraphic strokes),'penpos' and 'penstroke' may be your friends
> (defined in plain.mp). This is what I've come out with by about 15
> minutes of trial and error (disclaimer: this is my first attempt at
> using these macros beyond trying to draw a sans-serif 'l' - I'm not a
> designer at all):
>
>   fill unitsquare scaled 12cm shifted (-6cm,-6cm) withcolor .625red;
>   b = 2pt; % Default pen width
>   w = 30mm; % Width of treble clef
>   h = 100mm; % Height of treble clef
>   % Specify breadth and angle of pen at keypoints:
>   penpos 1 (0.5b, 30);
>   penpos 1.5 (b, 15);
>   penpos 2 (3b, 0);
>   penpos 3 (5b, -90);
>   penpos 4 (3b, -180);
>   penpos 5 (b, 90);
>   penpos 6 (5b,0);
>   penpos 6.5 (4b, -30);
>   penpos 7 (.5b, 0);
>   penpos 8 (5b, 90);
>   penpos 9 (3b, -180);
>   penpos 10 (b, -180);
>   % Fix x coords of keypoints
>   x1=0;
>   x1.5=1/2[x1,x2];
>   x5=x1=x3=x8;
>   x10=1/2[x9,x1];
>   x7=1/2[x3,x4];
>   x4-x6=w;
>   x1=1/2[x2,x4];
>   x3-x2=x2-x6;
>   x9=1/2[x1,x2];
>   x6.5=1/2[x5,x6];
>   % Fix y coords of keypoints
>   y1=0;
>   y1.5=y1;
>   y6=y2=y4=1/2[y3,y1];
>   y3-y1=y1-y5=1/10h;
>   y5-y10=2(y3-y1);
>   y8-y7=y3-y1;
>   y9=y7;
>   y8-y3=y3-y10;
>   y6.5=1/2[y6,y7];
>
>   drawoptions (withcolor background);
>   % Draw (an incomplete and ugly) treble clef
>   penstroke z1e .. z1.5e .. z2e .. z3e .. z4e .. z5e .. z6e .. z6.5e ..
> z7e .. z8e .. z9e .. z10e;
>   drawoptions(withcolor black);
>   labels.lft(1,1.5,2,3,4,5,6,6.5,7,8,9,10);
>
> You must take special care never to cross the left and right edges of
> the pen. See The METAFONTbook for details and examples.
>
> Regards,
> Nicola
>
> ___
> 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] How to "unfill" a picture?

2009-06-24 Thread Zhichu Chen
On Wed, Jun 24, 2009 at 7:29 PM, Hans Hagen wrote:
> Zhichu Chen wrote:
>
>> I guess I should use as few variables as possible, I suppose
>> no one would name their paths "Helper" ;)
>
> Helper sounds ok, but ...
>
>>  pair Oringin ; Oringin := center p ;
>
> ... Oringin kind of funny
I'll change that.
>
>>  Helper1 := llcorner currentpicture -- lrcorner currentpicture ;
>
> shorter:
>
> Helper1 := leftboundary currentpicture ;
Can't find in mpman.pdf. Maybe it's in metafun.
>
>
>
> -
>                                          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] How to "unfill" a picture?

2009-06-24 Thread Zhichu Chen
I guess I should use as few variables as possible, I suppose
no one would name their paths "Helper" ;)

This macro assumes the argument is clockwise, I've written
a macro to find out whether a path is clockwise or not, but
it took me forever to run the code. Maybe there's already
some primitive could do this.

\startMPinclusions
def getridof(expr p) =
  save Helper, Oringin, Mode, MagicPoint ;

  pair Oringin ; Oringin := center p ;

  pair MagicPoint ;

  numeric Mode ; Mode := 0 ;

  path Helper[] ;

  Helper0 := p ;
  Helper1 := llcorner currentpicture -- lrcorner currentpicture ;
  Helper2 := lrcorner currentpicture -- urcorner currentpicture ;
  Helper3 := urcorner currentpicture -- ulcorner currentpicture ;
  Helper4 := ulcorner currentpicture -- llcorner currentpicture ;
  for i=1 upto 4 :
Helper[i+4] := Helper[i] ;
  endfor
  Helper11 := llcorner currentpicture -- Oringin ;
  Helper12 := lrcorner currentpicture -- Oringin ;
  Helper13 := urcorner currentpicture -- Oringin ;
  Helper14 := ulcorner currentpicture -- Oringin ;


  if (((llcorner currentpicture -- Oringin) intersectiontimes p) = (-1,-1)) :
if (((lrcorner currentpicture -- Oringin) intersectiontimes p) = (-1,-1)) :
  if (((urcorner currentpicture -- Oringin) intersectiontimes p) =
(-1,-1)) :
Mode := 4 ;
  else :
Mode := 3 ;
  fi
else :
  Mode := 2 ;
fi
  else :
Mode := 1 ;
  fi

  Helper100 = Helper[10+Mode] cutafter p ;
  MagicPoint = point length(Helper100) of Helper100 ;

  Helper0 := Helper[Mode] for i=1 upto 3 : -- Helper[Mode+i] endfor
  -- Helper100
  -- (Helper0 cutbefore MagicPoint)
  -- (Helper0 cutafter MagicPoint)
  -- (reverse Helper100)
  -- cycle ;

  clip currentpicture to Helper0 ;

  draw Helper0 withcolor cyan ;
enddef ;
\stopMPinclusions
___
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] How to "unfill" a picture?

2009-06-24 Thread Zhichu Chen
I assume there's no "--" between "reverse" and "fullcircle scaled 1cm" :)

Well, my example is too simple. Actually, I was trying to draw a
treble clef, and when there're too many intersection points (caused
by the -- operator to join every path together) the output is not
so good, kind of like an even-odd-fill.

Anyway, I wrote a macro trying to handle it, but it's still weird for
me.
===
def getridof(expr mypath) =
  save p, q, r, l, Oringin, Mode , MagicPoint ;

  pair Oringin ; Oringin := center mypath ;

  pair MagicPoint ;

  numeric Mode ; Mode := 0 ;

  path p[], q[], l ;

  q0 := mypath ;
  q1 := llcorner currentpicture -- lrcorner currentpicture ;
  q2 := lrcorner currentpicture -- urcorner currentpicture ;
  q3 := urcorner currentpicture -- ulcorner currentpicture ;
  q4 := ulcorner currentpicture -- llcorner currentpicture ;
  for i=1 upto 4 :
q[i+4] := q[i] ;
  endfor
  q11 := llcorner currentpicture -- Oringin ;
  q12 := lrcorner currentpicture -- Oringin ;
  q13 := urcorner currentpicture -- Oringin ;
  q14 := ulcorner currentpicture -- Oringin ;

  for i=1 upto 4 :
p[i] := q[i] for j=1 upto 3 : -- q[i+j] endfor ;
  endfor

  if (((llcorner currentpicture -- Oringin) intersectiontimes mypath)
= (-1,-1)) :
if (((lrcorner currentpicture -- Oringin) intersectiontimes
mypath) = (-1,-1)) :
  if (((urcorner currentpicture -- Oringin) intersectiontimes
mypath) = (-1,-1)) :
Mode := 4 ;
  else :
Mode := 3 ;
  fi
else :
  Mode := 2 ;
fi
  else :
Mode := 1 ;
  fi

  l = q[10+Mode] cutafter mypath ;
  MagicPoint = point length(l) of l ;

  p0 := p[Mode]--l--(q0 cutbefore MagicPoint)--(q0 cutafter
MagicPoint)--(reverse l)--cycle ;

  clip currentpicture to p0 ;

  draw p0 withcolor cyan ;
enddef ;
===
If I use
===
path p[] ;

p1 = fullcircle scaled 10 cm ;

p2 = reverse fullcircle scaled 1cm shifted (2cm,2cm) ;
p3 = reverse fullcircle scaled 1.5cm shifted (2cm,-2cm) ;
p4 = reverse fullcircle scaled 1.75cm shifted (-2cm,2cm) ;

fill p1 ;
getridof(p2) ;
getridof(p3) ;
getridof(p4) ;
===
then only p2 was cut off, you can change the order and only the first path
can be handled.

If I use pa[] as the path variables rather than p[], that would be fine.
I don't know why, I mean I've used the "save" operator.

On Wed, Jun 24, 2009 at 4:21 PM, Wolfgang
Schuster wrote:
>
> fill fullcircle scaled 2cm -- reverse -- fullcircle scaled 1cm -- cycle ;
>
> Wolfgang
>
> ___
> 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] How to "unfill" a picture?

2009-06-24 Thread Zhichu Chen
Cool, but just curiosity, metapost can handle fonts right?
How those glyphs don't have this problem? I've read the
specification of the type1 fonts, they don't seem to have
such weird paths, just some borderlines with different
directions.

On Wed, Jun 24, 2009 at 3:32 PM, Taco Hoekwater wrote:
> Currently, that is how it should be done. Maybe a future
> version of metapost will be able to handle this natively.
>
> Best wishes,
> Taco
> ___
> 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] How to "unfill" a picture?

2009-06-23 Thread Zhichu Chen
Fine, I made it in a very weird way. I constructed a very
strange path to go through the outer path in counter-
clockwise direction and inner path in clockwise dir-
ection and filled it. I don't feel good but it can be done
now.

On Wed, Jun 24, 2009 at 11:13 AM, Zhichu Chen wrote:
> Hi, I got a problem in metapost. If I want to draw a ring, and
> use the code:
> fill fullcircle scaled 2cm ;
> unfill fullcircle scaled 1cm ;
> The inner part is not transparent, it has the color of "background"
> variable which is "white" by default.
>
> This case is a minimal example, I actually wanna draw something
> more complex, like the glyph "Q" and I know the inner path and
> outer path. How can I fill the ring without jeopardizing the area inside
> the inner path?
>
> --
> 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
> 
>



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


[NTG-context] How to "unfill" a picture?

2009-06-23 Thread Zhichu Chen
Hi, I got a problem in metapost. If I want to draw a ring, and
use the code:
fill fullcircle scaled 2cm ;
unfill fullcircle scaled 1cm ;
The inner part is not transparent, it has the color of "background"
variable which is "white" by default.

This case is a minimal example, I actually wanna draw something
more complex, like the glyph "Q" and I know the inner path and
outer path. How can I fill the ring without jeopardizing the area inside
the inner path?

-- 
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] inserting Chinese characters (MKII)

2009-06-11 Thread Zhichu Chen
Since it's just two characters, why not make it a picture which you
can generate it from your LaTeX output. That'll much easier than
installing the Chinese fonts, generating the typescripts or so.

On Thu, Jun 11, 2009 at 9:37 PM, Bowen Alan C. wrote:
>  I have absolutely no knowledge of Chinese, but I am publishing a review
> which inserts two Chinese characters into a document as follows,
>  third century alchemist Ge Hong 葛洪 as another
> So which of the two Chinese modules on http://modules.contextgarden.net/
> should I install or do I need them both? (I am assuming that installing one
> of both of these modules will take care of steps 1–4 of the post-ConTeXt
> 2005.12.19 instructions on http://wiki.contextrarden.net/Chinese.)
> By the way, the LaTeX file that I am working from has
> \begin{TChinese}ËëõÊ¥™\end{TChinese}
> where
> \newenvironment{TChinese}{%
> \CJKfamily{bsmi}%
> %\CJKfamily{bkai}%
>   \CJKtilde
>   \CJKnospace}{}
> Alan
>
>
>
> ___
> 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] missing metafun graphics in mkii

2009-06-08 Thread Zhichu Chen
Well, I don't quite sure if it's the same problem with you guys
but there's a weird thing that after I updated to the current
beta release, I have to run "texmfstart texexec" twice to get
the metapost figures.

On Mon, Jun 8, 2009 at 7:30 PM, Peter Münster wrote:
> On Mon, 8 Jun 2009, Mojca Miklavec wrote:
>
>> Does anyone else experience problems using metafun graphics in mkii?
>> Did I miss some runwhatevertrue switch somewhere? Are the stubs in
>> minimals incompatible in some way? At least live.contextgarden.net
>> seems to suffer as well.
>
> No problem here with latest minimals...
>
> Versions:
>
> This is pdfTeX, Version 3.1415926-1.40.10 (Web2C 7.5.7)
>  \write18 enabled.
>  (/opt/context/tex/texmf-context/web2c/natural.tcx)
> entering extended mode
> (./test.tex
>
> ConTeXt  ver: 2009.06.07 14:02 MKII  fmt: 2009.6.8  int: english/english
>
> Cheers, Peter
>
> --
> Contact information: http://pmrb.free.fr/contact/
>
> ___
> 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] MKIV doesn't support units module?

2009-06-03 Thread Zhichu Chen
On Wed, Jun 3, 2009 at 3:26 PM, Hans Hagen  wrote:
> Zhichu Chen wrote:
>>
>> Well, I shouldn't say the module units is not fully supported, but
>> it won't give me what I want in MKIV. Those units it made are in
>> italic shape but I really need them to be upright.
>>
>> I think I don't need to provide a test file, 'cause any files don't
>> work for me.
>
> well, even then it helps to have a simple example showing the problem as now
> you expect someone else to key in something in order to solve your problem
>
> personally i only look into problem reports that come with a simple example
> (and i'm quite happy that in most cases reports come with such examples)
>
> so, can you make a small test?

Sure,
==
\usemodule[units]

\starttext
$0.511\Mega\eVolt$
\stoptext
==
This one will give me like "0.511eV" with the italic "eV" and no "M"
at all, besides,
these's no extra space between 0.511 and eV.

MKII works fine with it and gives "0.511 MeV" with upright MeV and some small
space in between.

I can also provide my log file (a bit long):

===
$ context test.tex && start test.pdf
MTXrun | run 1: luatex
--fmt="d:/ConTeXt/tex/texmf-cache/luatex-cache/context/0dd5b42bdd07abd55bf90fb1a48a099e/formats/c
ont-en" 
--lua="d:/ConTeXt/tex/texmf-cache/luatex-cache/context/0dd5b42bdd07abd55bf90fb1a48a099e/formats/cont-en.lui"
--b
ackend=pdf "./test.tex"
This is LuaTeX, Version beta-0.40.0-2009042214 (Web2C 7.5.7)
 \write18 enabled.
(test.tex
color   : mpcmyk color space is supported
color   : mpspot color space is supported
color   : system rgb is global activated

ConTeXt  ver: 2009.06.02 22:10 MKIV  fmt: 2009.6.3  int: english/english

system  : cont-new loaded
(d:/ConTeXt/tex/texmf-local/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/cont-new.mkiv)
(d:/ConTeXt/tex/texmf-local/tex/context/base/cont-mtx.tex))
system  : cont-fil loaded
(d:/ConTeXt/tex/texmf-local/tex/context/base/cont-fil.tex
loading : ConTeXt File Synonyms
)
system  : cont-sys loaded
(d:/ConTeXt/tex/texmf-context/tex/context/user/cont-sys.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex) (
d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.mkiv)) (d
:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.mkiv)))
system  : test.top loaded
(test.top)
fonts   : preloading latin modern fonts
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex (d:
/ConTeXt/tex/texmf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex (d:/
ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex (d:/Con
TeXt/tex/texmf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex (d:/ConT
eXt/tex/texmf-local/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex) (d:/ConT
eXt/tex/texmf-local/tex/context/base/type-siz.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.mkiv)) (d:/ConTe
Xt/tex/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.mkiv))
(d:/ConTeX
t/tex/texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex
(d:/ConTeXt/t
ex/texmf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/te
x/texmf-local/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/te
x/texmf-local/tex/context/base/type-siz.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex
/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/
texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex
(d:/ConTeXt/tex/tex
mf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texm
f-local/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texm
f-local/tex/context/base/type-siz.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf
-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/texmf-
local/tex/context/base/type-tmf.tex)
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-siz.tex
(d

[NTG-context] MKIV doesn't support units module?

2009-06-02 Thread Zhichu Chen
Well, I shouldn't say the module units is not fully supported, but
it won't give me what I want in MKIV. Those units it made are in
italic shape but I really need them to be upright.

I think I don't need to provide a test file, 'cause any files don't
work for me.

-- 
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] two newbie questions (about conditional processing)

2009-05-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:30 PM, Wolfgang Schuster
 wrote:
>
> Am 25.05.2009 um 08:55 schrieb Zhichu Chen:
>
>> On Sun, May 24, 2009 at 6:36 PM, Hans Hagen  wrote:
>>>
>>> something like state=once would be handy but i'm not going to touch that
>>> code till i'm redoing some page-* code in mkiv
>>
>> I don't get it, the "once" made me confused. Should that just be
>> "affectedpage=current" or "range={1,2,15}" which will make more
>> sense to me. I don't know the range for "once"
>>
>> Anyway, hi Yue, this small test file may be useful:
>
> Very nice
Thank you:)

> but it shows only up in Adobe Reader
I don't know what's that mean.

> and you can't select
> the color for the background.
No, I can't. I'm trying to figure out how to make a more interesting
test file.

>
> Wolfgang
>
> ___
> 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] two newbie questions (about conditional processing)

2009-05-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:12 PM, Hans Hagen  wrote:
>
> well, we have already
>
> state=repeat: same background each upcoming page
> state=start : enable background (calculate each time)
> state=stop  : disable backgrond
>
> so we would have
>
> state=once  : enable background and after this page disable it
>
> in this case 'once' is kind of "start" before and "stop" after \page
Cool, I'm looking forward to that.
>
> a range makes not much sense as one seldom knows the page in advance so that
> would then be named pages; however, as we have 25 page areas it would
> involve more testing then i currently want to do (the otr is already not
> that fast)
No we won't know the page numbers so forget mine.

There's just one other thing: since we are changing background colors,
we probably need the text colors to be changed as well. But by searching
the sources, I only get the negative color scheme which is some sort of
pdf specials or gs specials. I mean can we just customize such configurations
ourselves? Like colorscheme={inverse+0.1} will inverse the color and reduce
the RGB value to 10%. Then my little test file could make more useful.


>
>
>
> -
>                                          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] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen  wrote:
>
> something like state=once would be handy but i'm not going to touch that
> code till i'm redoing some page-* code in mkiv
I don't get it, the "once" made me confused. Should that just be
"affectedpage=current" or "range={1,2,15}" which will make more
sense to me. I don't know the range for "once"

Anyway, hi Yue, this small test file may be useful:

% \tracingmacros=2

\def\Reverse
  {\global\negateprintboxtrue
   \appendtoks\global\negateprintboxfalse\to\afterpage}

\setuphead
  [chapter]
  [before=\Reverse]

\setupcolors[state=start]

\starttext

\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\stoptext

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



-- 
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] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
 wrote:
>
> Am 24.05.2009 um 10:46 schrieb Zhichu Chen:
>
>>>> Maybe just a \start(stop)setups which changes the background back to
>>>> normal and \prependtoks it to some token list. So is there an \everypage
>>>> or
>>>> \everyshipout token? Then using \setuphead (I don't know if it's
>>>> appropriate) or
>>>> \appendtoks to every title page.
>>>
>>> I posted a code to enable/disable the backgroundcolor for certain pages
>>> not so long ago, take a look in the mail archive.
>>
>> Found it. Well, then it's just as easy as it sounds:
>
> This could be the better method for the background color (when the code
> is rewritten in a better style) but to change the textcolor you need my
> other code.
Yes, I noticed that. I added the foregroundcolor part to your code but
only pagenumbers are affected. And by appending
\setuppapersize [A4][A4,negative]
to \afterpage gives a really weird result
>
> Wolfgang
>
> ___
> 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] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
 wrote:
>
> Am 24.05.2009 um 06:12 schrieb Zhichu Chen:
>
>> As you said before, in my problem, this kind of handler could break
>> something
>> like hyper-links, and I assume Yue wanted those kind of stuffs.
>
> I don't think this is a problem for this example because the page dimension
> are always the same while in the code for you the real and the calculated
> coordinates are different.
>
>> Maybe just a \start(stop)setups which changes the background back to
>> normal
>> and \prependtoks it to some token list. So is there an \everypage or
>> \everyshipout
>> token? Then using \setuphead (I don't know if it's appropriate) or
>> \appendtoks to every title page.
>
> I posted a code to enable/disable the backgroundcolor for certain pages
> not so long ago, take a look in the mail archive.

Found it. Well, then it's just as easy as it sounds:

\unprotect

\let\!!savedbackgroundcolor\empty

\def\onbackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor}

\def\offbackground
 {\globallet\!!savedbackgroundcolor\@@mapagebackgroundcolor
  \globalletempty\@@mapagebackgroundcolor}

\def\nobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \globalletempty\@@mapagebackgroundcolor
  
\appendtoks\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor\to\afterpage}

\def\gobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \appendtoks\globalletempty\@@mapagebackgroundcolor\to\afterpage}

\protect

\setuphead
  [chapter]
  [before=\gobackground]

\setupcolors[state=start]
\setupbackgrounds[page][background=color,backgroundcolor=lightgray]\offbackground

\starttext

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\stoptext

>
> Wolfgang
>
> ___
> 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] two newbie questions (about conditional processing)

2009-05-23 Thread Zhichu Chen
As you said before, in my problem, this kind of handler could break something
like hyper-links, and I assume Yue wanted those kind of stuffs.

Maybe just a \start(stop)setups which changes the background back to normal
and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to
every title page.

On Sun, May 24, 2009 at 1:34 AM, Wolfgang Schuster
 wrote:
>
> Took me a while but with the help of the MkII/IV manual I was able to
> implement the chapter layout.
>
> \enableattributeinheritance
>
> \newif\ifchapterpage
>
> \installpagehandler{color}%
>  {\dowithnextbox
>    {\ifchapterpage
>
> \actualshipout{\framed[background=color,backgroundcolor=black,foregroundcolor=white]{\attributedbox\nextbox}}
>     \else
>       \actualshipout{\flushnextbox}
>     \fi\global\chapterpagefalse}
>  \normalhbox}
>
> \starttext
>
> \setuppaper[method=color]
>
> \subject{Tufte}\chapterpagetrue
>
> \dorecurse{10}{\input tufte\par}
>
> \page
>
> \setuppaper[method=color]
>
> \subject{Knuth}\chapterpagetrue
>
> \dorecurse{10}{\input knuth\par}
>
> \stoptext
>
> Wolfgang
>
> ___
> 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] two newbie questions (about conditional processing)

2009-05-23 Thread Zhichu Chen
On Thu, May 21, 2009 at 9:25 AM, Yue Wang  wrote:
> Hi,
>
> I have a new book to design, but I don't know how to do page/content
> conditional processing). Please help me:)
>
> - I want my chapter page (first page of each chapter) to be really
> distinctive. that is, I define a dark color background, and want all
> the text on the first page set in white. how can I do that? for
> example
> \chapter{hello}
> \dorecurse{10}{\input zapf } % all the characters in the first page
> should white, others should set in black.
This must have something to do with the OTR, I'm really not good
at that.

By \definecolor[black][r=1, g=1, b=1] you can get white texts which
maybe useful for you.
>
> - I want to insert graphics and images. all the graphics are inserted
> using \placeexternalfigures. I want all the pages where the insertion
> happens to be quite distictive (that is, have a very narrow text
> layout, and leave the large margin for the figures. However, when a
> page starts, TeX does not know wheter or not an external figure will
> be placed on this page, so it really has no idea whether this page
> should be set narrower or not. how can I do that?
Sounds like an \insert like footnote. Good luck.
>
> Thanks.
>
> Yue Wang
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
Awesome, but still, the javascript things are gone :(

Anyway, I'll try the resolution method.

By the way, is there any chance that I can use a stretched font without
disturbing the output routine? I think I can try a narrow font and re-draw
my pictures.

On Sat, May 23, 2009 at 1:43 AM, Wolfgang Schuster
 wrote:
>
> Am 22.05.2009 um 16:48 schrieb Zhichu Chen:
>
>> Hi guys,
>>
>> This may sound crazy, but I have to do a presentation with a stretched
>> output.
>>
>> The thing is, I have a laptop with a normal screen, and it'll be plugged
>> to
>> a very big wide screen monitor so that people can see the slides on the
>> big screen. I have to look at my laptop and present for the people, so
>> what I'm thinking is make a stretched output on my 4:3 screen which
>> looks very narrowed and then the effect on the screen will be just as
>> normal.
>>
>> Is there an easy option for this?
>
>
> That was a nice exercise, here is a solution with a rather new mechanism
> Hans wrote for me.
>
> \definepapersize[fake][SW]          [SW]
> \definepapersize[real][A5,landscape][A5,landscape]
>
> \setuppapersize[fake]
>
> \installpagehandler{deform}%
>  {\dowithnextbox
>     {\setuppapersize[real]
>
>  \actualshipout{\scale[width=\paperwidth,height=\paperheight]{\flushnextbox}}
>      \setuppapersize[fake]}
>   \normalhbox}
>
> \setuppaper[method=deform]
>
> \starttext
>
> \subject{Tufte}
>
> \input tufte
>
> \page
>
> \subject{Knuth}
>
> \input knuth
>
> \stoptext
>
> Wolfgang
>
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
On Sat, May 23, 2009 at 12:55 AM, luigi scarso  wrote:
>
>
> On Fri, May 22, 2009 at 6:32 PM, Zhichu Chen  wrote:
>>
>> Well, since it's a presentation, I really have some "cool" style to
>> show by using
>> javascript. I think including separated pages will jeopardize it.
>
> and what about pdf -> ps ->(some transformations) ps -> pdf ?

I don't know. I hope I can find an easy way. By easy, I mean
simple and comfortable. ;)

> --
> luigi
>
>
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
On Sat, May 23, 2009 at 12:54 AM, Wolfgang Schuster
 wrote:
>
> Am 22.05.2009 um 18:47 schrieb Zhichu Chen:
>
>>>> Is there an easy option for this?
>>>
>>> \setuppapersize[SM|SW] or a papersize with the the same width/height
>>> ratio
>>> as the projector.
>>
>> That won't go well. The projector is as stupid as it could be. It will
>> honestly
>> send what's shown on my laptop to the screen only stretch it to a special
>> ratio. If I make a wide screen version. It will be a wide version on my
>> laptop
>> with the header and footer cut, I mean it won't fill my laptop screen.
>> Then
>> the projector will produce a wide version on a wide ratio. It'll be
>> 256:100
>> rather than 16:10. Still not what I wanted.
>
> Can't you set the same resolution on your laptop as the projector has,
> the layout on your laptop is then deformed but the screen version is
> correct.

Well, that's a good idea. But actually, that's not really "my" laptop so
I can't test it right now.

I hope the notebook is not too old (which I assume it can be) to support
a wide screen resolution.

>
> Wolfgang
>
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
On Sat, May 23, 2009 at 12:46 AM, luigi scarso  wrote:
>
>
> On Fri, May 22, 2009 at 6:32 PM, Zhichu Chen  wrote:
>>
>> Well, since it's a presentation, I really have some "cool" style to
>> show by using
>> javascript. I think including separated pages will jeopardize it.
>
> Ah, ok
> I don't know  -- I have a little experience with javascript but if you can
> send me your pdf
> I can check if javascripts fail , just for curiosity .
Sure of course. Thank you very much. I'll make a personal mail in case
for the attached file.
>
>
> --
> luigi
>
>
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
On Sat, May 23, 2009 at 12:08 AM, Wolfgang Schuster
 wrote:
>
> Am 22.05.2009 um 16:48 schrieb Zhichu Chen:
>
>> Hi guys,
>>
>> This may sound crazy, but I have to do a presentation with a stretched
>> output.
>>
>> The thing is, I have a laptop with a normal screen, and it'll be plugged
>> to
>> a very big wide screen monitor so that people can see the slides on the
>> big screen. I have to look at my laptop and present for the people, so
>> what I'm thinking is make a stretched output on my 4:3 screen which
>> looks very narrowed and then the effect on the screen will be just as
>> normal.
>>
>> Is there an easy option for this?
>
> \setuppapersize[SM|SW] or a papersize with the the same width/height ratio
> as the projector.

That won't go well. The projector is as stupid as it could be. It will honestly
send what's shown on my laptop to the screen only stretch it to a special
ratio. If I make a wide screen version. It will be a wide version on my laptop
with the header and footer cut, I mean it won't fill my laptop screen. Then
the projector will produce a wide version on a wide ratio. It'll be 256:100
rather than 16:10. Still not what I wanted.

>
> Wolfgang
>
> ___
> 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] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
Well, since it's a presentation, I really have some "cool" style to
show by using
javascript. I think including separated pages will jeopardize it.

On Fri, May 22, 2009 at 11:55 PM, luigi scarso  wrote:
>
>
> On Fri, May 22, 2009 at 4:48 PM, Zhichu Chen  wrote:
>>
>> Hi guys,
>>
>> This may sound crazy, but I have to do a presentation with a stretched
>> output.
>>
>> The thing is, I have a laptop with a normal screen, and it'll be plugged
>> to
>> a very big wide screen monitor so that people can see the slides on the
>> big screen. I have to look at my laptop and present for the people, so
>> what I'm thinking is make a stretched output on my 4:3 screen which
>> looks very narrowed and then the effect on the screen will be just as
>> normal.
>>
>> Is there an easy option for this?
>
> hmm are you sure that there isn't a way to
> choose a graphic mode for you output that do what you want ?
> Otherwise, maybe you can make a pdf -> ps,
> apply a matrix transformation with ghostscript  to this ps and reconvert to
> pdf
> Or you can use something like
> \starttext
> \starTEXPage
> \externalfigure[slides.pdf][page=1,width=...,height=...]\page
> \externalfigure[slides.pdf][page=2,width=...,height=...]\page
> \externalfigure[slides.pdf][page=3,width=...,height=...]\page
> \externalfigure[slides.pdf][page=4,width=...,height=...]\page
> ...
> \stopTEXPage
> \stoptext
>
>
> --
> luigi
>
>
> ___
> 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
___


[NTG-context] How to make a stretched pdf file

2009-05-22 Thread Zhichu Chen
Hi guys,

This may sound crazy, but I have to do a presentation with a stretched
output.

The thing is, I have a laptop with a normal screen, and it'll be plugged to
a very big wide screen monitor so that people can see the slides on the
big screen. I have to look at my laptop and present for the people, so
what I'm thinking is make a stretched output on my 4:3 screen which
looks very narrowed and then the effect on the screen will be just as
normal.

Is there an easy option for this?

-- 
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] How can I compare picture variables in metapost?

2009-05-05 Thread Zhichu Chen
Thank you all guys,

To Aditya: Clearly I over-emphasized the randomness. Actually, what I
meant is a little more complex: identical objects on random
coordinates and they don't intersect with each other. We can rotate
them but we can't re-size them and scale them. Your code is very
interesting. I'll see what I can do now.

Thank you again.


-- 
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] How can I compare picture variables in metapost?

2009-05-05 Thread Zhichu Chen
On Tue, May 5, 2009 at 11:04 PM, Taco Hoekwater  wrote:
> Zhichu Chen wrote:
>>
>> What I want exactly is how to determine if there's anything on
>> some region of the picture. I need this to test if the random
>> point I picked is useful.
>
> That is easy to answer: you can't (well, not unless you invest a *lot*
> of effort into creating a bitmap edge structure).
Well, quick and pain.
>
> However what you can do is ask metapost to calculate intersectionpoints
> with (the most likely ones of) the already existing objects. This may
> be the easiest solution (even though it will be so slow that for large
> numbers of items you may be forced to start a division tree).
>
> The core trick is that you randomly place a circle with random radius
> inside an x-y field, and you keep those paths/pictures in an array. For
> each newlyt generated circle, you look for an intersection with all the
> already existing ones (and the rectangle borders) and keep trying
> to re-place it until there are no more collisions.

Seems that I don't have too many choices. Maybe using lua to do the
math and throwing the result to metapost is faster? I think I can do
this, but I don't know how. The documents are a little limited.

>
> I can't come up with a solution that is both elegant and fast at the
> moment, sorry.
>
> Best wishes,
> Taco
> ___
> 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] How can I compare picture variables in metapost?

2009-05-05 Thread Zhichu Chen
Hi Taco,

On Tue, May 5, 2009 at 8:51 PM, Taco Hoekwater  wrote:
> Zhichu Chen wrote:
>>
>> Hi all,
>>
>> I want to draw some paths that won't intersect with each other
>> in metapost. Those paths are generated "randomly," e.g., draw
>> 100 circles without any intersections. I use a very stupid
>> way like:
>
> I am probably missing something, because the fastest way to
> draw  100 non-intersecting paths is just by having them in
> a grid. You don't seem to want that, so: what do you want,
> exactly? (be warned that "marble fill" is pretty hard).

Nice to have your attention.

Those paths are not meant to be somewhere and they appear
randomly. Like one path can have a neighbor very close to it
and another path may be not so close to any of the other
ones. Basically, they are not organized, they can't form a lattice.

What I want exactly is how to determine if there's anything on
some region of the picture. I need this to test if the random
point I picked is useful.

I don't think putting them in a grid is what I want. That'll just
make those objects look like they are sorted and kind of like
it's a fake picture which is generated intentionally.

I hope I haven't make you even more confused.

>
> Best wishes,
> Taco
> ___
> 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
___


[NTG-context] How can I compare picture variables in metapost?

2009-05-05 Thread Zhichu Chen
Hi all,

I want to draw some paths that won't intersect with each other
in metapost. Those paths are generated "randomly," e.g., draw
100 circles without any intersections. I use a very stupid
way like:
=
% randomseed:= day + time*epsilon ;
save minL ; numeric minL ; minL = infinity ;
z[0] = origin;
for i=1 upto 99 :
  z[i] = (uniformdeviate 1 , uniformdeviate 1 ) ;
  for j=0 upto i-1 :
if abs(z[i]-z[j])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] I need bold math italic and symbols

2009-01-06 Thread Zhichu Chen
Hi Zhaopeng,

I have no problem here, just \usemodule[amsl] and $\cal K$ provides a fancy $K$

On Tue, Jan 6, 2009 at 4:24 PM, Zhaopeng Xing  wrote:
> Thanks. I also want to know how to make euscript \mathcal like this.
> www.maths.usyd.edu.au/u/SMS/texdoc/euscript.pdf
>
> Since euscript is part of amsfonts now. I tried amsl module, but found no
> effect. May I know how to trig euscript mathcal?
>
> 2009/1/6 Zhichu Chen 
>>
>> On Tue, Jan 6, 2009 at 6:36 AM, Aditya Mahajan  wrote:
>> > On Mon, 5 Jan 2009, Zhaopeng Xing wrote:
>> >
>> >> Hi,
>> >>
>> >> Can anyone show me how to write math contents in bold and italic fonts?
>> >> {\bf
>> >> } can only produce upright letters. In LaTeX, we can make use of the
>> >> command
>> >> \pmb for this purpose. Is there any shortcut like this in Context?
>> >> Thanks.
>> >
>> > Add
>> >
>> > \definetypeface [boldmath] [mm] [boldmath] [latin-modern] [modern]
>> > [encoding=texnansi]
>> >
>> > to your typescripts and then you can use \boldsymbol.
>> >
>> > 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
>> >
>> > ___
>> >
>>
>> And check this for more information about math:
>> http://wiki.contextgarden.net/Category:Math
>>
>>
>> --
>> 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
>>
>> ___
>
>
>
> --
> Zhaopeng XING
>
> Tinbergen Institute
>
> ___
> 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] I need bold math italic and symbols

2009-01-05 Thread Zhichu Chen
On Tue, Jan 6, 2009 at 6:36 AM, Aditya Mahajan  wrote:
> On Mon, 5 Jan 2009, Zhaopeng Xing wrote:
>
>> Hi,
>>
>> Can anyone show me how to write math contents in bold and italic fonts?
>> {\bf
>> } can only produce upright letters. In LaTeX, we can make use of the
>> command
>> \pmb for this purpose. Is there any shortcut like this in Context? Thanks.
>
> Add
>
> \definetypeface [boldmath] [mm] [boldmath] [latin-modern] [modern]
> [encoding=texnansi]
>
> to your typescripts and then you can use \boldsymbol.
>
> 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
> ___
>

And check this for more information about math:
http://wiki.contextgarden.net/Category:Math


-- 
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] PDF page numbers

2008-12-16 Thread Zhichu Chen
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




On Tue, Dec 16, 2008 at 4:33 PM, Taco Hoekwater  wrote:
>
>
> Mohamed Bana wrote:
>> Derek CORDEIRO wrote:
>>> In latex + book/memoir + hyperref, if \frontmatter \mainmatter are
>>> used, the pdf files generated use the roman numbers in the pdf itself.
>>> It appears as ii (2 of 500) in the pdfviewer. Is it possible to do the
>>> same with ConTeXt?
>>
>> It would be great if ConTeXt could.
>
> Doesn't sound like rocket science. Perhaps someone could dig up the
> latex code that does this ?

Does the following code work for you?
==
\pdfcompresslevel 0

\setupinteraction
  [state=start,
   focus=width,
   page=yes,
   openaction=firstpage,
   click=no,
   title=TEST,
   author=Neals,
   subtitle=Test,
   keyword={test}]

\setupcolors
  [state=start]

\newcount\FrontPageNumbers

\setupsubpagenumber[way=bytext,state=start]
\setuppagenumbering[location=]

\startsectionblockenvironment[frontpart]
 \setupfootertexts[pagenumber]
 \setuppagenumbering[conversion=romannumerals]
\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
 \global\FrontPageNumbers=\pagenumber
 \global\advance\FrontPageNumbers\minusone
 \setuppagenumber[number=1]
 \resetsubpagenumber
%  \setupfootertexts[\the\FrontPageNumbers]
 \setupfootertexts[pagenumber]
\stopsectionblockenvironment

\startsectionblockenvironment[backpart]
 \resetsubpagenumber
\stopsectionblockenvironment

\def\PageLabels{\pdfcatalog{/PageLabels << /Nums [ 0 << /S /r >>
\the\FrontPageNumbers << /S /D >> ] >>  >>}}


\prependtoks
  \PageLabels
\to \everystoptext

\starttext



\startfrontmatter
% \chapter{Table of Contents}
\completecontent[interaction=all]
\chapter{Preface}
\dorecurse{10}{\input zapf\par}
% \chapter{Preface}
% \dorecurse{10}{\input zapf\par}
% \chapter{Preface}
% \dorecurse{10}{\input zapf\par}
\stopfrontmatter

\startbodymatter
\chapter{Test}
\dorecurse{15}{\input tufte\par}
\chapter{TestAgain}
\dorecurse{15}{\input ward\par}
\stopbodymatter

\startbackmatter
Index maybe.
\stopbackmatter


\stoptext
==




>
> Taco
> ___
> 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
> ___
>
___
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] ! Extra \else error

2008-12-11 Thread Zhichu Chen
Hi Bart,

On Thu, Dec 11, 2008 at 11:05 PM, Bart C. Wise
<[EMAIL PROTECTED]> wrote:
>
> Chen,
>
> Thanks.  That makes sense now.  However, when I take your code and run it, it
> only goes through 1 iteration of the loop and exits.  I'm puzzled.
>
> Bart

Really? 'cause when I run the following code
===
\newcount\startcnt

\newcount\tempcnta

\def\myloop#1{%
\message{enter}
\tempcnta=\the\startcnt%
\loop
\message{loop}
\advance \tempcnta by 1
\ifnum\tempcnta<#1 \repeat
\message{exit}}

\starttext

\startcnt=1800

\myloop{2008}

\stoptext
===

I got

===
systems: begin file test2 at line 14
enter loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop loop
loop loop loop loop loop loop loop loop loop loop loop loop loop exit
systems: end file test2 at line 20
 )
===

which infers it works for me.

Anyway, I recommand you take the advanced interface as Hans has suggested.
It's easier to use, makes more sense and is more ConTeXt-like.

-- 
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] ! Extra \else error

2008-12-11 Thread Zhichu Chen
Hi Bart,

On Thu, Dec 11, 2008 at 10:21 PM, Bart C. Wise
<[EMAIL PROTECTED]> wrote:

>
> If I change the loop to be the following, I still get the same error:
>
> \def\myloop#1{%
>  \tempcnta=\the\startcnt%
>  \loop
>\advance \tempcnta by 1
>\if\tempcnta=#1\else \repeat\fi
> }
>
> Bart
>

No, you should define like:

\def\myloop#1{%
 \tempcnta=\the\startcnt%
 \loop
   \advance \tempcnta by 1
   \if\tempcnta<#1\repeat
}

No \else before \repeat in this case and no \fi outside the loop.

Taking a look at the definition, you could find the following
code (something like that, I can't remember clearly):

\def\loop#1\repeat{\def\body{#1}\iterate}
\def\iterate{something to do with \body}

You can see there should not be an extra \else in the \body, and
you don't need the \fi to enclose it.

I don't know whether I've made my point clear.



-- 
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] ! Extra \else error

2008-12-11 Thread Zhichu Chen
Hi Bart

On Thu, Dec 11, 2008 at 9:50 PM, Bart C. Wise
<[EMAIL PROTECTED]> wrote:
> When I run the code below (via minimals), I get the following error, why?
>
> enter loop
>
> ! Extra \else.
>
> \@@plniterate ...\expandafter \@@plniterate \else
>
> \fi
>
> \myloop ...by 1 \ifnum \tempcnta >#1\else \repeat

I think the loop structure should be:
\loop ... \if...  ... \repeat

>
> \fi \message {exit}
>
> l.16 \myloop{2008}
>
> Code:
>
> \newcount\startcnt
>
> \newcount\tempcnta
>
> \def\myloop#1{%
>
> \message{enter}
>
> \tempcnta=\the\startcnt%
>
> \loop
>
> \message{loop}
>
> \advance \tempcnta by 1
>
> \ifnum\tempcnta>#1\else \repeat\fi
>
> \message{exit}
>
> }
>
> \starttext
>
> \startcnt=1800
>
> \myloop{2008}
>
> \stoptext
>
> Thanks,
>
> Bart
>
> ___
> 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] PDF page numbers

2008-12-09 Thread Zhichu Chen
Hi Dereck

On Tue, Dec 9, 2008 at 6:53 PM, Derek CORDEIRO <[EMAIL PROTECTED]> wrote:
> In latex + book/memoir + hyperref, if \frontmatter \mainmatter are used, the
> pdf files generated use the roman numbers in the pdf itself. It appears as
> ii (2 of 500) in the pdfviewer. Is it possible to do the same with ConTeXt?

Some dirty staffs I've done here:
http://www.ntg.nl/pipermail/ntg-context/2008/035378.html
Mind take a look?

>
> Is there any introduction to using fonts(typefaces) in ConTeXt? I find
> myself stumbling on simple things(I'm a beginner). For example, the
> following works fine.
>
> \usetypescriptfile[type-gyr]
> \usetypescript[palatino]
> \setupbodyfont[palatino,11pt]
>
> but the following does not work.
>
> \usetypescriptfile[type-gyr]
> \usetypescript[schoolbook][ec]
> \setupbodyfont[schoolbook,11pt]
>
> I have tried with and older distribution of ConTeXt which comes along with
> Fedora 10 as well as with ConTeXt minimals. Incidentally if I use
> \definetypeface[schola][rm][serif][schola][default][encoding=t5] it works
> fine. What am I doing wrong?
>
> Regards,
> Derek
>
> ___
> 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] How to get the total page number at startup in luatex?

2008-12-08 Thread Zhichu Chen
On Mon, Dec 8, 2008 at 5:47 PM, Wolfgang Schuster
<[EMAIL PROTECTED]> wrote:
> On Mon, Dec 8, 2008 at 10:33 AM, Zhichu Chen <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I've met a weird thing, I can't get \totalnumberofpages in the preamble.
>> But it used to work.
>>
>> A simple test file is
>> ++
>> \dorecurse{\totalnumberofpages}{\setvalue{test::\recurselevel}{:\recurselevel:}}
>> \def\test{\getvalue{test::\pagenumber}}
>> \starttext
>> \input knuth
>> \page[yes]
>> \input knuth
>> \page[yes]
>> This should be \quotation{:\pagenumber:}, but it's \quotation{\test}
>> \stoptext
>> 
>>
>> Any suggestions about how to do that? I wanna define each page a macro.
>
> Define your macros *after* \starttext.
Nice, though it makes some trouble that I should use \appendtoks for a module.

Thanks.
>
> Wolfgang
> ___
> 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
___


[NTG-context] How to get the total page number at startup in luatex?

2008-12-08 Thread Zhichu Chen
Hi,

I've met a weird thing, I can't get \totalnumberofpages in the preamble.
But it used to work.

A simple test file is
++
\dorecurse{\totalnumberofpages}{\setvalue{test::\recurselevel}{:\recurselevel:}}
\def\test{\getvalue{test::\pagenumber}}
\starttext
\input knuth
\page[yes]
\input knuth
\page[yes]
This should be \quotation{:\pagenumber:}, but it's \quotation{\test}
\stoptext


Any suggestions about how to do that? I wanna define each page a macro.
-- 
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] luatex and javascript

2008-12-07 Thread Zhichu Chen
On Mon, Dec 8, 2008 at 2:32 AM, Hans Hagen <[EMAIL PROTECTED]> wrote:
> Taco Hoekwater wrote:
>> Zhichu Chen wrote:
>>> Hi,
>>>
>>> I've searched the list and it seems that no one has been occurred
>>> to my problem.
>>>
>>> Has the javascript interface gone? 'cause I failed the following
>>
>> No, just bugged. Hans ran into that himself yesterday, actually.
>> I cannot look up the actual fix from here, but it comes down to
>> a pretty simple catcode mixup. Hans will probably post it sometime
>> tomorrow.
>
> \def\presetJSpreamble
>   {\ifx\allJSpreambles\empty\else
>  \bgroup
>  \setverbosecscharacters
>  \obeyspaces \let\obeyedspace\normalspace
>  \def\par{\delcharacter}% was: { }
>  \globallet\JSpreamble\empty
>  \def\@@collectedJSpreamble{\r!java\r!java collected}%
>  \letvalue{\@@collectedJSpreamble}=\empty
>  \def\docommand##1%
>{\xdef\JScode{\getvalue{\r!java\r!java##1}}%
> \ifoneJSpreamble % \global\letcdcsname
>   [EMAIL PROTECTED]@EA\@@[EMAIL PROTECTED]
> {\csname\@@collectedJSpreamble\endcsname\JScode}%
> \else
>   \setxvalue{\r!java\r!java##1}{\JScode}%
> \fi}%
>  \processcommacommand[\allJSpreambles]\docommand
>  \ifoneJSpreamble
>\gdef\allJSpreambles{collected}%
>  \fi
>  \globallet\presetJSpreamble\relax
>  \egroup
>\fi}
>

Thanks, it works now.
>
>
> -
>   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] luatex and javascript

2008-12-07 Thread Zhichu Chen
On Sun, Dec 7, 2008 at 8:56 PM, Taco Hoekwater <[EMAIL PROTECTED]> wrote:
> Zhichu Chen wrote:
>> Hi,
>>
>> I've searched the list and it seems that no one has been occurred
>> to my problem.
>>
>> Has the javascript interface gone? 'cause I failed the following
>
> No, just bugged. Hans ran into that himself yesterday, actually.
> I cannot look up the actual fix from here, but it comes down to
> a pretty simple catcode mixup. Hans will probably post it sometime
> tomorrow.
OK, makes me feel a little released :) Thanks for the information.

>
> Best wishes,
> Taco
>
> ___
> 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
___


[NTG-context] luatex and javascript

2008-12-07 Thread Zhichu Chen
Hi,

I've searched the list and it seems that no one has been occurred
to my problem.

Has the javascript interface gone? 'cause I failed the following
simplest file:

\setupinteraction[state=start]

\starttext

A few years back, \TEX\ could only produce \fillinfield [dvi]
{DVI} output, but nowadays, thanks to \fillinfield {Han The
Thanh}, we can also directly produce \fillinfield [pdf] {PDF}!
Nice eh? Actually, while the first field module was prototyped
in ACROBAT, the current implementation was debugged in
\fillinfield [pdfTeX] {\PDFTEX}. Field support in \fillinfield
[ConTeXt] {\CONTEXT} is rather advanced and complete and all
kind of fields are supported. One can hook in appearances, and
validation \fillinfield [JavaScripts] {JAVASCRIPT}'s. Fields
can be cloned and copied, where the latter saves some space. By
using \fillinfield {objects} when suited, this module saves
space anyway.

\stoptext


It's copied from the mwidget-s.pdf

My luatex is 0.30.3, and I just run "luatools --generate" and
"ctxtools --update" today.

The error message is:

! Undefined control sequence.
\:j::j:fields_1 ->
var
   visible_field  = new Array() ; var visible_fields = 0...
\docommand ...code {\getvalue {\r!java \r!java #1}
  }\ifoneJSpreamble [EMAIL 
PROTECTED] \se...
\next2 #1,->\docommand {#1}
   \doprocesscommaitem
 \relax fields_1,
   Do_Check_Answer
\doprocesscommalist ...aitem \gobbleoneargument #1
  ,]\relax \global \advance ...
\presetJSpreamble ...[\allJSpreambles ]\docommand
  \ifoneJSpreamble \gdef \al...
...
l.18 \stoptext

?




-- 
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] How to define such a function in lua? Sorry I don't have a name on it.

2008-12-06 Thread Zhichu Chen
On Fri, Dec 5, 2008 at 8:05 AM, Arthur Reutenauer
<[EMAIL PROTECTED]> wrote:
>>> but it might make more sense to look into metatables (i assume that you
>>> own the programming in lua book which explains that)
>>
>> I don't have one :(, I'll take a good at it later.
>
>  You really should look into the book, it has a whole chapter about
> object-oriented programming in Lua, and explains useful conventions.

Oh it's a long document. I almost took a day to finish it. I've got the main
idea now. Thanks.

I'm sorry, I got another question now. How to link two variables? Like if I
change one, the other would be changed as well. This may be a piece of cake
for you and please forgive my laziness.

>
>Arthur
> ___
> 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] How to define such a function in lua? Sorry I don't have a name on it.

2008-12-04 Thread Zhichu Chen
On Thu, Dec 4, 2008 at 5:28 PM, Hans Hagen <[EMAIL PROTECTED]> wrote:
> Zhichu Chen wrote:
>> Hi,
>>
>> I'm learning to use luatex these days, one day actually. It's very
>> interesting. Although reference manuals are available, I still don't
>> know how to implement my designation.
>>
>> The thing is, I know there's a "self" variable for object-oriented
>> programming, like
>> ==
>> \startluacode
>> testdata = { a = 0,
>>  b = 0,
>>  c = 0,
>>  plus = function (self)
>> self.c = self.a + self.b
>> end
>>}
>> mytest = testdata
>> mytest.a=10
>> mytest.b=100
>> mytest:plus()
>> tex.print(mytest.c)
>> \stopluacode
>> ==
>> OK, but what if I wanna do something more, like substract? I would
>> like to use another object, like
>> ==
>> \startluacode
>> testdata = { a = 0,
>>  b = 0,
>>  c = 0,
>>  calc = Calc
>>}
>> Calc = { plus = function (self)
>> self.c = self.a + self.b
>> end,
>>  substract = function (self)
>> self.c = self.a - self.b
>> end
>>}
>> mytest = testdata
>> mytest.a=10
>> mytest.b=100
>> mytest.calc:plus()
>> tex.print(mytest.c)
>> \stopluacode
>> ==
>> Of course this won't work, for the "self" in Calc refers to mytest.calc
>> rather than mytest. How to implement things like that?
>
> Calc = { add = function (self)
> self.c = self.a + self.b
> end,
>  substract = function (self)
> self.c = self.a - self.b
> end
>}
>
> testdata = { a = 0,
>  b = 0,
>  c = 0,
>  calc = function(self,f) return Calc[f](self) end
>}
>
> mytest = testdata
> mytest.a=10
> mytest.b=100
> Calc.add(testdata)
> print(mytest.c)
> testdata:calc("substract")
> print(mytest.c)
Thanks
>
> but it might make more sense to look into metatables (i assume that you
> own the programming in lua book which explains that)
I don't have one :(, I'll take a good at it later.
>
> 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
> ___
>



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


[NTG-context] How to define such a function in lua? Sorry I don't have a name on it.

2008-12-03 Thread Zhichu Chen
Hi,

I'm learning to use luatex these days, one day actually. It's very
interesting. Although reference manuals are available, I still don't
know how to implement my designation.

The thing is, I know there's a "self" variable for object-oriented
programming, like
==
\startluacode
testdata = { a = 0,
 b = 0,
 c = 0,
 plus = function (self)
self.c = self.a + self.b
end
   }
mytest = testdata
mytest.a=10
mytest.b=100
mytest:plus()
tex.print(mytest.c)
\stopluacode
==
OK, but what if I wanna do something more, like substract? I would
like to use another object, like
==
\startluacode
testdata = { a = 0,
 b = 0,
 c = 0,
 calc = Calc
   }
Calc = { plus = function (self)
self.c = self.a + self.b
end,
 substract = function (self)
self.c = self.a - self.b
end
   }
mytest = testdata
mytest.a=10
mytest.b=100
mytest.calc:plus()
tex.print(mytest.c)
\stopluacode
==
Of course this won't work, for the "self" in Calc refers to mytest.calc
rather than mytest. How to implement things like that?

Thanks in advance.

-- 
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] Happy Single's Day

2008-11-10 Thread Zhichu Chen
Sounds like a bachelor day. Not for me but thanks and congratulations.

On Mon, Nov 10, 2008 at 11:59 AM, Yue Wang <[EMAIL PROTECTED]> wrote:
> Hi, all:
>
> Tomorrow is 11/11 single day. (I dont know whether the holiday exists
> in other places, but on 11:11 am, 11/11, (all the numbers are
> single[1]), all the singles will celebrate this moment and dreamed to
> find their Mr. or Miss. Right.) So consider this is a ConTeXt
> mailing list, I made a new card using ConTeXt to all the ConTeXt users
> who are singles. It can be downloaded from
> http://att.newsmth.net/att.php?p.460.279144.453.pdf
>
> Wish you a happy Single's Day!
>
> Yue Wang
> ___
> 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
___


  1   2   3   >