编辑:

编辑:

我在环境中编辑了一个很长的方程式eqnarray,并在合适的位置\nonumber\\(见下面的小例子)。编译后,这个方程占据了将近一页纸,有些长线超出了页面边缘。

由于长公式在附录中,我只想缩小其字体大小,以防止任何长行超出页面范围。如上所述,的位置\nonumber\\是“合适的”,这意味着它们的位置不应该改变。我不知道该怎么做,请给我一些建议。提前谢谢。

\documentclass[a4paper,12pt]{article}

\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{REVSYMB4-1}
\usepackage{latexsym}
\usepackage[a4paper, total={6in, 9in}]{geometry}

\begin{document}
\begin{eqnarray}\label{eq:longeq}
w &=& 100(\partial_x f)^3x^2
+\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2
+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
\partial_x f \partial_x^2 f \nonumber\\
&& + \epsilon\left[ 200\left( xxx\cot\theta f^3
-1\right)(\partial_x g)^2
+\left( \cot\theta- yyy^3\right)\partial_x f
-\left(4-1000\cot\theta f^3
\right)g\partial_x^2 f \right]\partial_x g +20zzz^2+500f^2
\nonumber\\
&& +\left( \cdots \right).
\end{eqnarray}

\end{document}

答案1

嗯,您可以使用常用的字体大小命令(如\small或)\footnotesize来获取较小的字体以打印公式。但在我看来,这看起来很丑,我认为更好的方法是将术语命名为额外变量,以使长行更短,并在额外的一行中解释新变量。

\small但是,在下面的 MWE 中,我演示了和的用法\footnotesize。请注意,只有在等式内部的行首{和结尾处才有较小的字体大小:}{...}

\documentclass[a4paper,12pt]{article}

\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{revsymb4-1}% <==================================== REVSYMB4-1
\usepackage{latexsym}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{blindtext} % <==================== add dummy text to document

\begin{document}
\blindtext
\begin{eqnarray}\label{eq:longeq}
w &=& 100(\partial_x f)^3x^2
+\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2
+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
\partial_x f \partial_x^2 f \nonumber\\
&& + \epsilon\left[ 200\left( xxx\cot\theta f^3
-1\right)(\partial_x g)^2
+\left( \cot\theta- yyy^3\right)\partial_x f
-\left(4-1000\cot\theta f^3
\right)g\partial_x^2 f \right]\partial_x g +20zzz^2+500f^2
\nonumber\\
&& +\left( \cdots \right).
\end{eqnarray}

{\small % <=============================================== lower fontsize
\begin{align}\label{eq:longequ} % <=====================================
w &= 100(\partial_x f)^3x^2
   +\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2 \nonumber\\ % <========
  &+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
    \partial_x f \partial_x^2 f \nonumber\\ % <=========================
  &+ \epsilon\left[ 200\left( xxx\cot\theta f^3
   -1\right)(\partial_x g)^2
   +\left( \cot\theta- yyy^3\right)\partial_x f 
   -\left(4-1000\cot\theta f^3
    \right)g\partial_x^2 f \right]\partial_x g \nonumber\\ % <==========
  &+20zzz^2+500f^2 \nonumber\\ % <======================================
  &+\left( \cdots \right).
\end{align}
} % <================================================= end lower fontsize

{\footnotesize % <======================================== lower fontsize
\begin{align}\label{eq:longequa} % <====================================
w &= 100(\partial_x f)^3x^2
   +\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2 \nonumber\\
  &+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
    \partial_x f \partial_x^2 f \nonumber\\
  &+ \epsilon\left[ 200\left( xxx\cot\theta f^3
   -1\right)(\partial_x g)^2
   +\left( \cot\theta- yyy^3\right)\partial_x f 
   -\left(4-1000\cot\theta f^3
    \right)g\partial_x^2 f \right]\partial_x g \nonumber\\
  &+20zzz^2+500f^2 \nonumber\\
  &+\left( \cdots \right).
\end{align}
} % <================================================= end lower fontsize
\blindtext
\end{document}

顺便说一句,我用 标记了重要的代码更改<===========。这是生成的 pdf:

所得公式

编辑:

在用户 @barbarabeeton 的评论之后,我尝试了以下 MWE(\blindtext在方程式之间添加或自由添加文本),但我无法重新创建评论中给定链接中描述的行为:

\documentclass[a4paper,12pt]{article}

\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{revsymb4-1}% <==================================== REVSYMB4-1
\usepackage{latexsym}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{blindtext} % <==================== add dummy text to document

