Re: [NTG-context] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Alan BRASLAU
On Thu, 18 Oct 2012 00:20:01 +0200
Romain Diss romain.d...@yahoo.fr wrote:

 Le mercredi 17 octobre 2012, Alan BRASLAU a écrit :
  Furiously, breaking many old curiosities,
  fixing broken and incomplete functionality,
  AND completely re-writing the documentation!
  (Not that I really know much about chemistry myself... :)
 Since you talk about chemistry, is there now a way to type correctly
 isotopes (without any hacks). Actually \chemistry{^{238}_{92}U} do
 align '92' to the left. It should be aligned to the right.
 
 Thank you.
 (Maybe I should have open a new thread...)
 

Hum, I work all the time with $^3$He and $^4$He,
but somehow I never thought of this as chemistry...

I'll look into fixing \chemistry{^{32}_{15}P} (another one of my
occupations), and Hans will then put it into the beta.

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] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Hans Hagen

On 18-10-2012 00:20, Romain Diss wrote:

Le mercredi 17 octobre 2012, Alan BRASLAU a écrit :

Furiously, breaking many old curiosities,
fixing broken and incomplete functionality,
AND completely re-writing the documentation!
(Not that I really know much about chemistry myself... :)

Since you talk about chemistry, is there now a way to type correctly isotopes
(without any hacks). Actually \chemistry{^{238}_{92}U} do align '92' to the
left. It should be aligned to the right.


It's on the agenda for luatex: prescripts.

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
___


Re: [NTG-context] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Alan BRASLAU
On Thu, 18 Oct 2012 10:41:00 +0200
Sietse Brouwer sbbrou...@gmail.com wrote:

 Alpha particles are \lohi[left]{40}{2}He.

Alpha particles are He\high{2+} (helium nucleus)
not to be confused with He\low{2} (helium molecules)
that DO exist but are unstable and only last 13 seconds or so.

Someone needs to fix the wiki... (done!)

\lohi[left]{}{4}He is a boson; \lohi[left]{}{3} is a fermion.

By the way, \lohi[left]{2}{4}He is somewhat a tautology, like all such
isotopic nomenclature, as He ALWAYS has an atomic number of 2,
otherwise it is not He (and U ALWAYS has an atomic number of 92,
otherwise it is no longer U).

Alan

-- 
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:alan.bras...@cea.fr
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Romain Diss
Le jeudi 18 octobre 2012, Sietse Brouwer a écrit :
 What about \lohi with the [left] key? That might serve your needs until
 Alan gets \chemistry to parse and typeset isotopes correctly.
Yes there are some hacks to typeset isotopes correctly, but I think it would 
be better to be able to typeset it in a simple way with \chemistry.

-- 
Romain Diss
romain.d...@yahoo.fr
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Romain Diss
Le jeudi 18 octobre 2012, Alan BRASLAU a écrit :
 By the way, \lohi[left]{2}{4}He is somewhat a tautology, like all such
 isotopic nomenclature, as He ALWAYS has an atomic number of 2,
 otherwise it is not He (and U ALWAYS has an atomic number of 92,
 otherwise it is no longer U).
