我附上了我的代码示例。我想缩小方程的大小,以便它能放在一行中,但当我运行代码时,我收到错误。任何建议都将不胜感激。
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphics}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[document]{ragged2e}
\setlength{\parindent}{4em}
\setlength{\parskip}{1em}
\begin{document}
\begin{displaymath} \scalebox{0.5}{-\lambda\V_{t}^{H}+\alpha\V_{d}+1/2\V_{dd}\gamma_{t}^2+\frac{-\lambda^2{\D}_t^2\V_{x}^2-\lambda\mu{\D}_t\V_{x}^2+\lambda\varphi{\D}_t\V_{x}^2-\lambda\gamma\sigma{\D}_t\V_{x}\V_{xd}}{\sigma^2\V_{xx}}+\frac{-\lambda\mu{\D}_t\V_{x}^2-\mu^2\V_{x}^2+\mu\varphi\V_{x}^2-\mu\gamma\sigma\V_{x}\V_{xd}}{\sigma^2\V_{xx}} +\frac{-\lambda\varphi{\D}_t\V_{x}^2-\mu\varphi\V_{x}^2+\varphi^2\V_{x}^2-\gamma\sigma\varphi\V_{x}\V_{xd}}{\sigma^2\V_{xx}} +\frac{(-\lambda{\D}_t}\V_{x}-\mu\V_{x}+\varphi\V_{x}-\gamma\sigma\V_{xd})^2{2\sigma^2\V_{xx}}+\frac{-\lambda\gamma\sigma{\D}_t}\V_{x}\V_{xd}-\mu\gamma\sigma\V_{x}\V_{xd}+\gamma\sigma\varphi\V_{x}\V_{xd}-\gamma^2\sigma^2\V_{xd}^2{\sigma^2\V_{xx}} } \end{displaymath}
\end{document}
答案1
无法调整方程的大小以使其适合一行并保持可读性。
注意:我提供了\V
和的虚拟定义\D
,它们只产生五和德。
您可以改用多行显示。
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % for mock text
\newcommand{\V}{V}
\newcommand{\D}{D}
\begin{document}
\lipsum[1][1-4]
\begin{multline*}
-\lambda\V_{t}^{H}
+\alpha\V_{d}+1/2\V_{dd}\gamma_{t}^2
\\
+\frac{-\lambda^2{\D}_t^2\V_{x}^2
-\lambda\mu{\D}_t\V_{x}^2
+\lambda\varphi{\D}_t\V_{x}^2
-\lambda\gamma\sigma{\D}_t\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
+\frac{-\lambda\mu{\D}_t\V_{x}^2
-\mu^2\V_{x}^2
+\mu\varphi\V_{x}^2
-\mu\gamma\sigma\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
+\frac{-\lambda\varphi{\D}_t\V_{x}^2
-\mu\varphi\V_{x}^2
+\varphi^2\V_{x}^2
-\gamma\sigma\varphi\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
+\frac{(-\lambda{\D}_t\V_{x}
-\mu\V_{x}+\varphi\V_{x}
-\gamma\sigma\V_{xd})^2
}{2\sigma^2\V_{xx}}
\\
+\frac{-\lambda\gamma\sigma{\D}_t\V_{x}\V_{xd}
-\mu\gamma\sigma\V_{x}\V_{xd}
+\gamma\sigma\varphi\V_{x}\V_{xd}
-\gamma^2\sigma^2\V_{xd}^2
}{\sigma^2\V_{xx}}
\end{multline*}
\lipsum[1][1-4]
\end{document}
或者,对齐运算符号:
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\newcommand{\V}{V}
\newcommand{\D}{D}
\begin{document}
\lipsum[1][1-4]
\begin{align*}
-\lambda\V_{t}^{H}
&+\alpha\V_{d}+1/2\V_{dd}\gamma_{t}^2
\\
&+\frac{-\lambda^2{\D}_t^2\V_{x}^2
-\lambda\mu{\D}_t\V_{x}^2
+\lambda\varphi{\D}_t\V_{x}^2
-\lambda\gamma\sigma{\D}_t\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
&+\frac{-\lambda\mu{\D}_t\V_{x}^2
-\mu^2\V_{x}^2
+\mu\varphi\V_{x}^2
-\mu\gamma\sigma\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
&+\frac{-\lambda\varphi{\D}_t\V_{x}^2
-\mu\varphi\V_{x}^2
+\varphi^2\V_{x}^2
-\gamma\sigma\varphi\V_{x}\V_{xd}
}{\sigma^2\V_{xx}}
\\
&+\frac{(-\lambda{\D}_t\V_{x}
-\mu\V_{x}+\varphi\V_{x}
-\gamma\sigma\V_{xd})^2
}{2\sigma^2\V_{xx}}
\\
&+\frac{-\lambda\gamma\sigma{\D}_t\V_{x}\V_{xd}
-\mu\gamma\sigma\V_{x}\V_{xd}
+\gamma\sigma\varphi\V_{x}\V_{xd}
-\gamma^2\sigma^2\V_{xd}^2
}{\sigma^2\V_{xx}}
\end{align*}
\lipsum[1][1-4]
\end{document}