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

2010-01-06 Thread Hans Hagen

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


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


Re: [NTG-context] startbuffer fails with %

2010-01-06 Thread Hans Hagen

On 5-1-2010 15:27, H. van der Meer wrote:

\startbuffer[ABC]%
{} Braces at beginning fails with buffer
\stopbuffer
\starttext
\getbuffer[ABC]
\stoptext


the buffer content is all lines between startbuffer and stopbuffer and 
both commands hav eto be on a line of their own with startbuffer having 
an optional name


buffers are special in the sense that the input stream is parsed in a 
special way


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


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

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

On Wed, Jan 6, 2010 at 4:38 PM, Hans Hagen 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] Natural Tables Cell Borders

2010-01-06 Thread Wolfgang Schuster

Am 05.01.2010 um 04:02 schrieb Curiouslearn:

 Thanks Wolfgang. I am not yet proficient enough in Metapost or Context
 to understand your code. But will look at it more carefully later.
 
 Meanwhile, is there any further work going on on Natural Tables? Are
 there plans to introduce the ability to have borders of different
 thickness for the same cell through simple options.


A TeX based solution won't be possible without Hans but you can set
the values in TeX (\framed, \setupTABLE) and use them in MetaPost.

The following example show you what can be done.

\unprotect

\startuseMPgraphic{tableborder}

%linecap := butt ;

numeric FrameOffset, LeftRuleThickness, RightRuleThickness, TopRuleThickness, 
BottomRuleThickness ;

FrameOffset := \frameddimension{frameoffset} ;
LeftRuleThickness   := \frameddimension{leftrulethickness}   ;
RightRuleThickness  := \frameddimension{rightrulethickness}  ;
TopRuleThickness:= \frameddimension{toprulethickness};
BottomRuleThickness := \frameddimension{bottomrulethickness} ;

pair lt, rt, lb, rb ;

lt = (FrameOffset/2,OverlayHeight-FrameOffset/2) ;
rt = (OverlayWidth-FrameOffset/2,OverlayHeight-FrameOffset/2) ;
lb = (FrameOffset/2,FrameOffset/2) ;
rb = (OverlayWidth-FrameOffset/2,FrameOffset/2) ;

draw lt--rt withpen pencircle scaled TopRuleThickness;
draw lb--rb withpen pencircle scaled BottomRuleThickness ;
draw lb--lt withpen pencircle scaled LeftRuleThickness   ;
draw rb--rt withpen pencircle scaled RightRuleThickness  ;

setbounds currentpicture to OverlayBox ;

\stopuseMPgraphic

\defineoverlay
  [tableborder]
  [%\edef\topframeparameter   {\framedparameter\c!topframe   }%
   %\edef\bottomframeparameter{\framedparameter\c!bottomframe}%
   %\edef\leftframeparameter  {\framedparameter\c!leftframe  }%
   %\edef\rightframeparameter {\framedparameter\c!rightframe }%
   \useMPgraphic{tableborder}]

\setupTABLE
  [   toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness},
 leftrulethickness=\framedparameter{rulethickness},
rightrulethickness=\framedparameter{rulethickness},
%  topframe=on,
%   bottomframe=on,
% leftframe=on,
%rightframe=on,
background=tableborder,
 frame=off]

\protect

\starttext

\start

\setupTABLE[y][1][bottomrulethickness=2pt]
\setupTABLE[3][3][bottomrulethickness=2pt,rightrulethickness=2pt]
\setupTABLE[1][3][bottomframe=off]

\bTABLE
\bTR
\bTD 1 \eTD
\bTD 2 \eTD
\bTD 3 \eTD
\eTR
\bTR
\bTD 4 \eTD
\bTD 5 \eTD
\bTD 6 \eTD
\eTR
\bTR
\bTD 7 \eTD
\bTD 8 \eTD
\bTD 9 \eTD
\eTR
\eTABLE

\stop

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


[NTG-context] cutmarks length setting?

2010-01-06 Thread Hans van der Meer
I would like to make the cutmarks (those placed around the four  
corners of a page) a little longer. I have looked into the sources  
(contextbeta) but could not spot where to set the length of these  
lines. What do I have to do to vary their length?


Hans van der Meer




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

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] cutmarks length setting?

2010-01-06 Thread Wolfgang Schuster