Sure but but the format is nevertheless usefull in some cases:
- exercises like: what is the chemical symbol of the \lohi[left]{2}{4}X 
atom?
- nuclear reactions where Z are usefull to balance the equations (see 
http://en.wikipedia.org/wiki/Nuclear_reaction for exemples). Of course if one 
know every Z and atomic symbol associated by heart, the nomenclature with Z is 
not needed.

-- 
Romain Diss
romain.d...@yahoo.fr
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ConTeXt unofficial test suite stub (chemistry)

2012-10-18 Thread Sietse Brouwer
Sietse wrote:
 Alpha particles are \lohi[left]{40}{2}He.

Alain wrote:
 Someone needs to fix the wiki... (done!)

[Alain fixed the wiki to Alpha particles are \lohi[left]{4}{2}He\high{2+}.]

But, but, but ... that doesn't demonstrate the fact that the elements
right-align instead of left-align! I've changed it again:

One stable isotope of tantalum is \lohi[left]{73}{180m}Ta.

(This is my own fault: I deliberately added the extra 0 in
\lohi[left]{40}{2}He, a long time ago, because I cared more about
illustrativeness than truth. And because I was too lazy to look up a
more suitable isotope. I am a bad person, and it is good that people
like Alain exist to keep people like me in line. :-P)

--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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto
Aditya Mahajan adit...@umich.edu writes:

 It may be worthwhile to merge the two repos.

I'm on my way. I'll keep you posted.


-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread luigi scarso
On Wed, Oct 17, 2012 at 8:44 AM, Marco Pessotto melmo...@gmail.com wrote:

 Aditya Mahajan adit...@umich.edu writes:

  It may be worthwhile to merge the two repos.

 I'm on my way. I'll keep you posted.


 Can you use graphicsmagick ?


-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Patzer
  A week ago I had a conversation with mpfusion and another user over IRC
  about the ConTeXt test suite. mpfusion had a tarball with some test and
  an elaborate machinery to see if the testfiles compile. He kindly
  provided the tarball,

That's me, by the way.

 and I took the liberty to do it my way (I didn't
  hear back from him, I assume he's working on his solution), using the
  testfiles and rewriting the code.

I cleaned up the code and rewrote some part of it. But it's in a
stage where it does not compile. At the moment I'm quite busy and
don't have time to work on that, that's why I didn't publish, yet.


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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto
luigi scarso luigi.sca...@gmail.com writes:

 On Wed, Oct 17, 2012 at 8:44 AM, Marco Pessotto melmo...@gmail.com wrote:

 Aditya Mahajan adit...@umich.edu writes:

  It may be worthwhile to merge the two repos.

 I'm on my way. I'll keep you posted.

 Can you use graphicsmagick ?

So far I've used imagemagick. I guess that it shouldn't be a problem to
replace it with its fork, if it offers the same features. I've never
used graphicsmagick. Can we expect better performances?

-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread luigi scarso
On Wed, Oct 17, 2012 at 9:27 AM, Marco Pessotto melmo...@gmail.com wrote:

 luigi scarso luigi.sca...@gmail.com writes:

  On Wed, Oct 17, 2012 at 8:44 AM, Marco Pessotto melmo...@gmail.com
 wrote:
 
  Aditya Mahajan adit...@umich.edu writes:
 
   It may be worthwhile to merge the two repos.
 
  I'm on my way. I'll keep you posted.
 
  Can you use graphicsmagick ?

 So far I've used imagemagick. I guess that it shouldn't be a problem to
 replace it with its fork, if it offers the same features. I've never
 used graphicsmagick. Can we expect better performances?

It's not a huge difference, but it can integrated better with mkiv; see
http://meeting.contextgarden.net/2011/talks/day1_05_luigi_graphicmagick/
(if you like these kind of things)

-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto
luigi scarso luigi.sca...@gmail.com writes:

 It's not a huge difference, but it can integrated better with mkiv; see
 http://meeting.contextgarden.net/2011/talks/day1_05_luigi_graphicmagick/
 (if you like these kind of things)

I think I'll have to run some benchmark to see if it can save some
resources and speed up the testing. I don't care too much for the mkiv
integration. The other Marco's idea was exactly to make conTeXt run the
tests. I prefer to let ConTeXt do the typesetting and do the dirty stuff
with perl.

So far I've included the testfiles from contexttest, parking the failing
ones in a dedicated directory. There are 62 files now, and the test
takes 13 minutes to run on my humble machine.

These are the results for version 2012.10.16 23:38 against TeXlive2012:

|   File name | Success |  Differs Avg  |  Worst value  | Pages | Time |
|  arrows-001 |  OK |  6.105634 |  6.105634 | 1 |5 |
|catcodes-001 |  OK |  50.219512|  50.219512| 1 |3 |
|  columnsets-001 |  OK |  0.00 |  0.00 |10 |7 |
|core-des-001 |  OK |  0.324862 |  0.658451 |23 |9 |
|core-des-002 |  OK |  1.527666 |  2.651408 | 7 |8 |
|core-itm-001 |  OK |  11.947183|  13.753521| 5 |5 |
|core-mat-001 |  OK |  0.070423 |  0.070423 | 1 |5 |
|core-mat-002 |  OK |  0.00 |  0.00 | 1 |5 |
|core-mat-003 |  OK |  1.788732 |  1.788732 | 1 |5 |
|core-mat-004 |  OK |  0.00 |  0.00 | 2 |5 |
|core-mat-005 |  OK |  0.00 |  0.00 | 1 |3 |
|core-rul-001 |  OK |  0.151408 |  0.151408 | 1 |4 |
|core-sec-001 |  OK |  0.00 |  0.00 | 1 |3 |
|core-ver-001 |  OK |  0.00 |  0.00 | 1 |4 |
|core-ver-002 |  OK |  0.00 |  0.00 | 1 |4 |
|core-ver-003 |  OK |  0.131162 |  0.524648 | 4 |5 |
|core-ver-004 |  OK |  0.00 |  0.00 | 1 |4 |
|core-ver-005 |  OK |  0.00 |  0.00 | 1 |4 |
|core-ver-007 |  OK |  0.00 |  0.00 | 1 |4 |
|date-002 |  OK |  0.00 |  0.00 | 1 |3 |
|   dates-001 |  OK |  3.880282 |  3.880282 | 1 |4 |
|   dates-002 |  OK |  0.359155 |  0.359155 | 1 |4 |
|enco-pfr-001 |  OK |  0.095070 |  0.095070 | 1 |4 |
|  floats-001 |  OK |  31.651408|  31.651408| 1 |4 |
|  floats-002 |  OK |  31.651408|  31.651408| 1 |5 |
| hsv-001 |  OK |  0.00 |  0.00 | 8 |   14 |
|   inclusion |  OK |  0.00 |  0.00 | 1 |4 |
|math-pln-001 |  OK |  0.049296 |  0.049296 | 1 |4 |
|meta-ini-001 |  OK |  0.00 |  0.00 | 2 |4 |
|metapost-001 |  OK |  0.00 |  0.00 | 1 |4 |
|metapost-002 |  OK |  0.00 |  0.00 | 1 |3 |
|   mixed-001 |  OK |  21.327465|  37.492958| 2 |4 |
|   narrower-bidi-001 |  OK |  0.00 |  0.00 | 4 |4 |
|page-run-001 |  OK |  0.00 |  0.00 | 1 |4 |
|page-txt-001 |  OK |  0.445171 |  0.496479 | 7 |5 |
| ppchtex-001 |  OK |  1.573944 |  1.573944 | 1 |4 |
| ppchtex-005 |  OK |  1.169014 |  1.169014 | 1 |4 |
| ppchtex-006 |  OK |  0.00 |  0.00 | 1 |4 |
|spacing-grid-001 |  OK |  10.443662|  10.531690| 3 |5 |
|spacing-grid-005 |  OK |  11.602993|  14.975352| 8 |9 |
|   spacing-space-001 |  OK |  0.00 |  0.00 | 1 |3 |
|   spacing-space-002 |  OK |  0.00 |  0.00 | 2 |4 |
|   spacing-space-003 |  OK |  0.00 |  0.00 | 1 |4 |
|   spacing-space-004 |  OK |  0.00 |  0.00 | 1 |4 |
|spec-mis-001 |  FAILED |  0.00 |  0.00 | 0 |0 |
|spot-001 |  OK |  0.00 |  0.00 | 1 |4 |
|struc-allkind-tex-001 |  OK |  0.292254|  0.292254 | 1 |5 |
|struc-allkind-xml-001 |  OK |  1.471831|  1.471831 | 1 |6 |
|   struc-itemize-001 |  OK |  0.176056 |  0.176056 | 1 |4 |
|   struc-itemize-002 |  OK |  0.00 |  0.00 | 1 |3 |
|  struc-page-001 |  OK |  6.237676 |  7.066901 | 4 |   14 |
| 

Re: [NTG-context] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto
Marco Patzer home...@lavabit.com writes:

 Looking at the diffs, many of the differences are really tiny, but
 differences exist nevertheless. It will take me some time to sort out
 which ones are just tiny space shifting, and which ones give really
 different output.

 That's why I use a header for each test file. You can specify
 “sensitivity=low|medium|high”, this sets a predefined tolerance for
 the page difference. I don't see any other option. There is no
 single value which is sensitive enough, for instance to detect if a
 footnote is subscripted or not and at the same time tolerant enough
 not to always mark a fifty page document as “failed”.

I'm not sure that exists a “fuzzy” algorithm for the tolerance. From my
testing, a minimal shift, say, to the right, on a full page will
generate a lot of noise, because each glyph will be “doubled”. I'm
generating, with the visual diffs, a script to launch two PDF viewers and
eventually promote the generated to the new reference.

I guess there is no shortcuts to the manual ispection of the diffs.

-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread Hans Hagen

On 17-10-2012 18:57, Marco Pessotto wrote:

Marco Patzer home...@lavabit.com writes:


Looking at the diffs, many of the differences are really tiny, but
differences exist nevertheless. It will take me some time to sort out
which ones are just tiny space shifting, and which ones give really
different output.


That's why I use a header for each test file. You can specify
“sensitivity=low|medium|high”, this sets a predefined tolerance for
the page difference. I don't see any other option. There is no
single value which is sensitive enough, for instance to detect if a
footnote is subscripted or not and at the same time tolerant enough
not to always mark a fifty page document as “failed”.


I'm not sure that exists a “fuzzy” algorithm for the tolerance. From my
testing, a minimal shift, say, to the right, on a full page will
generate a lot of noise, because each glyph will be “doubled”. I'm
generating, with the visual diffs, a script to launch two PDF viewers and
eventually promote the generated to the new reference.

I guess there is no shortcuts to the manual ispection of the diffs.


vertical shifts are probably more an issue; for horizontal shifts you 
can use a threshold of .1em because that catches spaces and distances 
etc but ignores differences in fonts.


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
___

Re: [NTG-context] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto

Ok, this is my first bug report. I noticed that the column width/margin
is quite altered since TL12. There are some other problems, tough.

Full report here:

https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

(It's stored in the commit log).

I also caught some problems which are fixed in the beta, but broken in
TL12.

Hans Hagen writes:

 vertical shifts are probably more an issue; for horizontal shifts you
 can use a threshold of .1em because that catches spaces and distances
 etc but ignores differences in fonts.

I'm comparing pixel by pixel, I don't have any idea how to implement a
sensible treshold system, without writing another TeX engine...

Best wishes.

-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Patzer
2012-10-17 Marco Pessotto:

 Ok, this is my first bug report. I noticed that the column width/margin
 is quite altered since TL12. There are some other problems, tough.
 
 Full report here:
 
 https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2
 
 (It's stored in the commit log).
 
 I also caught some problems which are fixed in the beta, but broken in
 TL12.

I don't know if Hans appreciates a test suite, seems like plenty of
work for him ;)


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] ConTeXt unofficial test suite stub

2012-10-17 Thread Hans Hagen

On 17-10-2012 19:58, Marco Pessotto wrote:


Ok, this is my first bug report. I noticed that the column width/margin
is quite altered since TL12. There are some other problems, tough.

Full report here:

https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

(It's stored in the commit log).

I also caught some problems which are fixed in the beta, but broken in
TL12.

Hans Hagen writes:


vertical shifts are probably more an issue; for horizontal shifts you
can use a threshold of .1em because that catches spaces and distances
etc but ignores differences in fonts.


I'm comparing pixel by pixel, I don't have any idea how to implement a
sensible treshold system, without writing another TeX engine...


Last time I looked into this (quite a while ago) i did something like 
the attached; in there you find:


local command = string.format('gm convert -verbose -density 72 %s 
%s',pdfname,ppmname)


so I used a rather low density and (and then used md5 for comparing)

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 not modules then modules = { } end modules ['mtx-testsuite'] = {
version   = 1.002,
comment   = companion to mtxrun.lua,
author= Hans Hagen, PRAGMA-ADE, Hasselt NL,
copyright = PRAGMA ADE / ConTeXt Development Team,
license   = see context related readme files
}

-- maybe use a list

local helpinfo = [[
--compare compare files (--pattern --newname --oldname --collect)
]]

local application = logs.application {
name = mtx-testsuite,
banner   = Experiments with the testsuite.,
helpinfo = helpinfo,
}

local gmatch, match, gsub, find, lower, format = string.gmatch, string.match, string.gsub, string.find, string.lower, string.format
local concat = table.concat
local split = string.split
local are_equal = table.are_equal
local tonumber = tonumber

local report = application.report

scripts   = scripts   or { }
scripts.testsuite = scripts.testsuite or { }

function scripts.testsuite.compare()
local pattern = environment.argument(pattern)
local oldname = environment.argument(oldname)
local newname = environment.argument(newname)
local collect = environment.argument(collect)
if pattern and newname then
oldname = oldname and file.addsuffix(oldname,lua)
newname = file.addsuffix(newname,lua)
local files = dir.glob(pattern)
local oldhashes = oldname and lfs.isfile(oldname) and dofile(oldname) or { }
local newhashes = {
version = 0.01,
files   = { },
data= os.date(),
}
local old = oldhashes and oldhashes.files or {}
local new = newhashes and newhashes.files or {}
for i=1,#files do
local filename = files[i]
local olddata = old[filename]
if collect then
new[filename] = olddata or { status = collected }
elseif olddata and olddata.status == skip then
new[filename] = olddata
else
local dirname = file.dirname(filename)
local basename = file.basename(filename)
local texname = basename
local pdfname = file.replacesuffix(basename,pdf)
local ppmname = temp.ppm
local workdir = lfs.currentdir()
lfs.chdir(dirname)
os.remove(pdfname)
os.remove(ppmname)
local command = string.format('context --batch %s',texname)
local result = os.execute(command)
if lfs.isfile(texname) then
local command = string.format('gm convert -verbose -density 72 %s %s',pdfname,ppmname)
local result = os.execute(command)
if lfs.isfile(ppmname) then
local newhash = md5.HEX(io.loaddata(ppmname))
local oldhash = olddata and olddata.hash
if not oldhash then
new[filename] = { status = new, hash = newhash }
elseif oldhash == newhash then
new[filename] = { status = unchanged, hash = oldhash }
else
new[filename] = { status = changed, hash = newhash }
end
else
new[filename] = { status = error, comment = processing problem }
end
else
new[filename] = { status = error, comment = conversion problem }
  

Re: [NTG-context] ConTeXt unofficial test suite stub

2012-10-17 Thread Hans Hagen

On 17-10-2012 20:08, Marco Patzer wrote:

2012-10-17 Marco Pessotto:


Ok, this is my first bug report. I noticed that the column width/margin
is quite altered since TL12. There are some other problems, tough.

Full report here:

https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

(It's stored in the commit log).

I also caught some problems which are fixed in the beta, but broken in
TL12.


I don't know if Hans appreciates a test suite, seems like plenty of
work for him ;)


I'm not alone doing this, am I?

It all depends on how serious an issue is. For instance, columns use a 
new mechanism so it might be as simple as changing some defaults.


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
___


Re: [NTG-context] ConTeXt unofficial test suite stub

2012-10-17 Thread Hans Hagen

On 17-10-2012 20:08, Marco Patzer wrote:

2012-10-17 Marco Pessotto:


Ok, this is my first bug report. I noticed that the column width/margin
is quite altered since TL12. There are some other problems, tough.

Full report here:

https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

(It's stored in the commit log).

I also caught some problems which are fixed in the beta, but broken in
TL12.


- i fixed the corner in framed

- \chemical{EQUILIBRIUM}{boven}{onder} is fixed but top/bottom only work 
in formulas


- for footnotes to migrate outside a description one needs to say 
\automigrateinserts (at least till we're sure that it always works ok)




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


Re: [NTG-context] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Pessotto
Hans Hagen pra...@wxs.nl writes:

 On 17-10-2012 20:08, Marco Patzer wrote:
 2012-10-17 Marco Pessotto:

 Ok, this is my first bug report. I noticed that the column width/margin
 is quite altered since TL12. There are some other problems, tough.

 Full report here:

 https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

 (It's stored in the commit log).

 I also caught some problems which are fixed in the beta, but broken in
 TL12.

 I don't know if Hans appreciates a test suite, seems like plenty of
 work for him ;)

 I'm not alone doing this, am I?

 It all depends on how serious an issue is. For instance, columns use a
 new mechanism so it might be as simple as changing some defaults.

Well, there aren't *so many* issues. If the columns are fine with you,
they are fine with me too. Changing the references is not a problem.
(Well, if they keep changing every week, well, that could be a problem
for the well-being of the test suite).

Some things, like the chemical stuff, require someone who actually does
know what they are (I don't).

The whole point of having a test suite is to catch the regressions
before they pile up. I just reported everything I saw.

Best wishes

-- 
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] ConTeXt unofficial test suite stub

2012-10-17 Thread Hans Hagen

On 17-10-2012 21:30, Marco Pessotto wrote:

Hans Hagen pra...@wxs.nl writes:


On 17-10-2012 20:08, Marco Patzer wrote:

2012-10-17 Marco Pessotto:


Ok, this is my first bug report. I noticed that the column width/margin
is quite altered since TL12. There are some other problems, tough.

Full report here:

https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2

(It's stored in the commit log).

I also caught some problems which are fixed in the beta, but broken in
TL12.


I don't know if Hans appreciates a test suite, seems like plenty of
work for him ;)


I'm not alone doing this, am I?

It all depends on how serious an issue is. For instance, columns use a
new mechanism so it might be as simple as changing some defaults.


Well, there aren't *so many* issues. If the columns are fine with you,
they are fine with me too. Changing the references is not a problem.
(Well, if they keep changing every week, well, that could be a problem
for the well-being of the test suite).


Mixed columns probably need some time to become stable (and the width / 
distance should definitely be compatible).



Some things, like the chemical stuff, require someone who actually does
know what they are (I don't).


Alan is currently reviewing the chemical subsystem.


The whole point of having a test suite is to catch the regressions
before they pile up. I just reported everything I saw.


Sure. In principle we should be downard compatible (although mkiv might 
do things better than mkii) and at some point things should stabelize 
again. So, any indication if a substantial change is important.


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
___


Re: [NTG-context] ConTeXt unofficial test suite stub (chemistry)

2012-10-17 Thread Alan BRASLAU
On Wed, 17 Oct 2012 22:52:33 +0200
Hans Hagen pra...@wxs.nl wrote:

 On 17-10-2012 21:30, Marco Pessotto wrote:
 
  Some things, like the chemical stuff, require someone who actually
  does know what they are (I don't).
 
 Alan is currently reviewing the chemical subsystem.

Furiously, breaking many old curiosities,
fixing broken and incomplete functionality,
AND completely re-writing the documentation!

(Not that I really know much about chemistry myself... :)

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] ConTeXt unofficial test suite stub (chemistry)

2012-10-17 Thread Romain Diss
Le mercredi 17 octobre 2012, Alan BRASLAU a écrit :
 Furiously, breaking many old curiosities,
 fixing broken and incomplete functionality,
 AND completely re-writing the documentation!
 (Not that I really know much about chemistry myself... :)
Since you talk about chemistry, is there now a way to type correctly isotopes 
(without any hacks). Actually \chemistry{^{238}_{92}U} do align '92' to the 
left. It should be aligned to the right.

Thank you.
(Maybe I should have open a new thread...)

-- 
Romain Diss
romain.d...@yahoo.fr
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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] ConTeXt unofficial test suite stub

2012-10-16 Thread Aditya Mahajan

On Sun, 7 Oct 2012, Marco Pessotto wrote:



Hello there!

TL;DR: https://github.com/melmothx/context-unofficial-test-suite

A week ago I had a conversation with mpfusion and another user over IRC
about the ConTeXt test suite. mpfusion had a tarball with some test and
an elaborate machinery to see if the testfiles compile. He kindly
provided the tarball, and I took the liberty to do it my way (I didn't
hear back from him, I assume he's working on his solution), using the
testfiles and rewriting the code.

[]

I'd like to know if there is some interest in this thing, as (obviously)
the test suit is not really populated to have any kind of value. There
is also room for improvement (like custom arguments to the compilation).


This is an excellent idea. I am assuming that you are aware of the earlier 
effort:


http://wiki.contextgarden.net/Test

In particular the test repository:

http://foundry.supelec.fr/gf/project/contexttest/scmsvn/

The test repository started around six years ago after discussions at the 
first ConTeXt meeting, but lost momentum after a few years. It does have a 
more extensive set of test cases, and a script to compare PDF files. It 
may be worthwhile to merge the two repos.


Ideally such a test suite should be run periodically on a server and it 
can send an email to a list if one of the tests fails.


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
___