\begin{document}
\blindtext
\begin{eqnarray}\label{eq:longeq}
w &=& 100(\partial_x f)^3x^2
+\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2
+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
\partial_x f \partial_x^2 f \nonumber\\
&& + \epsilon\left[ 200\left( xxx\cot\theta f^3
-1\right)(\partial_x g)^2
+\left( \cot\theta- yyy^3\right)\partial_x f
-\left(4-1000\cot\theta f^3
\right)g\partial_x^2 f \right]\partial_x g +20zzz^2+500f^2
\nonumber\\
&& +\left( \cdots \right).
\end{eqnarray}
This is a short blindtext to test the behaviour of \verb|\small|. 
This is a short blindtext to test the behaviour of \verb|\small|. 
This is a short blindtext to test the behaviour of fontsize command. %\blindtext
{\small % <=============================================== lower fontsize
\begin{align}\label{eq:longequ} % <=====================================
w &= 100(\partial_x f)^3x^2
   +\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2 \nonumber\\ % <========
  &+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
    \partial_x f \partial_x^2 f \nonumber\\ % <=========================
  &+ \epsilon\left[ 200\left( xxx\cot\theta f^3
   -1\right)(\partial_x g)^2
   +\left( \cot\theta- yyy^3\right)\partial_x f 
   -\left(4-1000\cot\theta f^3
    \right)g\partial_x^2 f \right]\partial_x g \nonumber\\ % <==========
  &+20zzz^2+500f^2 \nonumber\\ % <======================================
  &+\left( \cdots \right).
\end{align}
} % <================================================= end lower fontsize
This is a short blindtext to test the behaviour of \verb|\small|. 
This is a short blindtext to test the behaviour of \verb|\small|. 
This is a short blindtext to test the behaviour of fontsize command. 
{\footnotesize % <======================================== lower fontsize
\begin{align}\label{eq:longequa} % <====================================
w &= 100(\partial_x f)^3x^2
   +\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2 \nonumber\\
  &+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
    \partial_x f \partial_x^2 f \nonumber\\
  &+ \epsilon\left[ 200\left( xxx\cot\theta f^3
   -1\right)(\partial_x g)^2
   +\left( \cot\theta- yyy^3\right)\partial_x f 
   -\left(4-1000\cot\theta f^3
    \right)g\partial_x^2 f \right]\partial_x g \nonumber\\
  &+20zzz^2+500f^2 \nonumber\\
  &+\left( \cdots \right).
\end{align}
} % <================================================= end lower fontsize
\blindtext
\end{document} 

结果如下:

结果 mwe two

如您所见(用两个红色箭头标记),与之前的线没有任何相互作用{\small......{\footnotesize

答案2

在此处输入图片描述

\documentclass[a4paper,12pt]{article}

\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{REVSYMB4-1}
\usepackage{latexsym}
\usepackage[a4paper, total={6in, 9in}]{geometry}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{multline}\label{eq:longeq}
w = 100(\partial_x f)^3x^2 + \cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2   
    + \bigl(z^3-150zzz^2-20\epsilon f z^2\bigr) \partial_x f \partial_x^2 f                 \\
    + \epsilon\bigl[ 200\bigl( xxx\cot\theta f^3 - 1\bigr)(\partial_x g)^2
        + \bigl( \cot\theta- yyy^3\bigr)\partial_x f                                        \\
    - \bigl(4-1000\cot\theta f^3\bigr)g\partial_x^2 f \bigr]\partial_x g +20zzz^2+500f^2    %\\
    + \bigl( \cdots \bigr).
\end{multline}

\end{document}

答案3

正如我在评论中所说,您可以使用\allowdisplaybreaks在多行方程式中启用分页功能。这是一个演示:

\documentclass[11pt]{article}
\usepackage[vmargin=2cm]{geometry}
\usepackage{amssymb,amsmath}

\usepackage{lipsum}
\allowdisplaybreaks

\begin{document}

\lipsum[1-5]

            \begin{align}
            \label{eq:S1f}
            y_1 &= a+b+c \\ & = d+e+f \\ & = g+h+ j\\
            y_2 &= a+b+c \\ & = d+e+f \\ & = g+h+j \\
            y_3 &= a+b+c \\ & = d+e+f \\ & = g+h+j \\
            y_4 &= a+b+c \\ & = d+e+f \\ & = g+h+j
            \end{align}

\end{document} 

在此处输入图片描述

添加

至于您发布的新代码,我会加载mathtoolsnccmath。在众多的附加功能中,第一个包允许使用其命令从环境amsmath中的一行中偏离对齐。后一个包定义了中等大小的命令,约占 的 80% 。我建议这样做:align\EqMoveLeft\display style

\documentclass[12pt]{article}%

\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{REVSYMB4-1}
\usepackage{nccmath}
\usepackage[a4paper, total={6in, 9in}, showframe]{geometry}

\begin{document}

\begin{align}\label{eq:longeq}
\MoveEqLeft\medmath{
w = 100(\partial_x f)^3x^2
+\cot\theta \partial_x f \partial_x fx^2-\partial_x g x^2
+ \left(z^3-150zzz^2-20\epsilon f z^2\right)
\partial_x f \partial_x^2 f} \notag\\
 & \medmath{{}+ \epsilon\Bigl[ 200\bigl( xxx\cot\theta f^3-1\bigr)(\partial_x g)^2
+\bigl( \cot\theta- yyy^3\bigr)\partial_x f -\bigl(4-1000\cot\theta f^3
\bigr)g\partial_x^2 f \Bigr]\partial_x g}\quad \notag\\
 & \medmath{{}+20zzz^2+500f^2 +( \cdots)}.
\end{align}

\end{document} 

在此处输入图片描述

相关内容