2010-06-24 41 views
28

我有一个方程式,对于一行只有一点点太宽。我真的很想避免在下一行中输入公式编号。你如何做到这一点?目前我使用的是\small,但这是过度的。缩放方程以适合确切的页面宽度

请注意。我已尝试过scaleboxfittowidth,但会收到关于缺少\endgroup的错误。我也完全使用了\!。我希望有一个解决方案,可以让我将正确的单行方程缩放到页面宽度。

下面是一个例子(未我的实际方程): Long equation

+0

是否有任何不必要的字符在等式中你可以删除?任何方式,你可以重写它有点短? (以防万一没有一个真正的解决方案) – 2010-06-24 01:02:16

+0

此外,为什么不使用amsmath的'split'用于方程式或'multiline'?无论如何,其他一切都将是一种痛苦。 – 2010-06-24 01:09:31

+0

如果可以的话,我想你应该定义一些函数和变量来缩短主表达式。无论如何,阅读和理解这么长的表达可能很难。 – Nubsis 2010-06-24 05:48:54

回答

46
\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} 
\resizebox{.8\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} 
+1

+1所以,我非常接近'scalebox'。为什么它必须在方程式环境中?此外,为什么我然后被迫使用内联数学模式而不是显示样式?感谢这个很好的答案。 – Geoff 2010-06-24 14:28:06

+4

'为什么它必须在方程式环境内?'这是没有必要的。如你所愿。例如。 '另外,为什么我不得不使用内联数学模式而不是显示样式?'因为'\ resizebox'处理框,所以你必须形成这样的框。水平框内的任何数学运算都是文本模式数学。 – 2010-06-25 08:06:20

+0

@AlexeyMalistov你也可以使用它来减小只有中心方程的一部分的大小吗?像'$$ aaa = \ resizebox {...} {!} bbb $$'。 – Karlo 2017-08-18 11:47:13

1

graphicx package提供命令\resizebox{width}{height}{object}

\documentclass{article} 
\usepackage{graphicx} 
\begin{document} 
\hrule 
%%% 
\makeatletter% 
\setlength{\@tempdima}{\the\columnwidth}% the, well columnwidth 
\settowidth{\@tempdimb}{(\ref{Equ:TooLong})}% the width of the "(1)" 
\addtolength{\@tempdima}{-\the\@tempdimb}% which cannot be used for the math 
\addtolength{\@tempdima}{-1em}% 
% There is probably some variable giving the required minimal distance 
% between math and label, but because I do not know it I used 1em instead. 
\addtolength{\@tempdima}{-1pt}% distance must be greater than "1em" 
\xdef\[email protected]{\the\@tempdima}% space remaining for math 
\begin{equation}% 
\resizebox{\[email protected]}{!}{$\displaystyle{% to get everything inside "big" 
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}$}% 
\label{Equ:TooLong}% 
\end{equation}% 
\makeatother% 
%%% 
\hrule 
\end{document} 
相关问题