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-07 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 <chenzhi...@sinap.ac.cn> 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 / 

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,
...
# 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

[NTG-context] Virtual font question

2015-06-22 Thread Zhichu Chen

Hello list,

I was trying to use the Math Times Pro 2 fonts in ConTeXt MKIV. This 
Type1 font
contains a map file, a set of pfb files and the corresponding tfm files. 
I was managed

to write a .lfg file and a type-imp-xxx file, but here's my problem.

The font comes with three different sizes, the virtual fonts in my .lfg 
file look like:

===
virtuals = {
[mtpro06a-regular] = {
{ name = file:texgyretermes-regular.otf, features = 
virtualmath, main = true },
{ name = mt2mif.tfm, vector = mtpro2-mi, 
skewchar=0x7F },
{ name = mt2syf.tfm, vector = mtpro2-sy, 
skewchar=0x30, parameters = true },
{ name = mt2mbf.tfm, vector = mtpro2-mb, 
skewchar=0x7F },
{ name = mt2syaf.tfm, vector = mtpro2-sya, 
skewchar=0x7F },
{ name = mt2bbf.tfm, vector = mtpro2-bb, 
skewchar=0x7F },
{ name = mt2msf.tfm, vector = mtpro2-mca, 
skewchar=0x7F },
{ name = mt2bmsf.tfm, vector = mtpro2-bmca, 
skewchar=0x7F },
{ name = mt2mff.tfm, vector = mtpro2-mfa, 
skewchar=0x7F },
{ name = mt2bmff.tfm, vector = mtpro2-bmfa, 
skewchar=0x7F },
{ name = mt2bbif.tfm, vector = mtpro2-bbi, 
skewchar=0x7F },

},
[mtpro08a-regular] = {
{ name = file:texgyretermes-regular.otf, features = 
virtualmath, main = true },
{ name = mt2mis.tfm, vector = mtpro2-mi, 
skewchar=0x7F },
{ name = mt2sys.tfm, vector = mtpro2-sy, 
skewchar=0x30, parameters = true },
{ name = mt2mbs.tfm, vector = mtpro2-mb, 
skewchar=0x7F },
{ name = mt2syas.tfm, vector = mtpro2-sya, 
skewchar=0x7F },
{ name = mt2bbs.tfm, vector = mtpro2-bb, 
skewchar=0x7F },
{ name = mt2mss.tfm, vector = mtpro2-mca, 
skewchar=0x7F },
{ name = mt2bmss.tfm, vector = mtpro2-bmca, 
skewchar=0x7F },
{ name = mt2mfs.tfm, vector = mtpro2-mfa, 
skewchar=0x7F },
{ name = mt2bmfs.tfm, vector = mtpro2-bmfa, 
skewchar=0x7F },
{ name = mt2bbis.tfm, vector = mtpro2-bbi, 
skewchar=0x7F },

},
[mtpro10a-regular] = {
{ name = file:texgyretermes-regular.otf, features = 
virtualmath, main = true },
{ name = mt2mit.tfm, vector = mtpro2-mi, 
skewchar=0x7F },
{ name = mt2syt.tfm, vector = mtpro2-sy, 
skewchar=0x30, parameters = true },
{ name = mt2mbt.tfm, vector = mtpro2-mb, 
skewchar=0x7F },
{ name = mt2syat.tfm, vector = mtpro2-sya, 
skewchar=0x7F },
{ name = mt2bbt.tfm, vector = mtpro2-bb, 
skewchar=0x7F },
{ name = mt2mst.tfm, vector = mtpro2-mca, 
skewchar=0x7F },
{ name = mt2bmst.tfm, vector = mtpro2-bmca, 
skewchar=0x7F },
{ name = mt2mft.tfm, vector = mtpro2-mfa, 
skewchar=0x7F },
{ name = mt2bmft.tfm, vector = mtpro2-bmfa, 
skewchar=0x7F },
{ name = mt2bbit.tfm, vector = mtpro2-bbi, 
skewchar=0x7F },

},
===
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:

===
\definefontsynonym [\s!MathRoman] [MTPro10a-Regular@mtpro10a-regular]
===
The output pdf used the 10-size font as expected.

I stole some codes from lm.lfg and added the following code:
===
designsizes = {
[MathTimeProA-Regular] = {
[4pt]  = MTPro06a-Regular@mtpro06a-regular,
[5pt]  = MTPro06a-Regular@mtpro06a-regular,
[6pt]  = 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:
===
fontsdefining  start stage one: MathRoman mo 1
fontsdefining  specification 'MathRoman 

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
___

Re: [NTG-context] Position of integral limits

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


On Wed, Apr 30, 2014 at 12:54 PM, Darksair chris.cors...@gmail.com 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
___

[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 zhichu.c...@gmail.com 
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 
wolfgang.schus...@gmail.com 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[typeface][style][font][preset=chinese]

For the moment I added three presets “chinese”, “japanese” and 
“korean” but they need better
names, e.g. “range:chinese” because there could be also 
“features:chinese” etc.
I get it now. I can put range and features of the fallback fonts in the 
preset.


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.


The module provides keys to apply a certain font and feature for each 
alternative (upright, italic etc.)

of a font, a complete list with all keys is shown in the table below.

---
| Alternative | Font| Feature |
|-|
| tf  | regularfont | regularfeatures |
| it  | italicfont  | italicfeatures  |
| sl  | slantedfont | slantedfeatures |
| bf  | boldfont| boldfeatures|
| bi  | bolditalicfont  | bolditalicfeatures  |
| bs  | boldslantedfont | boldslantedfeatures |
| sc  | smallcapsfont   | smallcapsfeatures   |
---

The feature-keys expect the name from the \definefontfeature command, 
when you don’t
specify a feature to a certain alternative the value from the 
“features” key is used.


When you want to set a certain font for a alternative there are 
different ways, I’m going
to show the different ways with a few examples where I change the font 
for italic.
Thanks for the descriptions. I have made a small test and turns out the 
regularfont has to be assigned to something or the other xxxfonts 
won't have any effects.


Here's my code:
=
\definefallbackfamily [mainface] [serif] [adobesongstd]
  [range={0x00400-0x2FA1F}%
  ,regularfont=name:adobesongstdlight%
  ,italicfont=name:adobefangsongstdregular%
  ,boldfont=name:adobeheitistdregular%
  ,bolditalicfont=name:adobekaitistdregular%
  ,force=yes%
  ,features=song%
  ]
=
and if I remove the regularfont=... line, the boldface Chinese 
characters will use the Adobe Song Std font as well. Same thing happened 
when I used the preset=xxx option which I don't know if it is intended 
to behave like that, by the way.


Oh, and off the topic, can I use effect to assign the fonts? Like if I 
have defined

=
\defineeffect[mybold][alternative=both,rulethickness=\dimexpr\bodyfontsize/10\relax]
=
I would like to use this effect to apply to my bold fonts, maybe:
=
\setupfontfamily [serif] [DejaVu Serif] [boldfont=effect:mybold]
=
I know this has nothing to do with this module. I just thought this 
might be interesting.


1. Use the filename of a font. With the “file:” prefix you can the 
tell the module
to look for a file with the given name, when the file isn’t found the 
font from
the tf-alternative is used. The file-method is also used when you omit 
the prefix.


\setupfontfamily [serif] [DejaVu Serif] [italicfont=file:dejavuserifbold]

\starttext
Regular and \it Italic
\stoptext

2. Use a certain style. When you use the “style: ”prefix the module 
looks for a certain

style of the requested font.

\setupfontfamily [serif] [DejaVu Serif] [italicfont=style:bolditalic]

\starttext
Regular and \it Italic
\stoptext

3. Search for a font with a certain name. When you use the “name:” 
prefix the module
looks for a font with the requested name. Names are internal values of 
a font

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
___

[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
))
fontsbodyfont 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 pra...@wxs.nl 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 pra...@wxs.nl 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
___

[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] 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 pra...@wxs.nl 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
___

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 hak...@me.com 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
___

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

[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-12 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 zhichu.c...@gmail.com wrote:



 On Fri, Sep 10, 2010 at 11:59 PM, Hans Hagen pra...@wxs.nl 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 pra...@wxs.nl 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 pra...@wxs.nl 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
___


[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] My mtx-fonts.lua script is broken?

2010-08-23 Thread Zhichu Chen
On Mon, Aug 23, 2010 at 5:26 PM, Taco Hoekwater t...@elvenkind.com 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
___


Re: [NTG-context] PDF Custom Page Numbering

2010-06-10 Thread Zhichu Chen
On Thu, Jun 10, 2010 at 12:35 PM, Aditya Mahajan adit...@umich.edu 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 6:45 PM, Hans Hagen pra...@wxs.nl 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-02 Thread Zhichu Chen
On Tue, Mar 2, 2010 at 11:23 PM, Mojca Miklavec
mojca.miklavec.li...@gmail.com 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-01 Thread Zhichu Chen
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, -- rdownharpoon
[0x021C3] = 0x78, -- ldownharpoon
[0x021CB] = 0x79, -- lrharpoon
[0x021CC] = 0x7A, -- rlharpoon
[0x021B0] = 0x7B, -- upthenleftarrow
--~ [0x0] = 0x7C, -- part
[0x021B1] = 0x7D, -- upthenrightarrow
--~ [0x0] = 0x7E, -- part
[0x02276] = 0x7F, -- ltgt
[0x021B2] = 0x81, -- downthenleftarrow
[0x021B3] = 0x82, -- downthenrightarrow
[0x02B0E] = 0x83, -- rightthendownarrow
[0x02B10] = 0x84, -- leftthendownarrow
[0x02B0F] = 0x85, -- rightthenuparrow
[0x02B11] = 0x86, -- leftthenuparrow
[0x021B6] = 0x87, -- leftarcarrow
[0x021B7] = 0x88, -- rightarcarrow
[0x0293D] = 0x89, -- leftarcarrowplus
[0x0293C] = 0x8A, 

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 zhichu.c...@gmail.com 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, -- rdownharpoon
    [0x021C3] = 0x78, -- ldownharpoon
    [0x021CB] = 0x79, -- lrharpoon
    [0x021CC] = 0x7A, -- rlharpoon
    [0x021B0] = 0x7B, -- upthenleftarrow
 --~     [0x0] = 0x7C, -- part
    [0x021B1] = 0x7D, -- upthenrightarrow
 --~     [0x0] = 0x7E, -- part
    [0x02276] = 0x7F, -- ltgt
    [0x021B2] = 0x81, -- downthenleftarrow
    [0x021B3] = 0x82, -- downthenrightarrow
    [0x02B0E] = 0x83, -- rightthendownarrow
    [0x02B10] = 0x84, -- leftthendownarrow
    [0x02B0F] = 0x85

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

2010-02-24 Thread Zhichu Chen
On Wed, Feb 24, 2010 at 6:24 PM, Hans Hagen pra...@wxs.nl 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
mojca.miklavec.li...@gmail.com 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 lbmad.pfb
 hlcdim LucidaNewMath-DemiItalic lbmdi.pfb
 hlcdima LucidaNewMath-AltDemiItalic lbmdo.pfb
 hlcdm LucidaNewMath-Demibold lbmd.pfb
 hlcdy LucidaNewMath-Symbol-Demi lbmsd.pfb
 hlcra LucidaNewMath-Arrows lbma.pfb
 hlcrim LucidaNewMath-Italic lbmi.pfb
 hlcrima LucidaNewMath-AltItalic lbmo.pfb
 hlcrm LucidaNewMath-Roman lbmr.pfb
 hlcrv LucidaNewMath-Extension lbme.pfb
 hlcry LucidaNewMath-Symbol lbms.pfb

 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 lbmr.pfb
 hlcrim LucidaNewMath-Italic lbmi.pfb
 hlcrima LucidaNewMath-AltItalic lbmo.pfb

 hlcrv LucidaNewMath-Extension lbme.pfb
 hlcry LucidaNewMath-Symbol lbms.pfb
 hlcra LucidaNewMath-Arrows lbma.pfb

 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 not completly sure about 

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 pra...@wxs.nl 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
___


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
___


[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
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 Chenzhichu.c...@gmail.com 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
___


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 Hoekwatert...@elvenkind.com 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-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
Schusterschuster.wolfg...@googlemail.com 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
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
On Wed, Jun 24, 2009 at 7:29 PM, Hans Hagenpra...@wxs.nl 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
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, Nicolanvitacolo...@gmail.com wrote:
 In article
 769ba7780906240342s4939ac2foe7bfd783ad2e8...@mail.gmail.com,
  Zhichu Chen zhichu.c...@gmail.com 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
___


[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.acbo...@princeton.edu 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ünsterpmli...@free.fr 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 pra...@wxs.nl 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:/ConTeXt/tex/texmf-loc
al/tex/context/base/type-siz.mkiv))
(d:/ConTeXt/tex/texmf-local/tex/context/base/type-otf.tex
(d:/ConTeXt/tex/texmf-loca
l/tex/context/base/type-otf.mkiv))
(d:/ConTeXt/tex/texmf-local/tex

[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 Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl 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-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:12 PM, Hans Hagen pra...@wxs.nl 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-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:30 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 25.05.2009 um 08:55 schrieb Zhichu Chen:

 On Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl 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-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com 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-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com 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-23 Thread Zhichu Chen
On Thu, May 21, 2009 at 9:25 AM, Yue Wang yuleo...@gmail.com 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] 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
schuster.wolfg...@googlemail.com 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
___


[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 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 luigi.sca...@gmail.com wrote:


 On Fri, May 22, 2009 at 4:48 PM, Zhichu Chen zhichu.c...@gmail.com 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
___


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
schuster.wolfg...@googlemail.com 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
On Sat, May 23, 2009 at 12:46 AM, luigi scarso luigi.sca...@gmail.com wrote:


 On Fri, May 22, 2009 at 6:32 PM, Zhichu Chen zhichu.c...@gmail.com 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:54 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com 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:55 AM, luigi scarso luigi.sca...@gmail.com wrote:


 On Fri, May 22, 2009 at 6:32 PM, Zhichu Chen zhichu.c...@gmail.com 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
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
schuster.wolfg...@googlemail.com 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 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 t...@elvenkind.com 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
___


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 t...@elvenkind.com 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
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] 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 zpx...@gmail.com 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 zhichu.c...@gmail.com

 On Tue, Jan 6, 2009 at 6:36 AM, Aditya Mahajan adit...@umich.edu 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 adit...@umich.edu 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 t...@elvenkind.com 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 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] ! 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 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] 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
___


[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] 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] 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
argument \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] 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
___


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


Re: [NTG-context] Lettermodule

2008-11-01 Thread Zhichu Chen
Hi Willi,

On Sat, Nov 1, 2008 at 11:16 AM, Willi Egger [EMAIL PROTECTED] wrote:
 Hello Wolfgang,

 I just updated to the latest beta of context.

 Unfortunately I get now an error when using the letter module.
 I have no clue.

 ConTeXt  ver: 2008.10.31 13:58 MKIV  fmt: 2008.11.1  int: english/
 english

 
 ! Undefined control sequence.
 argument \c!extension
 =
 \xprocesscommaitem #1,#2-\if ,#1
  ,[EMAIL PROTECTED] \xprocesscommaitem \else 
 \if ]
 [EMAIL PROTECTED]
 argument ...t-ltr, \c!extension =, \c!interface
   =default
 \xdogetparameters #1]-\xprocesscommaitem #1
 ,],[EMAIL PROTECTED]@
 \dosetupmodule ...rs [\??md :\currentmodule :][#1]
   \expanded
 {\getparameters ...
 to be read again
\par

\startconstants ... \stopcontants is not available now, nor is
\startvariables ... \stopvariables. You should change those
interface to
\setinterfaceconstant{extension}{extension}

I got that from Hans a few days ago.

 ...

 Kind regards

 Willi
 ___
 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] external figure extension name PDF not supported

2008-11-01 Thread Zhichu Chen
Hi Zhaopeng,

On Sat, Nov 1, 2008 at 1:31 PM, Zhaopeng Xing [EMAIL PROTECTED] wrote:
 Hi,

 There is a problem about a figure name. When I use pdf figures, capital
 xx.PDF can not be identified, while only xx.pdf is supported. I hope it
 can be fixed because my odf printer always give extension name PDF.
 Thanks.

The following command works for me
\externalfigure[a.PDF][type=pdf]

By the way, I'm not trying to be professional, could you just write a shell
to convert those figures with correct suffix?


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


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

2008-10-28 Thread Zhichu Chen
Hi there,

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

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

\startconstants all
   xxx: xxx
\stopconstants

any explanations?

-- 
Best Regards
Chen


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

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

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


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

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

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

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

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

 \startconstants all
xxx: xxx
 \stopconstants

 any explanations?

 sure, that interface has gone

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

 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
 -
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!

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




-- 
Best Regards
Chen


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

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

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


Re: [NTG-context] why does not this style work?

2008-10-26 Thread Zhichu Chen
Hi Ruini,

Since \dosanhao has nothing to do with it's argument, why not just define like
\def\mybig
  {\switchtobodyfont[24pt]}

On Sun, Oct 26, 2008 at 3:55 PM, Ruini Xue [EMAIL PROTECTED] wrote:
 I want to use a dedicated font size for the chapter title, so I wrote this
 piece of code:

 %%
 \def\mybig%
  {\dosingleempty\dosanhao}
 \def\dosanhao[#1]%
  {\switchtobodyfont[24pt]}

 \setuphead
   [chapter]
   [style=\mybig]

 \starttext
 \chapter{hello, world}

 \stoptext
 %

 However, the error is:
 %
 ! Use of \dosanhao doesn't match its definition.
 \doifnextcharelse ...token =#1\def \!!stringa {#2}
  \def \!!stringb {#3}\futur...
 \@@kochapterstyle -\mybig
   \bf
 \doconvertfont #1-\edef \p!defined {#1
   }\ifx \p!defined \empty \else [EMAIL 
 PROTECTED] \d...
 \dosetfontattribute ...me [EMAIL PROTECTED] \endcsname \fi
  \empty
 \doplaceheadnumbertext ...bute {\??ko #1}\c!style
  \dosetcolorattribute {\??k...
 \dodododoconstructhead ...{\finalsectionnumber }}}
  \writesection {#1}{#3}{#4}...
 l.11 \chapter{hello, world}
 %%%

 If I replace the \mybig with \switchtobodyfont in style=xx, it works fine.
 What's the difference between  them? and why the former does not work?

 -- ruini







 ___
 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] why does not this style work?

2008-10-26 Thread Zhichu Chen
Hi Ruini,

by the way, maybe this is what you wanted:

==
\unexpanded\def\mybig
   {\dosingleempty\dosanhao}
\unexpanded\def\dosanhao[#1]%
  {\iffirstargument
 \switchtobodyfont[#1]%
   \else
 \switchtobodyfont[24pt]%
   \fi}

\setuphead
  [chapter]
  [style={\mybig[44pt]}]

\starttext
\chapter{hello, world}
\stoptext
==

On Sun, Oct 26, 2008 at 3:55 PM, Ruini Xue [EMAIL PROTECTED] wrote:
 I want to use a dedicated font size for the chapter title, so I wrote this
 piece of code:

 %%
 \def\mybig%
  {\dosingleempty\dosanhao}
 \def\dosanhao[#1]%
  {\switchtobodyfont[24pt]}

 \setuphead
   [chapter]
   [style=\mybig]

 \starttext
 \chapter{hello, world}

 \stoptext
 %

 However, the error is:
 %
 ! Use of \dosanhao doesn't match its definition.
 \doifnextcharelse ...token =#1\def \!!stringa {#2}
  \def \!!stringb {#3}\futur...
 \@@kochapterstyle -\mybig
   \bf
 \doconvertfont #1-\edef \p!defined {#1
   }\ifx \p!defined \empty \else [EMAIL 
 PROTECTED] \d...
 \dosetfontattribute ...me [EMAIL PROTECTED] \endcsname \fi
  \empty
 \doplaceheadnumbertext ...bute {\??ko #1}\c!style
  \dosetcolorattribute {\??k...
 \dodododoconstructhead ...{\finalsectionnumber }}}
  \writesection {#1}{#3}{#4}...
 l.11 \chapter{hello, world}
 %%%

 If I replace the \mybig with \switchtobodyfont in style=xx, it works fine.
 What's the difference between  them? and why the former does not work?

 -- ruini







 ___
 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] Page numbering in Adobe Reader

2008-10-16 Thread Zhichu Chen
Hi Hans and Taco,

Some guy think it's cool to use romannumeral numbers in the
preface and so is in the Adobe Reader. I searched the source
but apparently it is not provided. I made a very dirty test file so
could you make a switch in the \setupinteraction officially?

My test file is like:
==
\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
==

A lot of the code to setup the main layout is stolen from Wolfgang :)


-- 
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] Has anybody used asymptote without LaTeX?

2008-10-11 Thread Zhichu Chen
Hi all,

On Sat, Oct 11, 2008 at 1:25 PM, Michail Vidiassov [EMAIL PROTECTED] wrote:
 Dear All,

 On Fri, 10 Oct 2008, Zhichu Chen wrote:

 If I want to embed the .prc file into a pdf document, all I need to do
 is specify the correct /Subtype and mime type. That's very easy. I
 think creating 3D presentations without any commercial or mouse-
 clicking-GUI interface becomes realistic now.

 No, there is more - you have to set appearance (may be empty).
 And many nice things can be done via properties of the 3D object embedded
 into PDF. Consult latest PDF reference.

Oh, yea, I don't know that, no wonder my output doesn't look good.

 You may look at libharu U3D code (it handles PRC too) and my
 embedder (it needs libconfig from http://www.hyperrealm.com/libconfig/
 and libharu from libharu.org) from
 http://www.iaas.msu.ru/tmp/u3dembedder.tgz
Thanks, I'll study on that.

   Sincerely, Michail

 ___
 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] Has anybody used asymptote without LaTeX?

2008-10-09 Thread Zhichu Chen
Hi, all,

It's me again. Since Asymptote 1.44 has been released, I don't have
to compile it myself. So I played a little bit and find out that if I don't
want labels nor produce a pdf format of that image, I can live without
LaTeX. That's kind of a good news.

If I want to embed the .prc file into a pdf document, all I need to do
is specify the correct /Subtype and mime type. That's very easy. I
think creating 3D presentations without any commercial or mouse-
clicking-GUI interface becomes realistic now.


-- 
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] Has anybody used asymptote without LaTeX?

2008-10-08 Thread Zhichu Chen
Hi Michail,

It's a little late for me to check my mailbox. Thank you for your work
and yes, I'm
interested in it. Can I get a copy of it?

On Mon, Sep 29, 2008 at 5:19 PM, Michail Vidiassov [EMAIL PROTECTED] wrote:
 Dear All,

 And how to embed .prc files into the .pdf document?

 I have made a standalone embedder some time ago,
 reproducing capabilities of movie15 LeTeX package and somewhat extending them.
 If anybody is interested it can be put in shipable state.

Sincerely, Michail

 ___
 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] Has anybody used asymptote without LaTeX?

