Re: [NTG-context] Referring to multiple elements

2012-09-14 Thread Marco Patzer
2012-09-13 Andreas Mang m...@imt.uni-luebeck.de:

 I do not know if there is a solution to this. The following would
 work for your example:
 
 \in{figure}[alpha]--\in[gamma]
 
 Of course this is a quite rigid solution, that does not safeguard
 against changes in figure order

That's what I am using at the moment. Apparently there is no such
functionality. This one would go on my wish list.


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
___


[NTG-context] Wide descriptions protruding into the margin

2012-09-14 Thread Marco Patzer
Hi,

with wide description heads I have the problem that the following
description protrudes into the margin.

\definedescription
  [description]
  [alternative=hanging,
   width=broad]

\starttext
\startdescription{conclusion that}
  \input knuth
\stopdescription

\startdescription{conclusion that the designer of a new system must not only be 
literally}
  \input knuth
\stopdescription
\stoptext

In the second case the “Thus,” should be placed on the line after
the head. How do I achieve that? My current workaround is to append
a \hbox{  } to the problematic entries.


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
___

Re: [NTG-context] MKII MKIV difference between \textrule

2012-09-14 Thread Wolfgang Schuster

Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi alessan...@perucchi.org:

 Hello,
 
 In my experimentation, I've found that in mkii and mkiv the behavior of 
 \textrule and \setuptextrule are different...
 
 What I did was quite simple:
 
 \textrule{Testing head}
 blah blah blah
 \textrule
 
 in mkii the text in well centered between the lines.
 But in mkiv the bottom line is too near the text, and I need to add something 
 like \blank[halfline] to have a similar behavior as mkii.

There is a vertical skip missing in the MkIV version of the macros.

pack-mrl.mkiv

