问题
I am wondering whether anyone knows a easy way to convert a latex math formula to a big jpeg file?
Here is the latex math formula:
\[ \lim_{u\rightarrow 0_+} \int_0^u \ud s \int_{-\infty}^\infty \frac{f(u-s,x-y)}{\sqrt{2\pi s}} \exp\left\{-\frac{y^2}{2s}\right\} \ud y \]
Thanks!
回答1:
This isn’t really programming related at all, but here’s a way to do this:
- Use the class
standalone
in your LaTeX source file. This will produce a document that is exactly as large as needed, and no larger. - Produce a PDF file using
pdflatex
… - Convert to JPEG using
convert
(from ImageMagick).
Minimal example:
\documentclass{standalone}
\begin{document}
\[
\sum_{i=1}^n i
\]
\end{document}
convert
with appropriate resolution:
convert -density 400 file.pdf -scale 2000x1000 file.jpg
Caveat: standalone
has some issues determining the size of the document. I don’t actually like the results it produces. You may require loading the geometry
package and setting the document dimensions manually. This requires a bit of fiddling but the results are much better.
回答2:
Have a look at this eq2png, a little Perl script that converts .tex to .png.
回答3:
Or you can make your life much easier and visit the website:
http://www.codecogs.com/latex/eqneditor.php?lang=en-en
which outputs equations in many image formats.
回答4:
You might also use the precious WolframAlpha. try for example
http://www.wolframalpha.com/input/?i=sin+x^2++cos+x^2+%3D+0.3
that gives you

along with plots, solutions and whatnot
回答5:
If you are on OS X you can use LaTeXit, part of the TeX live distribution and, I believe, separately downloadable.
来源:https://stackoverflow.com/questions/3716140/from-latex-math-formula-to-big-jpeg-file