English 中文(简体)
LaTeX Page Size --- how do I produce a page that is "just big enough"?
原标题:

I was learning about using the command line version of latex today, and I was experimenting with outputting .tex to .dvi, and then .dvi to .png.

The problem is, I have a simple .tex document which contains some math. The goal is to eventually produce a png form of the equation. But when I run:

$ latex -output-format=dvi test.tex
$ dvipng test.dvi

I get test1.png that is shaped like a regular letter-sized page. I only want an image that is as big as the equation needs to be. I m sure I m missing something obvious, but I can t figure it out!

Is there a command line option for either latex or dvipng to specify that the output file should only be set on a page as large as needed to render the equation?

Here s my example test.tex:

documentclass{article}
egin{document}
The solution to $sqrt{x} = 5$ is $x=25$.
end{document}

Thanks!

最佳回答

Try

dvipng -T tight filename

EDIT: As Mr tur1ing points out, you ll also want pagestyle{empty} to avoid having a page number muck up the works.

问题回答

Try mathurl and Roger s Online Equation Editor. There probably several other such sites.





相关问题
Maths in LaTex table of contents

I am trying to add a table of contents for my LaTex document. The issue I am having is that this line: subsubsection{The expectation of (X^2)} Causes an error in the file that contains the ...

Math Overflow -- Handling Large Numbers

I am having a problem handling large numbers. I need to calculate the log of a very large number. The number is the product of a series of numbers. For example: log(2x3x66x435x444) though my actual ...

Radial plotting algorithm

I have to write an algorithm in AS3.0 that plots the location of points radially. I d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry ...

Subsequent weighted algorithm for comparison

I have two rows of numbers ... 1) 2 2 1 0 0 1 2) 1.5 1 0 .5 1 2 Each column is compared to each other. Lower values are better. For example Column 1, row 2 s value (1.5) is more ...

热门标签