\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}
gather*
如何去除使用类时左边的空白standalone
?
答案1
重新定义gather
;它只是一行代码。你甚至不必设置\abovedisplayskip
为零。
\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}