where is dvipos? dvipos fails using TL2006 test tree
What is the standard way to get dvipos? It's used by texexec in dvi mode, to find the location of figures. I guess it can eventually go away now that pdftex's \pdfsavepos works even in dvi mode (from v1.40.0). But for the moment it's still needed. It's neither in texlive2006 (except for win32) nor in the Debian or Ubuntu tex-related packages, but I think it needs to be in both. There's source here: http://cvs.sarovar.org/cgi-bin/cvsweb.cgi/texlive/Build/source/texk/dvipos/ I think the version I built and use -- Version 20030628 (KPATHSEA) -- is from here http://cvs.ktug.or.kr/viewcvs/dvipos/. Actually I found the one I use, and I've attached it. That version doesn't work well on one document I just tried (see recent msg to ntg-context). It outputs correct information, but the coordinates are in sp (scaled points) with no unit marker, and context expects them in pt (see NASA's Mars lander that crashed into Mars due to a unit disagreement). That was with context 2007.01.02 in Norbert's debian packages. If I try it with the texlive2006 test tree, then it fails with ** Fatal: Unable to find TFM file 'ec-lmtt10' Although the TFM is in the TL tree: $ kpsewhich ec-lmtt10.tfm /home/sanjoy/admin/tex/texlive/image/texlive/texmf-dist/fonts/tfm/public/lm/ec-lmtt10.tfm Unfortunately, dvipos doesn't have a kpathsea-debug switch, so I don't know what lookups it's doing. I can guess, using strace, that it's using the TEXFONTMAPS path to search for the tfm file, but I'm not sure. Or that it's looking for texfonts.map but isn't finding it, which is confusing it in searching for the tfm file? If anyone wants the dvi file to test, I can send it to you offlist. Actually, no need, because you can see the same problem by making a dvi file from \starttext a \stoptext Then, with (ba)sh syntax: texexec --dvi --nobackend a.tex TLROOT=~/admin/tex/texlive/image/texlive TEXMFCNF=$TLROOT/texmf/web2c /usr/local/bin/dvipos a.dvi Here is the "strace -e trace=open,access dvipos notes.dvi" after I replaced the long texlive root with @TLROOT@ access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libm.so.6", O_RDONLY) = 3 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/usr/lib/libkpathsea.so.4", O_RDONLY) = 3 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3 open("notes.dvi", O_RDONLY) = 3 open("/usr/local/bin/dvipos", O_RDONLY) = 4 access("@TLROOT@/texmf/web2c/texmf.cnf", R_OK) = 0 open("@TLROOT@/texmf/web2c/texmf.cnf", O_RDONLY) = 4 access("./texfonts.map", R_OK) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/map/dvipos/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/map/dvipos/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/map/dvipos/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/map/pdftex/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/map/pdftex/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/map/pdftex/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/map/dvips/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/map/dvips/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/map/dvips/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/map/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/map/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/map/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.tfm", R_OK) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/tfm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/tfm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/tfm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.ofm", R_OK) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.tfm", R_OK) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-config/fonts/ofm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/.texlive2006/texmf-var/fonts/ofm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) open("/home/sanjoy/texmf/fonts/ofm/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.ofm", R_OK) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.tfm", R_OK) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.tfm", R_OK) = -1 ENOENT (No such file or directory) access("./ec-lmtt10.tfm", R_OK) = -1 ENOENT (No such file or directory) ** Fatal: Unable to find TFM file 'ec-lmtt10'. Process 16521 detached -Sanjoy `A nation of slaves is always prepared to applaud the clemency of their master who, in the abuse of absolute power, does not proceed to the last extremes of injustice and oppression.' (Gibbon)
Sanjoy Mahajan wrote:
Unfortunately, dvipos doesn't have a kpathsea-debug switch, so I don't know what lookups it's doing. I can guess, using strace, that it's using the TEXFONTMAPS path to search for the tfm file, but I'm not sure.
This should work $ env KPATHSEA_DEBUG=-1 dvipos notes.dvi Best, Taco
$ env KPATHSEA_DEBUG=-1 dvipos notes.dvi
Thanks; you can teach an old dog new tricks (which now I see is documented in the kpathsea manual). With sh/bash you can drop the 'env': $ KPATHSEA_DEBUG=-1 dvipos notes.dvi The debug output helped me figure out the problem: $SELFAUTOPARENT yukness. dvipos is in /usr/local/bin/dvipos, so SELFAUTOPARENT is /usr, and everything is being searched for in /usr/texmf, /usr/texmf-dist, etc, instead of in $tlroot/texmf{,-dist} etc. For binaries in TL, it all works since they live in $tlroot/bin/i386-linux/, so their $SELFAUTOPARENT is $tlroot/. I checked this analysis by putting a copy of dvipos in /tmp/x/y/ and symlinking /tmp/texmf* to $tlroot/texmf*. Then I ran /tmp/x/y/dvipos notes.dvi (using TL's texmf.cnf), and it worked identically to using dvipos with my regular tex installation (Debian/Ubuntu texlive). So dvipos belongs in TL and in the Debian packages, or else ConTeXt will crash when it makes dvi files with figures. Also, as I mentioned in another email (I think to ntg-context), ConTeXt needs to parse dvipos's scaled-points output. But that change is not specific to TL. Or dvipos should be changed to produce coordinates in pt (and label them). However, that change may break other users (are there any?) of dvipos. -Sanjoy `Not all those who wander are lost.' (J.R.R. Tolkien)
Sanjoy Mahajan wrote:
So dvipos belongs in TL and in the Debian packages, or else ConTeXt will crash when it makes dvi files with figures.
positions to be more precise ... i still need to adapt context to support the now available pos in pdftex dvi mode but even then i need to make surethat xetex works too ... i'll look into it (probably not before the tex collection is frozen);
Also, as I mentioned in another email (I think to ntg-context), ConTeXt needs to parse dvipos's scaled-points output. But that change is not specific to TL. Or dvipos should be changed to produce coordinates in pt (and label them). However, that change may break other users (are there any?) of dvipos.
well, a solution could be to add a switch --unit= ; maybe taco can make a patch; normally Choff is very responsive to such things; an alternative is that i adapt the dvi driver part a bit (no time now, maybe later) ; i adapted this stuff a bit when i made the mkiv code (which permits me to keep track of milions of positions with hardy any overhead -- also, much aux file stuff is already moved to lua tables then) 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 -----------------------------------------------------------------
Hans Hagen wrote:
Sanjoy Mahajan wrote:
So dvipos belongs in TL and in the Debian packages, or else ConTeXt will crash when it makes dvi files with figures.
positions to be more precise ... i still need to adapt context to support the now available pos in pdftex dvi mode but even then i need to make surethat xetex works too ...
Does anything besides ConTeXt use dvipos? If not, then Sanjoys patch that simply adds "sp" after each number seems fine to me. Extremely simple fix, so the bug-risk is very low. Taco
Does anything besides ConTeXt use dvipos?
Googling for the specials that dvipos parses, such as pos:pxywhd, produces one hit and it's on the ntg-context list. So it's a safe bet that ConTeXt is the only user.
If not, then Sanjoys patch that simply adds "sp" after each number seems fine to me.
It's necessary but not sufficient, since dvipos still won't be able to
parse the specials that (Con)TeX(t) writes because those are in pt, and
have 'pt' appended. Therefore the second patch that I sent is also
needed. It's not perfect since it doesn't fix sscanfing 'list' in
dvicore.c:do_pos_special().
But I just figured out what list's format should be and what to do about
it. Assuming again that ConTeXt is the only user of those specials, the
relevant code is from core-pos.tex (line 525ff):
\def\doregisterparoptions
{\doglobal\increment\parposcounter
\begingroup
\leftskip 1\leftskip
\rightskip1\rightskip
\setpositiondataplus
{p:\parposcounter}% % identifier
{\the\zeropoint}%
{\the\strutht}%
{\the\strutdp}%
{\the\hsize ,% 1
\the\leftskip ,% 2
\the\rightskip ,% 3
\the\hangindent,% 4
\the\hangafter ,% 5 (num)
\the\parindent }% 6
%\normalhbox{\registerparsymbol}%
\registerparsymbol
\endgroup}
If list needs to be extracted from the pos:pxyplus special, which is the
only one that uses it, its format will be like:
469.75499pt,0.0pt,0.0pt,0.0pt,1,20.0pt
That string needs %fpt,%fpt,%fpt,%fpt,%ld,%fpt as its scanf format.
do_pos_special() instead sscanf's list as %ld, which will pick up just
the 469. So here is the third patch (and the dvicore.c with all three
patches is attached).
I tested the result and it still works with pos:pxywhd, and I compiled
it with -Wformat=2 just to make sure I hadn't screwed up a sscanf or
fprintf format string. But I don't have a dvi file that uses
pos:pxyplus, so I can't test the new code path.
Hans,
Could you make a minimal .tex file that would use pos:pxyplus?
-Sanjoy
`A nation of slaves is always prepared to applaud the clemency of their
master who, in the abuse of absolute power, does not proceed to the
last extremes of injustice and oppression.' (Gibbon)
changeset: 3:36f5c3fd455c
tag: tip
user: Sanjoy Mahajan
Here's the latest dvipos including a new manpage. Choose your poison: zip and tgz formats attached. "make && make install install-man" if you want to install the man page too. -Sanjoy `A nation of slaves is always prepared to applaud the clemency of their master who, in the abuse of absolute power, does not proceed to the last extremes of injustice and oppression.' (Gibbon)
Hi, I hope Karl or Norbert can take care of adding this to TL. I am home sick (flu, nothing serious, but I do not have a texlive source tree here). Taco Sanjoy Mahajan wrote:
Here's the latest dvipos including a new manpage. Choose your poison: zip and tgz formats attached. "make && make install install-man" if you want to install the man page too.
-Sanjoy
`A nation of slaves is always prepared to applaud the clemency of their master who, in the abuse of absolute power, does not proceed to the last extremes of injustice and oppression.' (Gibbon)
participants (3)
-
Hans Hagen
-
Sanjoy Mahajan
-
Taco Hoekwater