1
\documentclass[preview,border=12pt,varwidth]{standalone}% change it back to your own document class
\usepackage{amsmath}

\begin{document}
\abovedisplayskip=0pt\relax% remove this line in  your production
\begin{gather*}
\int \sec^2(5 - 3x/4)\,\mathrm{d}x\\
\int \frac{1}{\cos^2 (5 - 3x/4)}\,\mathrm{d}x
\end{gather*}
\end{document}

enter image description here

How to remove the white space on the left of gather* when using standalone class?

Moriambar
  • 11,466

1 Answers1

3

Redefine gather; it's just a one liner. You don't even have to set \abovedisplayskip to zero.

\documentclass[border=12pt]{standalone}
\usepackage{amsmath}

\newcommand{\diff}{\mathop{}\!d}
\renewenvironment{gather*}{$\gathered}{\endgathered$}

\begin{document}
\begin{gather*}
\int \sec^2(5 - 3x/4)\diff x\\
\int \frac{1}{\cos^2 (5 - \frac{3}{4}x)}\diff x
\end{gather*}
\end{document}

enter image description here

David Carlisle
  • 757,742
egreg
  • 1,121,712