嗨,这是乳胶代码
\documentclass{sig-alternate}
\usepackage{ctable}
\begin{document}
$G_{CS}(\mathbb{S_c})=
\begin{cases}
\displaystyle\sum_{k=1}^{r} \frac{Gmax(k)-q_k(s)}{Gmax(k)-Gmin(k)}.w_k & if\ Gmax(k) \neq Gmin(k)\\
1 & if\ Gmax(k) = Gmin(k)
\end{cases}$
This is boundary This is boundary This is boundary This is boundary This is boundary This is boundary This is boundary This is boundaryThis is boundary This is boundary This is boundary This is boundary This is boundary This is boundary This is boundary This is boundary
\end{document}
这是乳胶
我在 ACM SIG Proceedings 模板中使用了两列http://www.acm.org/sigs/publications/proceedings-templates
方程超出了边界,有没有什么办法能让它在边界内?我能想到的一个方法是让红色圆圈的空间变小,红色矩形内的字体变小,但我不知道如何实现。此外,方程的两条多线太近了(用红线画出),有没有什么办法可以将它们进一步分开?
答案1
有很多方法可以减少该方程所需的空间:
\noindent
跳过段落缩进。\thinmuskip
可以通过更改和来减少二元运算符和关系符号周围的间距\medmuskip
。不要使用\medmuskip=.625\medmuskip
下面的表达式,\muexpr
而是缩放收缩和拉伸分量和保持他们。\mathit{Gmin}
(顺便问一下斜体还是直立?)节省了一些空间,因为被Gmin
设置为单词而不是产品G
**m
*带有额外的间距。i
n
- 环境
cases
添加\quad
(=1em
),\hspace{-.5em}
减少该空间。 - 整个公式以较小的字体显示
\small
,案例文字则以 为单位\scriptsize
。 - 该单词
if
应设置为单词,而不是i
*f
:的乘积\text{if}
。 \cdot
看起来比.
乘法符号更好。这里省略了点以节省一些空间,因为这里实际上不需要它。
示例文件:
\documentclass{sig-alternate}
\newcommand*{\Gmin}{\mathit{Gmin}}
\newcommand*{\Gmax}{\mathit{Gmax}}
\begin{document}
\noindent
\begingroup
\small
\thinmuskip=\muexpr\thinmuskip*5/8\relax
\medmuskip=\muexpr\medmuskip*5/8\relax
$G_{\mathit{CS}}(\mathbb{S_c})=
\begin{cases}
\displaystyle
\sum_{k=1}^{r} \frac{\Gmax(k)-q_k(s)}{\Gmax(k)-\Gmin(k)}\,w_k
& \text{\hspace{-.5em}\scriptsize if $\Gmax(k) \neq \Gmin(k)$}\\
1 & \text{\hspace{-.5em}\scriptsize if $\Gmax(k) = \Gmin(k)$}
\end{cases}
$%
\endgroup\\
This is boundary This is boundary This is boundary This is boundary This
is boundary This is boundary This is boundary This is boundaryThis is
boundary This is boundary This is boundary This is boundary This is boundary
This is boundary This is boundary This is boundary
\end{document}
变体\resizebox
使用大锤法\resizebox
将方程缩小到\linewidth
:
\documentclass{sig-alternate}
\usepackage{graphicx}
\newcommand*{\Gmin}{\mathit{Gmin}}
\newcommand*{\Gmax}{\mathit{Gmax}}
\begin{document}
\noindent
\resizebox{\linewidth}{!}{%
$G_{\mathit{CS}}(\mathbb{S_c})=
\begin{cases}
\displaystyle
\sum_{k=1}^{r} \frac{\Gmax(k)-q_k(s)}{\Gmax(k)-\Gmin(k)}\cdot w_k
& \text{if $\Gmax(k) \neq \Gmin(k)$}\\
1 & \text{if $\Gmax(k) = \Gmin(k)$}
\end{cases}$%
}\\
This is boundary This is boundary This is boundary This is boundary This
is boundary This is boundary This is boundary This is boundaryThis is
boundary This is boundary This is boundary This is boundary This is boundary
This is boundary This is boundary This is boundary
\end{document}
这也可以与不对称缩放
\resizebox{\linewidth}{\height}
或(嵌套)相结合或替换\scalebox{.975}{1}
。减小水平宽度只能避免字体看起来太小。但不对称性应尽可能保持较小,以避免方程看起来丑陋扭曲。
并且这些方法和技巧可以结合起来,例如首先使用一开始的技巧缩小空间,然后调整大小以获得最后的点。
带有max
和min
作为下标的变体
按照 Gregorio 的建议,通过使用max
和min
作为下标,可以更容易地调整等式的宽度,例如:
\documentclass{sig-alternate}
\newcommand*{\Gmin}{\mathit{G_{\mathrm{min}}}}
\newcommand*{\Gmax}{\mathit{G_{\mathrm{max}}}}
\begin{document}
\noindent
\begingroup
\small
$G_{\mathrm{CS}}(\mathbb{S_c})=
\begin{cases}
\displaystyle
\sum_{k=1}^{r} \frac{\Gmax(k)-q_k(s)}{\Gmax(k)-\Gmin(k)}\,w_k
& \text{\hspace{-.5em} if $\Gmax(k) \neq \Gmin(k)$}\\
1 & \text{\hspace{-.5em} if $\Gmax(k) = \Gmin(k)$}
\end{cases}
$%
\endgroup\\
This is boundary This is boundary This is boundary This is boundary This
is boundary This is boundary This is boundary This is boundaryThis is
boundary This is boundary This is boundary This is boundary This is boundary
This is boundary This is boundary This is boundary
\end{document}
答案2
这是使用本地定义的另一个选项
\documentclass{sig-alternate}
\usepackage{ctable}
\usepackage{lipsum}
\begin{document}
\subsection{Original}
\[
G_{CS}(\mathbb{S_c})=
\begin{cases}
\displaystyle\sum_{k=1}^{r} \frac{Gmax(k)-q_k(s)}{Gmax(k)-Gmin(k)}.w_k & if\ Gmax(k) \neq Gmin(k) \\
1 & if\ Gmax(k) = Gmin(k)
\end{cases}
\]
\lipsum[1]
\subsection{New}
\[
G_{CS}(\mathbb{S_c})=
\begin{cases}
\displaystyle\sum_{k=1}^{r} \frac{f(k,s)}{g(k,s)}.w_k & if\ Gmax(k) \neq Gmin(k) \\
1 & if\ Gmax(k) = Gmin(k)
\end{cases}
\]
where
\begin{align*}
f(k,s)&=Gmax(k)-q_k(s)\\
g(k,s)&=Gmax(k)-Gmin(k)
\end{align*}
\lipsum[2]
\end{document}
当然,我完全排除了使用包resizebox
来调整方程大小的可能性grahpicx
,因为最终看起来会很糟糕:)
答案3
在单列布局中,我不会使用布局cases
,而是将其写成两个带有内联条件的方程式。此外,我还删除了,_c
因为\mathbb
AMS bb 字体没有小写字母,所以它在您发布的图片中消失了。
If $G_{\mathrm{max}}(k) \neq G_{\mathrm{min}}(k)$ then
\[
G_{\mathrm{CS}}(\mathbb{S}_c)=
\sum_{k=1}^{r} \frac{G_{\mathrm{max}(k)-q_k(s)}}{G_{\mathrm{max}}(k)-G_{\mathrm{min}}(k)}.w_k
\]
else
\[
G_{\mathrm{CS}}(\mathbb{S}_c)= 1
\]
请注意你应该绝不对多字母标识符使用数学斜体,尤其是根本if
不应该采用数学模式的文本。
答案4
窄列对宽公式来说是个大问题。一种可能性是将第一个条件写在公式下方的一行上,稍微向外突出一点:
\documentclass[twocolumn]{article}
\usepackage{amsmath,amssymb,lipsum}
\newcommand\Gmax{\mathit{Gmax}}
\newcommand\Gmin{\mathit{Gmin}}
\begin{document}
\lipsum*[2]
\[
G_{CS}(\mathbb{S_c})=
\begin{cases}
\displaystyle\sum_{k=1}^{r} \frac{\Gmax(k)-q_k(s)}{\Gmax(k)-\Gmin(k)}\cdot w_k \qquad\\
\hfill \text{if $\Gmax(k) \neq Gmin(k)$}\\[2\jot]
1 \hfill \text{if $\Gmax(k) = \Gmin(k)$}
\end{cases}
\]
\lipsum*[2]
\end{document}
请注意,如果变量名为“G”,且“max”和“min”为下标,则应定义
\newcommand\Gmax{G_\mathrm{max}}
\newcommand\Gmin{G_\mathrm{min}}