Am 06.01.2010 um 13:27 schrieb Hans van der Meer:

 I would like to make the cutmarks (those placed around the four corners of a 
 page) a little longer. I have looked into the sources (contextbeta) but could 
 not spot where to set the length of these lines. What do I have to do to vary 
 their length?

page-lay:

\def\pagecutmarklength{.5cm}

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
___


[NTG-context] TeX Gyre and (no) Cyrillic

2010-01-06 Thread Mojca Miklavec
Dear Cyrillic users,

this is just to let you know (in particular Vyatcheslav) that minimals
still contain an outdated version of TeX Gyre fonts. Below you can
read part of font development history. Simply put: Cyrillic support
has been removed a few months ago (I didn't follow closely and didn't
notice that right away).

We might keep a zip with the old font files somewhere, but support for
Cyrillic will be gone by default. Someone would need to take over the
development of Cyrillic glyphs if they were to be supported. And
someone needs to fix the wiki page.

Please do not blame me - we cannot do anything but follow what the
Polish have decided. If anyone disagrees, you are welcome to form a
team to work on those glyphs.

Ver 2.003: 16.09.2009
* this is the first official release of the TeX Gyre Termes fonts since
  June 22, 2009, when URW++, represented by Dr. Peter Rosenfeld, its
  Managing Director, kindly agreed to release the original 35 base
  PostScript fonts as shipped with Ghostscript ver. 4.00 under the LPPL
  (LaTeX Project Public License). This should be understood so that the
  35 base Postscript fonts may be used and developed either under the
  LPPL or one of the GPL (GNU Public Licence) or AFPL (Aladdin Free
  Public Licence). The latter were put in force with the initial release
  of the base fonts with Ghostscript ver. 4.00 in 1996. Hereby we thank
  Dr. Rosenfeld. The TeX Gyre fonts are being develped from the
  Ghostscript ver. 4.00 base. For reasons explained elsewhere, we prefer
  to provide our work under the GUST Font Licence (GFL) which is legally
  equivallent to the LPPL. However, since 1996 the 35 PostScript base
  fonts were enhanced under the GNU Public License with Vietnamese glyphs
  by Han The Thanh and Cyrillic glyphs by Valek Filippov. Han The Thanh
  kindly permitted his additions to be retained under under GFL/LPPL in
  this and future TeX Gyre fonts releases. Unfortunately, we were unable
  to receive a similar permission from Valek Filippov for his Cyrillic
  glyphs, thus there are no Cyrillic glyphs in any of the TeX Gyre fonts.
* with the removal of the Cyrillic glyphs all t2a-*.tfm, t2b-*.tfm
  t2c-*.tfm files and the relevant LaTeX *.fd files were also removed.

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
___


[NTG-context] resetting local footnote number (conversion = character)

2010-01-06 Thread Bowen Alan C .
Yet another try.

I have some local footnotes (conversion = character) and would like to reset  
set the counter  
(a) to “a” and 
(b) to a specific value other than “a”. 
How can I do this?

re (a) 
\resetnumber[localfootnote] does not work. 
! Missing \endcsname inserted.
to be read again 
   \numberlocalfootnotenumber 
\setcounter #1#2-\...@ea \xdef \csname #1
   \endcsname {\the \numexpr #2\relax }
l.217 \resetnumber[localfootnote]

Am I even right to assume that there is a pre-defined localfootnote counter?

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


Re: [NTG-context] TeX Gyre and (no) Cyrillic

2010-01-06 Thread Vladimir Lomov
Hi.

Before begin bothering people  I would like to know what these words mean:
we were unable  to receive a similar permission from Valek Filippov.
That is, TeX Gyre project was unable to contact with Valek or he
rejected they idea?
(I know that this mailing list is wrong place for this question but I
didn't find any additional information of TeX Gyre home page about
that.)

2010/1/6 Mojca Miklavec mojca.miklavec.li...@gmail.com:
[...]
 Ver 2.003: 16.09.2009
[...]
 For reasons explained elsewhere, we prefer
  to provide our work under the GUST Font Licence (GFL) which is legally
  equivallent to the LPPL. However, since 1996 the 35 PostScript base
  fonts were enhanced under the GNU Public License with Vietnamese glyphs
  by Han The Thanh and Cyrillic glyphs by Valek Filippov. Han The Thanh
  kindly permitted his additions to be retained under under GFL/LPPL in
  this and future TeX Gyre fonts releases. Unfortunately, we were unable
  to receive a similar permission from Valek Filippov for his Cyrillic
  glyphs, thus there are no Cyrillic glyphs in any of the TeX Gyre fonts.
 * with the removal of the Cyrillic glyphs all t2a-*.tfm, t2b-*.tfm
  t2c-*.tfm files and the relevant LaTeX *.fd files were also removed.

 Mojca

P.S. May be it is worth rewrite page http://wiki.contextgarden.net/Russian
to use another font as example like Old Standard found in
http://www.thessalonica.org.ru/en/fonts.html
or DejaVu fonts.


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

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] Natural Tables Cell Borders

