Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dvi generation: no bounding box

I wrote a research paper in latex and generated pdf using Kile. Now I need a dvi file also. Kile's quick build process does not give a dvi file, but its 'Latex' compile process does.

So I tried to compile the document, and it gave errors for includegraphics saying "figure not found". When I append the correct extensions to the image names, that errors stopped coming but new errors came "bounding box is missing".

I added bounding box values and now DVI file is being generated. My questions are: I have tried giving very high and low bounding box values but there is no deformation in the PDF. Why? Can I generate a DVI without giving bounding box values?

like image 911
Akshey Avatar asked Feb 27 '23 22:02

Akshey


2 Answers

Normally, LaTeX accepts figure file formats different from PDFLaTeX. That is, you can include .pdf and .jpg and run PDFLaTeX without problems (your case, I suppose), but running LaTeX may cause several errors (figure not found, as you mentioned).

To compile a document with LaTeX you need to provide .eps graphic files which, by default, include a bounding box.

Over-simplifying, LaTeX works with boxes and blocks of boxes, and it manages to come out with a good placement of the boxes in the page.

That's why you need to provide a bounding box for your pictures: it is the size of the box containing your figure.

like image 52
Alessandro Cuttin Avatar answered Mar 12 '23 22:03

Alessandro Cuttin


Alessandro's answer is correct, but perhaps a little cryptic if you are not familar with the Tex landscape.

There are two main ways of creating output from Tex &c documents, call them paths: the Web2c path, which outputs dvi, and the Pdftex path, which outputs pdf. The Web2c path includes graphics in dvi files using Postscript specials, and cannot embed pdf graphics. Since you are being asked for a dvi file, that means you have to convert your pdf graphics to eps.

The other mechanism, the Pdftex path, is to embed graphics as pdf. Postscript can't be directly embedded in this way, because pdf is essentially a computationally crippled form of Postscript (with bells and whistles), and so the programming structures of Postscript can't be translated into pdf without running the Postscript program, which pdftex doesn't support. But the pdf and svg formats can be embedded, together with many bitmapped formats such as jpg.

Three futher points: firstly, the \includegraphics code is different for the two paths: it looks for different file extensions depending on whether we are, and acts differently upon them. Second, the pdftex program can create either pdfs or dvis: it looks to see how it is invoked, as either (for Latex) pdflatex or latex. Third, there is another, third, path, for Xetex, which targets a slightly different format than dvi, its xdv format, which handles fonts and character sets differently, but is otherwise like dvi.

So your problem has nothing to do with dvi's bounding boxes, but to answer that anyway: the dvi format does not have a concept of bounding box, and indeed dvi files don't have enough information to calculate one, since they show where to place characters from fonts, but don't include their font metrics: you have to look at the font metric files for that information. Additionally, with Postscript specials, one has to run a Postscript engine to find the extent of Postscript graphics.

like image 22
Charles Stewart Avatar answered Mar 13 '23 00:03

Charles Stewart