\def\pack_textrule_following#1%
  {\doifelsenothing{#1}
-{\nointerlineskip
+
{\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth\strutdp\else\ifdim\prevdepth\zeropoint-\prevdepth\fi\fi\relax
+ \nointerlineskip
  \dontleavehmode\vbox
{\color[\directtextrulesparameter\c!rulecolor]
   
{\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
 {\pack_textrule_with_text{#1}}%
   \ifvmode
 \prevdepth\zeropoint
   \fi}


 And apparently the command \starttextrule ... \stoptextrule doesn't work 
 (this was explain in the cont-entp.pdf page 204) in either mkii  mliv.

This does work for me:

\starttext

blah blah blah

\starttextrule{Testing head}
blah blah blah
\stoptextrule

blah blah blah

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


Re: [NTG-context] Referring to multiple elements

2012-09-14 Thread Sietse Brouwer
Hi Marco,

The heart of what you need is a lua function that will take an array
of numbers, and return an array of consective-number runs, like so:

fignumarray = {1, 2, 3,5, 6,8,   10, 11, 12}
-- figruns = get_runs(fignumarray)
-- returns a table structured like so:
-- figruns[1].start = 1, figruns[1].stop = 3,
-- figruns[2].start = 5, figruns[2].stop = 6,
-- figruns[3].start = 8, figruns[3].stop = 8,
-- figruns[4].start = 10, figruns[4].stop = 12

I've written one below, plus the scaffolding required to feed it the
right input, and print its output to ConTeXt. Only two functions still
need writing --- one to turn the context argument [fig:f1, fig:f2,
fig:f4] into a lua array of strings, and one to turn each reference
string into a figure number. But this should get you on your way.

If you're not comfortable with programming LuaTeX, say so and I can
fill in the two missing functions sometime this weekend. But they
should be doable, really. (And, of course, you may be far more
experienced in LuaTeX than I, I don't know.)

Cheers,
Sietse

% should be below startluacode block, but clearer like so
\def\inwithranges[#1]%
{\ctxlua{u.inwithranges(#1)}}

\startluacode
u = userdata or { }

function get_runs(a)
runs = { }
run_start = 1
while run_start = #a do
run_stop = run_start
while a[run_stop + 1] == a[run_stop] + 1 do
run_stop = run_stop + 1
end
print(a[run_start] .. - .. a[run_stop])

table.insert(runs, {[start] = a[run_start],
[stop]   = a[run_stop]})
run_start = run_stop + 1
end
return runs
end

function u.inwithranges(ref_string)
-- CTX... means I expect ConTeXt already has this function in a
library somewhere
local ref_array = CTXstring_to_array(refs_string)  --FIXME
local ref_numbers = { }
for _, v in ipairs(ref_array) do
ref_numbers[i] = CTXref_to_fignumber(array)  --FIXME
end
ref_numbers.sort()
runs = get_runs(ref_numbers)
for i, run in ipairs(runs) do
context.in( {run.start} )
context(-)
context.in( {run.stop} )
if i  #runs then context(',') end
end
end

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

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] Wide descriptions protruding into the margin

2012-09-14 Thread Philipp Gesang
Hi Marco,

···date: 2012-09-14, Friday···from: Marco Patzer···

 \definedescription
   [description]
   [alternative=hanging,
width=broad]
... /
 In the second case the “Thus,” should be placed on the line after
 the head. How do I achieve that? My current workaround is to append
 a \hbox{  } to the problematic entries.

you can hack the hanging alternative and substitute a glue for
the kern that is used for spacing (strc-con.mkvi):

···

\definedescription
  [description]
  [alternative=hanging,
   width=broad]

\unprotect
\startsetups[\??constructionrenderings:\v!hanging]
% tricky: leftskipadaption is somewhat unpredictable
\let\\=\crlf
\noindent
\advance\leftskip-\leftskipadaption\relax
\ifdim\leftskipadaption=\zeropoint
\leftskipadaption1.5\emwidth\relax % just some default
\ifnum\c_strc_constructions_nested_state=\plusone
\ifdim\leftskip\zeropoint \relax
\leftskipadaption\leftskip
\fi
\fi
\fi
\ifnum\c_strc_constructions_nested_state\zerocount % was 
\ifnum\c_strc_constructions_nested_state=\plusone
\advance\leftskip\leftskipadaption % but we're already further on
\fi
\hskip-\leftskipadaption\relax
\ifhbox\constructionheadbox\unhcopy\else\copy\fi\constructionheadbox
%% here’s the change: ·
% \kern\ifdim\constructionsheaddistance=\zeropoint 
.75\emwidth\else\constructionsheaddistance\fi
\hskip\ifdim\constructionsheaddistance=\zeropoint 
.75\emwidth\else\constructionsheaddistance\fi
\useconstructionstyleandcolor\c!style\c!color
\ignorespaces
\stopsetups
\protect

\starttext
\startdescription{conclusion that}
  \input knuth
\stopdescription

\startdescription{conclusion that the designer of a new system must not only be 
literally}
  \input knuth
\stopdescription
\stoptext

···

But maybe this could be made an option?

Regards
Philipp



-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpuQpUYh7qiu.pgp
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] Wide descriptions protruding into the margin

2012-09-14 Thread Marco Patzer
2012-09-14 Philipp Gesang ges...@stud.uni-heidelberg.de:

Hi Philipp,

 you can hack the hanging alternative and substitute a glue for
 the kern that is used for spacing (strc-con.mkvi):
 
 […]
 

This works perfectly. Thanks a lot for digging into the sources.

 But maybe this could be made an option?

\dorecurse{10}{+1}


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
___

Re: [NTG-context] Change color of EPS file.

2012-09-14 Thread pol stra
Aditya Mahajan adit...@umich.edu wrote:
 If you want to use eps images, why not just use a white background at
 ConTeXt end (as you had stated in your first message
 
I think you misread: Pol wants the EPS to be white-on-transparent,
instead of black-on-transparent, so that he can use it on a
(dark-)coloured background.
 
That is exactly what I wanted.

Pol stra wrote:
 But your answer gave me the idea to use imegemagick, so I found this
 trick:
...
 The result is good enough for me.
 
Congratulations. Good luck with your work.
 
Thank you

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

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] Change color of EPS file.

2012-09-14 Thread Troy Henderson
I tested this on a black-on-transparent EPS that was created via MetaPost,
and it seems to work fine.  If you are not using Linux (or Unix or Mac OS
X), let me know and I can probably put together a quick HTML page to do
this on my server.

 cat foo.eps | sed -e s/0 0 0 setrgbcolor/1 1 1 setrgbcolor/g  bar.eps

It simply translates the (0,0,0) triplet (which is black) to the (1,1,1)
triplet (which is white).  This is very simplistic and may not do all that
you want.

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

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] Display math characters

2012-09-14 Thread pol stra
Hello,

from the wiki 
(http://wiki.contextgarden.net/Math/basic#List_of_All_Math_macros) I tryed the 
following snippet:
\usemodule[fnt-25]
\showmathfontcharacters

But context complains that there is no fnt-25 module, so let’s grep 
showmathfontcharacters in conteXt directory.
I found that it is defined into the mat-10 module. So new snippet:
\usemodule[mat-10]
\showmathfontcharacters

End new error:

ConTeXt  ver: 2012.09.11 20:36 MKIV  fmt: 2012.9.12  int: english/english

system   cont-new.mkiv loaded
(/opt/context-minimals/texmf-context/tex/context/base/cont-new.mkiv
system   beware: some patches loaded from cont-new.mkiv
)
fontslatin modern fonts are not preloaded
languageslanguage en is active
(mathsymbols.tex
resolversmodules  loaded: 'mat-10'
(/opt/context-minimals/texmf-context/tex/context/base/s-mat-10.mkiv))
fontsdefining  font with asked name 'unknown' is not found using 
lookup 'file'
fontsdefining  unknown font unknown, loading aborted
fontsdefining  unable to define unknown as [thedefinedfont--0]
! LuaTeX error main ctx instance:22: attempt to index local 'resources' (a 
nil value)
stack traceback:
main ctx instance:22: in function 'showmathfont'
main ctx instance:1: in main chunk.

system   tex  error on line 5 in file 
/opt/context-minimals/texmf-context/tex/context/base/cont-yes.mkiv: LuaTeX 
error  ...

 1 %D \module
 2 %D   [   file=cont-yes,
 3 %Dversion=2012.06.01,
 4 %D  title=\CONTEXT\ Miscellaneous Macros,
 5   %D   subtitle=Startup Stub,
 6 %D author=Hans Hagen,
 7 %D   date=\currentdate,
 8 %D  copyright={PRAGMA ADE \ \CONTEXT\ Development Team}]
 9 %C
10 %C This module is part of the \CONTEXT\ macro||package and is
11 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12 %C details.
13 
14 % At some point I will reconsider the \starttext .. \stoptext
15 % wraping as we can assume proper styling. It's a left-over from

argument ...cument.showmathfont(font.current())}
  
\firstoftwoarguments #1#2-#1
 
\doshowmathfontcharacters ...wmathfontcharacters }
  \endgroup 
to be read again 
   \finishjob 
l.5 \finishjob
  
}   context.finishjob()
  
...
l.86 \stopluacode


I do not realy care about this list, I was just currious and it did not work so 
I point it out.
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ntg-context Digest, Vol 99, Issue 40

2012-09-14 Thread pol stra

Troy Henderson said:

I tested this on a black-on-transparent EPS that was created via MetaPost, and 
it seems to work fine.  If you are not using Linux (or Unix or Mac OS X), let 
me know and I can probably put together a quick HTML page to do this on my 
server.
Thanks for the invitation. Fortunatly I’m using GNU/Linux.


 cat foo.eps | sed -e s/0 0 0 setrgbcolor/1 1 1 setrgbcolor/g  bar.eps

It simply translates the (0,0,0) triplet (which is black) to the (1,1,1) 
triplet (which is white).  This is very simplistic and may not do all that you 
want.

Unfortunatly there is no such a sequence in my file:

grep setrgbcolor a1.EPS 
/setcmykcolor{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 
roll}repeat setrgbcolor pop}wd
/sw/setlinewidth ld/scap/setlinecap ld/sj/setlinejoin ld/sm/setmiterlimit 
ld/sd/setdash ld/rgb/setrgbcolor ld/crgb/currentrgbcolor ld/cmyk/setcmykcolor 
ld/gs/gsave ld/gr/grestore ld

But thank you for gave a try.
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ntg-context Digest, Vol 99, Issue 40

2012-09-14 Thread Troy Henderson

 Unfortunatly there is no such a sequence in my file:

 grep setrgbcolor a1.EPS
 /setcmykcolor{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1
 roll}repeat setrgbcolor pop}wd
 /sw/setlinewidth ld/scap/setlinecap ld/sj/setlinejoin ld/sm/setmiterlimit
 ld/sd/setdash ld/rgb/setrgbcolor ld/crgb/currentrgbcolor
 ld/cmyk/setcmykcolor ld/gs/gsave ld/gr/grestore ld

 But thank you for gave a try.


I doubted that it would work, but thought that I would try just the same.
It may still be able to be done by converting it to SVG, editing
(automagically), and then converting back.  If you are able, upload the EPS
to

http://www.tlhiv.org/upload/

and I will place around with it.

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

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] Display math characters

2012-09-14 Thread Otared Kavian
Hi Pol,

You can use the following:

%% begin show-math.tex
\doifmode{mkiv}{\usemodule[s][mat-11]}
\starttext
\doifmodeelse{mkiv}{\showmathfontcharacters}{\showmathcharacters}
\stoptext
%% end show-math.tex

However in mkiv the presentation of math fonts is not the same as in mkii.
I don't know how to get the mkii presentation of the math fonts in mkiv…

Best regards: OK

On 14 sept. 2012, at 16:45, pol stra r...@hotmail.fr wrote:

 Hello,
 
 from the wiki 
 (http://wiki.contextgarden.net/Math/basic#List_of_All_Math_macros) I tryed 
 the following snippet:
 \usemodule[fnt-25]
 \showmathfontcharacters
 
 But context complains that there is no fnt-25 module, so let’s grep 
 showmathfontcharacters in conteXt directory.
 I found that it is defined into the mat-10 module. So new snippet:
 \usemodule[mat-10]
 \showmathfontcharacters
 
 End new error:
 
 ConTeXt  ver: 2012.09.11 20:36 MKIV  fmt: 2012.9.12  int: english/english
 
 system   cont-new.mkiv loaded
 (/opt/context-minimals/texmf-context/tex/context/base/cont-new.mkiv
 system   beware: some patches loaded from cont-new.mkiv
 )
 fontslatin modern fonts are not preloaded
 languageslanguage en is active
 (mathsymbols.tex
 resolversmodules  loaded: 'mat-10'
 (/opt/context-minimals/texmf-context/tex/context/base/s-mat-10.mkiv))
 fontsdefining  font with asked name 'unknown' is not found 
 using lookup 'file'
 fontsdefining  unknown font unknown, loading aborted
 fontsdefining  unable to define unknown as [thedefinedfont--0]
 ! LuaTeX error main ctx instance:22: attempt to index local 'resources' (a 
 nil value)
 stack traceback:
 main ctx instance:22: in function 'showmathfont'
 main ctx instance:1: in main chunk.
 
 system   tex  error on line 5 in file 
 /opt/context-minimals/texmf-context/tex/context/base/cont-yes.mkiv: LuaTeX 
 error  ...
 
  1 %D \module
  2 %D   [   file=cont-yes,
  3 %Dversion=2012.06.01,
  4 %D  title=\CONTEXT\ Miscellaneous Macros,
  5   %D   subtitle=Startup Stub,
  6 %D author=Hans Hagen,
  7 %D   date=\currentdate,
  8 %D  copyright={PRAGMA ADE \ \CONTEXT\ Development Team}]
  9 %C
 10 %C This module is part of the \CONTEXT\ macro||package and is
 11 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
 12 %C details.
 13 
 14 % At some point I will reconsider the \starttext .. \stoptext
 15 % wraping as we can assume proper styling. It's a left-over from
 
 argument ...cument.showmathfont(font.current())}
   
 \firstoftwoarguments #1#2-#1
  
 \doshowmathfontcharacters ...wmathfontcharacters }
   \endgroup 
 to be read again 
\finishjob 
 l.5 \finishjob
   
 }   context.finishjob()
   
 ...
 l.86 \stopluacode
 
 
 I do not realy care about this list, I was just currious and it did not work 
 so I point it out.
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 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] MKII MKIV difference between \textrule

2012-09-14 Thread Alessandro Perucchi

On 14 Sep 2012, at 13:26, Wolfgang Schuster wolfgang.schus...@gmail.com wrote:

 
 Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi alessan...@perucchi.org:
 
 Hello,
 
 In my experimentation, I've found that in mkii and mkiv the behavior of 
 \textrule and \setuptextrule are different...
 
 What I did was quite simple:
 
 \textrule{Testing head}
 blah blah blah
 \textrule
 
 in mkii the text in well centered between the lines.
 But in mkiv the bottom line is too near the text, and I need to add 
 something like \blank[halfline] to have a similar behavior as mkii.
 
 There is a vertical skip missing in the MkIV version of the macros.
 
 pack-mrl.mkiv
 
 \def\pack_textrule_following#1%
  {\doifelsenothing{#1}
 -{\nointerlineskip
 +
 {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth\strutdp\else\ifdim\prevdepth\zeropoint-\prevdepth\fi\fi\relax
 + \nointerlineskip
  \dontleavehmode\vbox
{\color[\directtextrulesparameter\c!rulecolor]
   
 {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
 {\pack_textrule_with_text{#1}}%
   \ifvmode
 \prevdepth\zeropoint
   \fi}


I've tried to patch pack-mrl.mkiv and I still get the error of spacing before 
the second \textrule.

My version of context is

mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file: 
/Users/ptitvert/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2012.09.11 20:36


 
 And apparently the command \starttextrule ... \stoptextrule doesn't work 
 (this was explain in the cont-entp.pdf page 204) in either mkii  mliv.
 
 This does work for me:
 
 \starttext
 
 blah blah blah
 
 \starttextrule{Testing head}
 blah blah blah
 \stoptextrule
 
 blah blah blah
 
 \stoptext

But 

\starttext

blah blah blah

\starttextrule[top]{Testing head}
blah blah blah
\stoptextrule

blah blah blah

\stoptext

doesn't, and this possibility is explain in the doc, but apparently it doesn't 
work.
So either the doc is wrong, the command is wrong or I'm doing something wrong 
:-D

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

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] Strange bug with reversed itemize

2012-09-14 Thread Aditya Mahajan

On Fri, 14 Sep 2012, Wolfgang Schuster wrote:



Am 14.09.2012 um 00:36 schrieb Aditya Mahajan adit...@umich.edu:


I have been able to isolate the bug to the update on 2012.07.09; specifically 
to this commit.

http://repo.or.cz/w/context.git/blobdiff/6f124794f7dc253f8b83f2517c26ce17e50d66ff..refs/heads/origin:/tex/context/base/strc-num.mkiv

If I replace the current version of strc-num.mkiv with the version from 
2012.07.09:
http://repo.or.cz/w/context.git/blob_plain/6f124794f7dc253f8b83f2517c26ce17e50d66ff:/tex/context/base/strc-num.mkiv

then the numbering is correct.

However, I cannot figure out what is causing the bug in that change.


Part of the problem is this code block:

\def\strc_counters_check_setup#1% does it have to happen here?
 {% this can be done at the lua end / a bit messy here ... todo ...
  \ifcsname\??counter#1\c!number\endcsname
   \doifelsevalue   {\??counter#1\c!number}{#1} 
{\letbeundefined{\??counter#1\c!number}}%
  {\doifvaluenothing{\??counter#1\c!number} 
{\letbeundefined{\??counter#1\c!number}}}%
  \fi
  \ifcsname\??counter#1\c!number\endcsname
% it's a clone
  \else
\edef\currentcounterlevel{\thenamedcounterlevel{#1}}%
\edef\p_start{\counterparameter{#1}\c!start}%

\ctxcommand{checkcountersetup(#1,\currentcounterlevel,\ifx\p_start\empty0\else\number\p_start\fi,\counterparameter{#1}\c!state)}%
  \fi}

ConTeXt uses \p_start to store the current value of the start parameter.
When you set now a value for start in \setuppagenumber the value is kept
in \p_start (because there are no groups). When you start now the itemize
environment the same code is loaded and the start parameter (which hasn’t
been set yet) expands to a very stupid default value which is by another
helper function.

\def\strc_counter_setup_using_parameter#1#2% name \someparameter
 {\edef\p_start{#2\c!start}%
  \setupcounter
[#1]
[  \c!start=\ifx\p_start\empty0\else\number\p_start\fi,
  ...
  \c!numbersegments=#2\c!numbersegments]}


As you can see here the start parameter expands to \p_start when it isn’t empty
what is the case here and because of this you get a wrong value for the item 
numbers.


Thanks for the diagnosis. What will be a good way to fix this? I think 
that


\expanded{\setupcounter[#1][\c!start=\ifx\p_start\empty0\else\number\p_start\fi.,...]}

should work (but I haven't tested it yet).

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
___

Re: [NTG-context] MKII MKIV difference between \textrule

2012-09-14 Thread luigi scarso
On Fri, Sep 14, 2012 at 11:50 PM, Alessandro Perucchi 
alessan...@perucchi.org wrote:


 On 14 Sep 2012, at 13:26, Wolfgang Schuster wolfgang.schus...@gmail.com
 wrote:

 
  Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi 
 alessan...@perucchi.org:
 
  Hello,
 
  In my experimentation, I've found that in mkii and mkiv the behavior of
 \textrule and \setuptextrule are different...
 
  What I did was quite simple:
 
  \textrule{Testing head}
  blah blah blah
  \textrule
 
  in mkii the text in well centered between the lines.
  But in mkiv the bottom line is too near the text, and I need to add
 something like \blank[halfline] to have a similar behavior as mkii.
 
  There is a vertical skip missing in the MkIV version of the macros.
 
  pack-mrl.mkiv
 
  \def\pack_textrule_following#1%
   {\doifelsenothing{#1}
  -{\nointerlineskip
  +
  
 {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth\strutdp\else\ifdim\prevdepth\zeropoint-\prevdepth\fi\fi\relax
  + \nointerlineskip
   \dontleavehmode\vbox
 {\color[\directtextrulesparameter\c!rulecolor]
 
 {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
  {\pack_textrule_with_text{#1}}%
\ifvmode
  \prevdepth\zeropoint
\fi}


 I've tried to patch pack-mrl.mkiv and I still get the error of spacing
 before the second \textrule.

 have you regenerated the format ?

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

Re: [NTG-context] Change color of EPS file.

2012-09-14 Thread Troy Henderson
I put together this little utility for converting a color EPS/PDF/SVG to
grayscale.

http://www.tlhiv.org/grayscale/

Selecting invert swaps colors from white to black and black to white.
So, using a black/white graphic on a transparent background should
transform it to a white/black graphic on a transparent background.

Testing is certainly necessary.

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

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] ntg-context Digest, Vol 99, Issue 40

2012-09-14 Thread Troy Henderson
I put together this little utility for converting a color EPS/PDF/SVG to
grayscale.

http://www.tlhiv.org/grayscale/

Selecting invert swaps colors from white to black and black to white.
So, using a black/white graphic on a transparent background should
transform it to a white/black graphic on a transparent background.

Testing is certainly necessary.

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

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] Change color of EPS file.

2012-09-14 Thread Aditya Mahajan

On Fri, 14 Sep 2012, Troy Henderson wrote:


I put together this little utility for converting a color EPS/PDF/SVG to
grayscale.

http://www.tlhiv.org/grayscale/

Selecting invert swaps colors from white to black and black to white.
So, using a black/white graphic on a transparent background should
transform it to a white/black graphic on a transparent background.

Testing is certainly necessary.


Interesting. At some stage I might revive the webfilter branch of the 
filler module so that such services can be accessed from within ConTeXt.


See the following post for details: 
http://randomdeterminism.wordpress.com/2010/08/12/using-filters-outside-the-box/


In case anyone is interested, this blog post was talking about code 
available at


https://raw.github.com/adityam/filter/web/t-filter.tex
https://raw.github.com/adityam/filter/web/t-filter.lua

At some stage I decided to delete these features from the filter module 
and move it to a separate module. The code is available at


https://github.com/adityam/context-webfilter

but I haven't used it for about 2 years, and given all the changes in the 
internal namespace, I doubt it will run without modifications. 
Nonetheless, the idea is that a user can use such services using:


\definewebfilter[grayscaleimage]
[prefix={http://www.tlhiv.org/grayscale},
 method=POST,
 ... some other options 
]

and then use

\grayscaleimage{local-image.eps}

This will call the web-service and cache the result.

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
___


Re: [NTG-context] Change color of EPS file.

2012-09-14 Thread Troy Henderson
For those that care, here is basically how the service works.  The filter
is applied to an SVG, and the uploaded graphic is converted to SVG using
the following process:

EPS - PDF - SVG
PDF - SVG
SVG - PDF - SVG

where the EPS - PDF conversion is done with the standard `epstopdf`
included with TeX.  The PDF - SVG conversion is done with `pdf2svg` which
is available from

http://www.cityinthesky.co.uk/opensource/pdf2svg

and which uses Cairo and Poppler for its conversion.  Now in order for my
simplistic filter to function, all SVG's must essentially look alike
(i.e., come from the same source).  Therefore, uploaded SVG's are converted
to PDF (using Inkscape) and then back to SVG (using `pdf2svg`).  The filter
then works with the resulting SVG and converts it back to the uploaded
format using Inkscape.

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

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] Change color of EPS file.

2012-09-14 Thread luigi scarso
On Sat, Sep 15, 2012 at 1:23 AM, Troy Henderson thend...@gmail.com wrote:


 and which uses Cairo and Poppler for its conversion.  Now in order for my
 simplistic filter to function,

Why 'simplistic' and not 'simple'  ?
I always thought that its meaning is negative (something like 
'simplistic' is a bad imitation of 'simple' )
-- 
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___