2010-01-06 Thread Curiouslearn
Thanks very much Wolfgang. Will try to play with this during this week.



On Wed, Jan 6, 2010 at 6:54 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 05.01.2010 um 04:02 schrieb Curiouslearn:

 Thanks Wolfgang. I am not yet proficient enough in Metapost or Context
 to understand your code. But will look at it more carefully later.

 Meanwhile, is there any further work going on on Natural Tables? Are
 there plans to introduce the ability to have borders of different
 thickness for the same cell through simple options.


 A TeX based solution won't be possible without Hans but you can set
 the values in TeX (\framed, \setupTABLE) and use them in MetaPost.

 The following example show you what can be done.

 \unprotect

 \startuseMPgraphic{tableborder}

 %linecap := butt ;

 numeric FrameOffset, LeftRuleThickness, RightRuleThickness, TopRuleThickness, 
 BottomRuleThickness ;

 FrameOffset         := \frameddimension{frameoffset}         ;
 LeftRuleThickness   := \frameddimension{leftrulethickness}   ;
 RightRuleThickness  := \frameddimension{rightrulethickness}  ;
 TopRuleThickness    := \frameddimension{toprulethickness}    ;
 BottomRuleThickness := \frameddimension{bottomrulethickness} ;

 pair lt, rt, lb, rb ;

 lt = (FrameOffset/2,OverlayHeight-FrameOffset/2) ;
 rt = (OverlayWidth-FrameOffset/2,OverlayHeight-FrameOffset/2) ;
 lb = (FrameOffset/2,FrameOffset/2) ;
 rb = (OverlayWidth-FrameOffset/2,FrameOffset/2) ;

 draw lt--rt withpen pencircle scaled TopRuleThickness    ;
 draw lb--rb withpen pencircle scaled BottomRuleThickness ;
 draw lb--lt withpen pencircle scaled LeftRuleThickness   ;
 draw rb--rt withpen pencircle scaled RightRuleThickness  ;

 setbounds currentpicture to OverlayBox ;

 \stopuseMPgraphic

 \defineoverlay
  [tableborder]
  [%\edef\topframeparameter   {\framedparameter\c!topframe   }%
   %\edef\bottomframeparameter{\framedparameter\c!bottomframe}%
   %\edef\leftframeparameter  {\framedparameter\c!leftframe  }%
   %\edef\rightframeparameter {\framedparameter\c!rightframe }%
   \useMPgraphic{tableborder}]

 \setupTABLE
  [   toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness},
     leftrulethickness=\framedparameter{rulethickness},
    rightrulethickness=\framedparameter{rulethickness},
 %              topframe=on,
 %           bottomframe=on,
 %             leftframe=on,
 %            rightframe=on,
            background=tableborder,
                 frame=off]

 \protect

 \starttext

 \start

 \setupTABLE[y][1][bottomrulethickness=2pt]
 \setupTABLE[3][3][bottomrulethickness=2pt,rightrulethickness=2pt]
 \setupTABLE[1][3][bottomframe=off]

 \bTABLE
    \bTR
        \bTD 1 \eTD
        \bTD 2 \eTD
        \bTD 3 \eTD
    \eTR
    \bTR
        \bTD 4 \eTD
        \bTD 5 \eTD
        \bTD 6 \eTD
    \eTR
    \bTR
        \bTD 7 \eTD
        \bTD 8 \eTD
        \bTD 9 \eTD
    \eTR
 \eTABLE

 \stop

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

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

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] TeX Gyre and (no) Cyrillic

2010-01-06 Thread Arthur Reutenauer
 That is, TeX Gyre project was unable to contact with Valek or he
 rejected they idea?

  Valek rejected the idea.

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