Jean-Marc Lasgouttes a écrit :
Le 16 sept. 08 à 13:12, Michel Lavaud a écrit :
On the other hand, I never noted any problem of incorrect display
with any dvi file I viewed.
While have already witnessed problems like the ones you describe with
PDF, I'll add to be fair that I would
not send a dvi to somebody because:
1/ the fonts are not included (so if the receiving machine ha a
different setup, you may have problems)
2/ the images are not included.
Thanks for raising the point, I agree it's the only one that has to be
signaled to beginners, when using dvi. I raised it also in 2003 at the
RMLL conference about Free Software in Metz. Well, the solution is in
the question : send the required images and fonts together with the dvi
in a zip archive - in the same way as the LyX executable is sent with
its plugins and utility files, in a zip archive (or would you not send
LyX to somebody because the plugins and the utilities are not included
in the exe ? ;-). On Windows platforms, from Windows XP on, there is a
buit-in unzip utility, I think it is also present on most Linux
distribs. To take care of beginner users of older Windows platforms,
caring authors posting dvi on the net could add a pointer to unzip.exe
file with the mention "if you have not the unzip utility, you can
download it freely from this site", in the same way as caring authors
who post pdf files add the mention "If you have not Acrobat reader
installed, you can download it freely from the Adobe site". This could
also be solved even more simply at the level of the dvi viewers if they
were able to use directly zipped archives, but this would require to ask
developers to add this functionality in their viewers.
BTW, this obvious solution of sending the dvi file together with all
its required files in an archive has been used decades ago by Tomas
Rokicki in his dvips software : he includes the images and the fonts
necessary to display the document in the PS output. The only difference
between dvi and ps is that, with ps, no codec is needed, because
PostScript is a programming language, so it is sufficient to concatenate
the additional files as subprograms to the main file.
To compare further dvi and ps : originally, the fonts were not included
in ps files either, as they were available only in the printers
(together with a PS interpreter, in the antique so-called "PostScript
printers"). More generally, I think that criticizing (or praising) the
dvi format, or the ps (or any other format) for not including font
and/or images is a moot point : there are pros and there are cons,
depending on the case one has to deal with.
Actually, I do not think that dvi has ever been advocated as an
interchange document. But the simplicity
of the format indeed means that very few bugs are seen when changing
viewer.
Did you ever see a bug arising from dvi itself, I mean not from
beginners who use unofficial fonts in draft versions, so that the
complete document is unreadable (I've seen that, actually) ? I've seen
also a few bugs in an old version of a dvi viewer (Dview by B Malyshev,
otherwise an excellent viewer) but it has been corrected since.
Scientific articles are available in dvi format in the ArXiV archive
(and also in PS, and more recently pdf) and in many other public
archives of scientific articles. dvi files are also usually viewable
just by clicking on them, in most Linux distributions, it seems to me ?
(although I don't know all of Linux distributions).
To elaborate further on what I said in my preceding post (using pdf for
scientific articles instead of dvi is like going back from written
civilization to oral one) : a big conceptual problem with pdf (i.e.
outside bugs in Acrobat Reader or other viewers and changes in pdf
specifications) is that it does not go far enough towards mimicking
what I would call "the ultimate format for scientific articles", i.e. a
set of sheets of printed paper published in scientific journals and
archived in University libraries. The main property of this "ultimate
format" as far as science is concerned is that, if I go in a University
library in Paris to read a given article, I am totally confident that I
or a colleague will have exactly the same article if I/he is in a
Vladivostok or Peking library. The physical characterization of a
printed sheet of paper is that it is a two-dimensional white surface
with tiny black spots of ink scattered on it. So an electronic
equivalent of a printed article is a set of bitmap images with
sufficiently high resolution defined as a sequence of rows of black and
white points. Another more elaborate electronic equivalent is a dvi
file. More elaborate (and also more complete than the sheets of paper)
because it indicates further that such group of black points is in fact
letter a, this other group is letter \omega, etc. These indications are
not included in the printed paper, only the mind of the reader can
rebuild this information. So, the dvi file has the same property as the
printed article in the scientific journal (unfalsifiability), and it
adds also further information, so that it is even superior to printed
articles in scientific journals since it contains more informations :
some printed articles with particular fonts may make it difficult or
even impossible to distinguish between 1 (number one) and l (letter
ell), x and \kappa, etc, only the context can provide the information to
the reader ; so that even if perfect OCR software for math articles
existed (which is not), it would be unable to make correct
interpretation in some places from the printed article.
On the contrary, as I said in my preceding message, a pdf file is
basically a PostScript file with additional constraints to make it
readable rapidly. So, it is still a computer program and in particular
it may recompute, each time one reads the pdf file, the positions of the
characters on the sheet of paper. Therefore, errors can occur in the
positioning of some characters (with respect to the positioning in the
original article as reviewed by the author in his final proof-reading
before publication), depending on the viewer used, the version of the
viewer, or the version of pdf prescriptions used for the document. So, a
pdf file is more or less like a sheet of music and a pdf viewer like an
artist : an artist can make false notes, may not have exactly the same
tempo as devised by the author, etc. For music, these differences
between various interpretations are generally not a problem (except
maybe for purists or if the interpret is really too bad !). But for
science, it is (or it ought to be, in my opinion) redhibitory. To
summarize : pdf files are too far from printed articles because the
positions of characters are not necessarily hard-wired in the file. This
is basically why I advocate to keep in LyX the dvi format as the
reference output for articles (say as the "ultimate electronic format").
But of course, I see no problem in using derived files in pdf, ps, html
formats, provided the reference dvi format is kept.
A final remark : the files produced by dvips, although PS files (and
thus computer programs), have most probably the general problem of pdf
files, because they are produced from dvi output, and thus I suppose
(although I did not check) they use only the PS instruction "print
character Ci at position (xi,yi) on page P(i)" with the positions
already computed. I would suspect that the pdf output of dvipdfm would
be correct too for the same reason, but this does not makes us safe from
a change in pdf specifications by Adobe. I remember some big fuss in the
TeX community some years ago because of that. The dvi specifications are
frozen, thanks to Knuth, so that using dvi format is free from this kind
of problem. To work properly, mathematicians need that, if they use
theorem X that means something today, it will mean exactly the same
thing in two years or two hundred years. If they need a theorem with
different hypotheses, a theorem with a new name is created. In computer
science, version numbers are theoretically a solution if implemented
rigorously. But in practice, for pdf files, as they are supposed to be
used by anybody, it seems (from the examples I gave in my preceding
post) that the tendency cannot be anything else but to ignore any check
and display something by all means, even if it is incorrect. The other
tendency of Adobe to extend the pdf specifications to provide more
possibilities is a good point for ordinary work but a bas one for
scientific work that requires absolute rigour.
Dvi allows interactivity and almost everything (even making a cup of
coffee, with suitable hardware installed :-) through the \special
command, see the remarkable Advi software by Pierre Weiss and others
from Inria (unfortunately not ported to Windows). As for the difficulty
to navigate in dvi files, that you mentioned in another post, I had
written a software (AsTeX navigator) about ten years ago that allows to
navigate in a dvi file, as one can navigate in a LyX document from its
detached table of contents. I presented it in TUG 2000 conference at
Cambridge. Unfortunately, it works only on Windows. I promised in
Cambridge to port it to Linux, but I never found the time.
Best wishes,
JMarc
Michel