我有一個方程式,對於一行只有一點點太寬。我真的很想避免在下一行中輸入公式編號。你如何做到這一點?目前我使用的是\small
,但這是過度的。縮放方程以適合確切的頁面寬度
請注意。我已嘗試過scalebox
和fittowidth
,但會收到關於缺少\endgroup
的錯誤。我也完全使用了\!
。我希望有一個解決方案,可以讓我將正確的單行方程縮放到頁面寬度。
我有一個方程式,對於一行只有一點點太寬。我真的很想避免在下一行中輸入公式編號。你如何做到這一點?目前我使用的是\small
,但這是過度的。縮放方程以適合確切的頁面寬度
請注意。我已嘗試過scalebox
和fittowidth
,但會收到關於缺少\endgroup
的錯誤。我也完全使用了\!
。我希望有一個解決方案,可以讓我將正確的單行方程縮放到頁面寬度。
\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所以,我非常接近'scalebox'。爲什麼它必須在方程式環境中?此外,爲什麼我然後被迫使用內聯數學模式而不是顯示樣式?感謝這個很好的答案。 – Geoff 2010-06-24 14:28:06
'爲什麼它必須在方程式環境內?'這是沒有必要的。如你所願。例如。 '另外,爲什麼我不得不使用內聯數學模式而不是顯示樣式?'因爲'\ resizebox'處理框,所以你必須形成這樣的框。水平框內的任何數學運算都是文本模式數學。 – 2010-06-25 08:06:20
@AlexeyMalistov你也可以使用它來減小隻有中心方程的一部分的大小嗎?像'$$ aaa = \ resizebox {...} {!} bbb $$'。 – Karlo 2017-08-18 11:47:13
的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}
是否有任何不必要的字符在等式中你可以刪除?任何方式,你可以重寫它有點短? (以防萬一沒有一個真正的解決方案) – 2010-06-24 01:02:16
此外,爲什麼不使用amsmath的'split'用於方程式或'multiline'?無論如何,其他一切都將是一種痛苦。 – 2010-06-24 01:09:31
如果可以的話,我想你應該定義一些函數和變量來縮短主表達式。無論如何,閱讀和理解這麼長的表達可能很難。 – Nubsis 2010-06-24 05:48:54