1. 程式人生 > 其它 >Latex 公式縮放 Latex scales an equation to fit page width

Latex 公式縮放 Latex scales an equation to fit page width

用Latex排版時,公式長度超過行寬度時可以用 resizebox 對公式進行自動縮放,用法如下:

1、呼叫巨集包:

\usepackage{graphicx}

2、使用以下命令:

\begin{equation}
\resizebox{.9\hsize}{!}{$A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z$}
\end{equation}
\begin{equation}
\vspace{-0.05in}
\resizebox{0.9\hsize}{!}{$\begin{aligned}
\mathbbm{E}_{\mathcal{V}}[\mathcal{{\hat{L}}}\left(f_{\mathcal{V}}\right)] &\leq  \underbrace{{\frac{1}{n} \sum_{i=1}^{n}{\frac{p_{t}(\boldsymbol{x}_{i})}{\widetilde{p}_{s}(\boldsymbol{x}_{i})}\mathbbm{E}_{\mathcal{V}}[\mathbbm{1}(y_if_{\mathcal{V}}(\boldsymbol{x}_{i}) <\gamma)}}]}_{(I)}+\underbrace{\frac{L\cdot \sqrt{D_{\chi^{2}}\left(P_{t}\| \widetilde{P}_{s}\right)+1}}{{\gamma \cdot q^{\left(q-1\right) / 2} \sqrt{n}}}}_{\left(I I\right)}+ (III).
%\underbrace{\epsilon(\gamma, n, \delta)}_{\left(III\right)}
\end{aligned}$}
\label{fanhua2}
\vspace{-0.05in}
\end{equation}

注意,需要加入$ 符號

轉自:https://www.cnblogs.com/jins-note/p/13651734.html