What is the unit "nc" supposed to be?
New Cicero or what? Please consider the following: This is luaTeX, Version 3.141592-snapshot-2007040210 (Web2C 7.5.6) **\dimen0=1nc *\showthe\dimen0
12.80373pt. <*> \showthe\dimen0
? *\dimen0=0.99998nc *\showthe\dimen0
-0.09723pt. <*> \showthe\dimen0
? * This does not cut it at all. The section in tex.web starts with @ The necessary conversion factors can all be specified exactly as fractions whose numerator and denominator are 32768 or less. In LuaTeX, the section brazenly starts with @ The necessary conversion factors can all be specified exactly as fractions whose numerator and denominator are 65535 or less. Who does things like that without actually checking that they work? It is possible to rework the arithmetic to get along with 65535, but it is certainly not a matter of merely changing the _documentation_ and not the code. I have no idea whether this is an eTeX, a PDFTeX, an Aleph or a LuaTeX invention (did I forget anything?), but it certainly can't stay like that. Sorry if I sound like a whiner here. If you think it worth the trouble, I can rework the arithmetic (but there is a reason that Knuth kept to 15 bit factors, so it is going to become more complicated). But I consider it more likely that nc should be changed to 1370:107 which is the closest 15 bit fraction to 12nd (it is smaller than 12nd, but the next larger suitable fraction 32163:2512 is slightly further from 12nd). Please remember that in TeX, 2in is not equal to 1in+1in anyway. I think we can afford this. Certainly better than the current behavior. -- David Kastrup
2007/4/3, David Kastrup
New Cicero or what?
From the pdftex NEWS for 1.30:
- pdftex knows two new units: - new Didot (1nd=0.375mm) - new Cicero (1nc=12nd) But it's broken in pdftex as well. :-(
Who does things like that without actually checking that they work? It is possible to rework the arithmetic to get along with 65535, but it is certainly not a matter of merely changing the _documentation_ and not the code.
Me. I got a patch and didn't check it. :-( Best Martin
Taco Hoekwater
David Kastrup wrote:
New Cicero or what?
That was the idea, I believe.
It is a pdftex patch submitted a few months back, discussion redirected to the ntg-pdftex mailing list.
There is one thing to be said for change files: they make it easier assigning the blame. But a version control history should be able to do the same. At least if every applied change file is a separate checkin... I keep getting sidetracked from what I am actually trying to do. -- David Kastrup
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic. Taco
Taco Hoekwater
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Well, but I would find a change rendering "1in"="72.27pt" attractive. I'll propose one shortly. Anyway, those fractions carry _way_ more precision than TeX's general arithmetic anyway, and TeX's truncation (which this was all about in the first place) introduces more bias than this particular fraction does. One could argue that 32163:2512 will be a nicer fraction since it overshoots, and TeX forgets to round the final result, so we err on different sides. But I'd rather have the closest ratio and fix TeX's, excuse me (hopefully Knuth didn't hear), LuaTeX's arithmetic on units by letting it round properly. -- David Kastrup
David Kastrup wrote:
Taco Hoekwater
writes: David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Well, but I would find a change rendering "1in"="72.27pt" attractive. I'll propose one shortly. Anyway, those fractions carry _way_ more precision than TeX's general arithmetic anyway, and TeX's truncation (which this was all about in the first place) introduces more bias than this particular fraction does. One could argue that 32163:2512 will be a nicer fraction since it overshoots, and TeX forgets to round the final result, so we err on different sides.
But I'd rather have the closest ratio and fix TeX's, excuse me (hopefully Knuth didn't hear), LuaTeX's arithmetic on units by letting it round properly.
this is not going to happen soon, maybe a different 'rounding' some day; while developing we need to be able to compare pdftex output with luatex output/processing and implementing a different rounding model is not convenient at this time nobody bothered about that for 25 years so we're not in a great hurry there -) 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 -----------------------------------------------------------------
Taco Hoekwater
David Kastrup wrote:
But I consider it more likely that nc should be changed to 1370:107
And also, I applied this change to luatex.web (and fixed the documentation sting back). TeX's conversions are approximations anyway, I see little point in changing the conversion arithmetic.
Unfortunately, Knuth is a practical joker. The old documentation string, while sounding reassuring, is actually also wrong. With the code he has written there, the requirement is that the _sum_ of num and denum does not exceed 32768. Which happens to be the case for his ratios, but not for _either_ of the new ones. Check the following: This is luaTeX, Version 3.141592-snapshot-2007040210 (Web2C 7.5.6) **\relax *\dimen0=9.9998nd *\showthe\dimen0
7.44438pt. <*> \showthe\dimen0
? *\dimen0=10nd *\showthe\dimen0
10.66977pt. <*> \showthe\dimen0
? * So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the closest usable ratio which is 11183:10481. So it looks like neither the new cicero nor the new didot have a chance to be represented exactly. Too bad. I am still being sidetracked from what I really wanted to look at. Does anybody actually _use_ those new dimensions? -- David Kastrup
David Kastrup wrote:
So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the
I picked that choice for luatex. People would be awfully confused if 12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage). Taco
2007/4/3, Taco Hoekwater
12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
The bug has been in the wild since 2005-08-01, so I agree: Nobody uses them. Not even the author of the patch. :-{ Best Martin
"Martin Schröder"
2007/4/3, Taco Hoekwater
: 12pt!=12pc, so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
The bug has been in the wild since 2005-08-01, so I agree: Nobody uses them. Not even the author of the patch. :-{
Well, at least not with large numbers behind the decimal point. The nc is rather easy to break with those (0.6nc does the trick), but you have to cherry-pick values for breaking nd (9.99998nd is the smallest value of form x.99998nd that actually breaks). So it is possible that the author uses nd, and possibly multiples of 0.5nc without seeing the problem. -- David Kastrup
Taco Hoekwater
David Kastrup wrote:
So I recommend that you change the ratio of nd either to 1370:1284 (which reinstates the 12nd=1nc relation), or better change it to the
I picked that choice for luatex. People would be awfully confused if 12pt!=12pc,
I'd be confused it it were...
so I suspect the same is true for nds and ncs (assuming anyone actually uses these units, which is doubtful at this stage).
I'd probably prefer the more exact value 11183:10481. Both nc and nd don't exist in the wild, they are only abstract ratios inside of TeX. If people specify a value in the smaller unit nc, they presumably want to have it heeded as well as possible. But since those values differ only in the seventh place, the five-digit precision of TeX's "scaled" values will probably make that difference irrelevant for most applications. Your choice makes x nd equivalent to 12*x nc, where x is a "scaled" 15.16 fixed point number from TeX. I have the sneaking suspicion that Knuth might have known about these units and decided not to put them into TeX since they did not have convenient exact ratios like the others. -- David Kastrup
participants (4)
-
David Kastrup
-
Hans Hagen
-
Martin Schröder
-
Taco Hoekwater