2008-09-29 Thread Zhichu Chen
Hi Yue,

On Mon, Sep 29, 2008 at 1:57 PM, Yue Wang [EMAIL PROTECTED] wrote:
 Hi, Zhichu:

 $n$ years ago ($n\geq 2$), some user had successfully embed a u3d
 format file into pdf using ConTeXt with the instruction from Hans. I
 think the module is still there. Maybe you can have a look. In fact
 u3d and prc are similar, maybe you can try the same way. But I have no
 idea how to create a asy-tex interface like tex-mp [Moreover, I prefer
 to extend mp to 3-dimension, I look at the c code, it is not
 impossible:)].
Yes, I know that Renaud Aubin has u3d usable by ConTeXt. That's very
impressive. I will check that if I can get Asymptote compiled and work
with ConTeXt, although I don't think that necessary because labeled figures
often appears in 2D version.

If metapost could provide 3D figures, that will be great. But I don't think
Hans and Taco like that idea because prc isn't a standard yet maybe.

 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] Has anybody used asymptote without LaTeX?

2008-09-28 Thread Zhichu Chen
Hi, Alan

Thank you for your attention, but I don't need the psedu-3D effect. Asymptote
could create real 3D file which pdf has supported since, maybe, version 1.5.



On Sun, Sep 28, 2008 at 10:19 PM, Alan BRASLAU [EMAIL PROTECTED] wrote:
 On 2008-09-28 04:35 Zhichu Chen wrote:
 It is said that Asymptote has supported PRC format 3D file:
 http://asymptote.sourceforge.net/gallery/3D%20graphs/

 I really wanna give it a try, but once I was building from the svn
 source, I was told that I don't have LaTeX in my $PATH. I haven't
 really been using LaTeX for a long time, and I prefer I don't need
 to install a bunch of LaTeX programs and packages just for a
 drawing program which, IMHO, only use LaTeX to make nice
 labels.

 Is there any workarounds? And how to embed .prc files into
 the .pdf document?
  --
 Best Regards
 Chen

 This doesn't really answer your question
 but may be of some related interest to the mailing list.

 I am quite fond of pfg/tikz as a drawing package
 that works rather well with plain tex, latex and context.
 Asymptote is a similar tool, but it seems to be less portable.
 However, it appears on the other hand to be much more powerful for 3D.
 Neverless, I am sharing with this context list an impressive tikz example





 --
 Alan Braslau
 CEA DSM-IRAMIS-SPEC
 CNRS URA 2464
 Orme des Merisiers
 91191 Gif-sur-Yvette cedex FRANCE
 tel: +33 1 69 08 73 15
 fax: +33 1 69 08 87 86
 mailto:[EMAIL PROTECTED]

 http://www-dna2006.cea.fr/

  .''`.
 : :'  :
 `. `'`
  `-
 that I have adapted to context. (I have put the author on copy.)

 Basically, the only changes to the latex source are
 \usepackage{preview} - \startTEXpage \stopTEXpage
 \begin{tikzpicture} - \starttikzpicture
 and a few other minor syntax adaptations...)

 Alan

 % What is it
 % ==
 %
 % Examples inspired by the thread at comp.text.tex about how to convert some
 hand
 % drawn pictures into programmatic 3D sketches:
 %
 http://groups.google.com/group/comp.text.tex/browse_thread/thread/a03baf5d6fa64865/f7e7b903f1d87a6a
 % The sketches present stereographic and cylindrical map projections and they
 % pose some interesting challenges for doing them with a 2D drawing package
 PGF/TikZ.
 %
 % The main idea is to draw in selected 3D planes and then project onto the
 canvas
 % coordinate system with an appriopriate transformation. Some highlights:
 % [*] usage of pgf math engine for calculation of projection transformations
 and
 % transitions points from visible (solid lines) to invisible (dashed
 lines) on
 % meridians and latitude circles
 % [*] definition of 3D plane transformation with expanded styles so that they
 are robust
 % against redefinition of macros used in their construction
 % [*] usage of named coordinates (nodes) for definition of characteristic
 points in
 % local coordinate systems so that they are accessible outside of their
 plane of
 % definition
 % [*] calculation of intersections points with TikZ intersection coordinate
 system
 % [*] usage of 'to' path operation instead of 'arc' for marking angles to
 allow for
 % easy positioning of text labels on the curve
 % [*] 3D lighting effects with shading
 %
 %
 % Who's done it
 % =
 %
 % Tomasz M. Trzeciak
 %
 %
 % Distribution and use
 % 
 %
 % Use as you see fit. Consider giving a proper attribution to the author.
 %
 %
 % Change log
 % ==
 %
 % 2008/08/07  posted to latex-community.org
 % 2008/08/08  fixed some typos, added note about 'to' path operation to the
 description,
 % fixed positioning issue of nodes and 'to' path operation as
 suggested
 % by Kjell, removed some dead code from KART picture
 % 2008/09/28  adapted as an example to ConTeXt

 \usemodule[tikz]
 \usetikzlibrary[calc,fadings,decorations.pathreplacing]

 %% helper macros

 \def\pgfmathsinandcos#1#2#3{%
  \pgfmathsetmacro#1{sin(#3)}%
  \pgfmathsetmacro#2{cos(#3)}%
 }
 \def\LongitudePlane#1#2#3{%
  \pgfmathsinandcos\sinEl\cosEl{#2} % elevation
  \pgfmathsinandcos\sint\cost{#3} % azimuth
  \tikzset{#1/.estyle={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}}
 }
 \def\LatitudePlane#1#2#3{%
  \pgfmathsinandcos\sinEl\cosEl{#2} % elevation
  \pgfmathsinandcos\sint\cost{#3} % latitude
  \pgfmathsetmacro\yshift{\cosEl*\sint}
  \tikzset{#1/.estyle={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} %
 }
 \def\DrawLongitudeCircle#1#2{
  \LongitudePlane{current plane}{\angEl}{#2}
  \tikzset{current plane/.prefix style={scale=#1}}
   % angle of visibility
  \pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} %
  \draw[current plane] (\angVis:1) arc (\angVis:\angVis+180:1);
  \draw[current plane,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1);
 }
 \def\DrawLatitudeCircle#1#2{
  \LatitudePlane{current plane}{\angEl}{#2}
  \tikzset{current plane/.prefix style={scale=#1}}
  \pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)}
  % angle of visibility
  \pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1

  1   2   3   >