I'm trying to output a .pdf that just contains an equation, without any borders at all, or borders the same width all the way round.
So far, I've tried two things. Using the standalone
document class, and using the preview
package. The first one doesn't quite suit my needs because you can't use the equation
or align
environments so you can't put in multi-line, aligned equations.
The second technique is better, but the resulting pdf has whitespace to the left of the equation instead of having no border at all.
Here's what I have so far:
\documentclass{article}
\usepackage{amsmath}
\usepackage[active,tightpage,displaymath]{preview}
%\PreviewBorder=1pt &setting this to 0 doesn't remove the margin on the left
\begin{document}
\begin{align*}
E_i = &E_{Z} + E_{an} + E_{ex}\\
= &- \mu_0 M_{s, i} H cos (\phi_i)\\
&+ K_{u,i} sin^2(\phi_i - \theta)\\
&- J_{i+1} \mu_0 M_{s, i} M_{s, i+1} cos(\phi_i - \phi_{i+1})\\
&- J_{i-1} \mu_0 M_{s, i} M_{s, i-1} cos(\phi_i - \phi_{i-1})
\end{align*}
\end{document}
I hope the question is clear enough. Let me know if not.
.pdf
file that can be included somewhere else, what i'd do is, first, add\thispagestyle{empty} just after
\begin{document}, and then use (from the command line)
pdfcrop -margin 3 filename.pdf. this will produce a file
filename-crop.pdf` that is tightly cropped on all edges; the small margin is added to avoid skiving off the edges of those glyphs that touch the margins.