怎样才能最好地整洁地写出这个长表达式?

怎样才能最好地整洁地写出这个长表达式?

我现在有这个等式

在此处输入图片描述

给出

\begin{document}

{\scriptsize

\begin{equation}

\omega_{\mp}^j=2\arctan\left(\frac{\mathbf{z}_{\hat{3}}^j\cdot\left(\mathbf{z}_1^j \times \mathbf{z}_2^j\right) \mp \sqrt{\left[ \mathbf{z}_{\hat{3}}^j \cdot \left(\mathbf{z}_1^j \times \mathbf{z}_2^j\right) \right]^2  + 2 \left[ \left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)\cdot\left(\mathbf{z}_{1}^j\times\mathbf{z}_{\hat{3}}^j\right) \right]\left[\mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right)\right]- \left[\mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right) \right]^2  }}{2\left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)\cdot\left(\mathbf{z}_{1}^j\times\mathbf{z}_{\hat{3}}^j\right) - \mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right)} \right)

\end{equation}

}

\end{document}

使用 ,它几乎不能容纳一行\scriptsize,即使这样也略微溢出。如果不使用诸如 之类的进一步替换,那么排版此表达式的最简洁方法是什么$\mathbf{z}_{12}^j = \left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)$

提前致谢!

编辑:

这是表达式的扩展

在此处输入图片描述

在此处输入图片描述

答案1

这里有两个选项,主要在于添加大量负水平间距。

编辑:使用 Mico 的建议,我改变了的定义\stimes,并为其他符号添加了类似的定义。

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand{\scdot}{{\cdot}}
\newcommand{\stimes}{{\times}}
\newcommand{\splus}{{+}}
\newcommand{\sminus}{{-}}
\newcommand{\smp}{{\mp}}
\setlength{\parindent}{0pt}
\begin{document}
Shrinking a lot of horizontal spacing:
{\scriptsize
\begin{equation}
\omega_{\mp}^j = 2\arctan\!\left(\! \frac{\mathbf{z}_{\hat{3}}^j\scdot\bigl(\mathbf{z}_1^j \stimes \mathbf{z}_2^j\bigr) \smp \sqrt{\Bigl[ \mathbf{z}_{\hat{3}}^j \scdot \bigl(\mathbf{z}_1^j \stimes \mathbf{z}_2^j\bigr) \!\Bigr]^2\! \splus 2 \Bigl[\! \bigl(\mathbf{z}_1^j\stimes\mathbf{z}_2^j\bigr)\scdot\bigl(\mathbf{z}_{1}^j\stimes\mathbf{z}_{\hat{3}}^j\bigr) \!\Bigr]\!\Bigl[\mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr)\!\Bigr] \sminus \Bigl[\mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr) \!\Bigr]^2 }}{2\bigl(\mathbf{z}_1^j\stimes\mathbf{z}_2^j\bigr)\scdot\bigl(\mathbf{z}_{1}^j\stimes\mathbf{z}_{\hat{3}}^j\bigr) \sminus \mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr)} \right)
\end{equation}
}

Shrinking a lot of horizontal spacing, and splitting the numerator in two lines:
{\scriptsize
\begin{equation}
\omega_{\mp}^j = 2\arctan\!\left( \frac{\splitfrac{
    \mathbf{z}_{\hat{3}}^j\scdot\bigl(\mathbf{z}_1^j \stimes \mathbf{z}_2^j\bigr)
    }{
    \smp \sqrt{\Bigl[ \mathbf{z}_{\hat{3}}^j \scdot \bigl(\mathbf{z}_1^j \stimes \mathbf{z}_2^j\bigr) \!\Bigr]^2\! \splus 2 \Bigl[\! \bigl(\mathbf{z}_1^j\stimes\mathbf{z}_2^j\bigr)\scdot\bigl(\mathbf{z}_{1}^j\stimes\mathbf{z}_{\hat{3}}^j\bigr) \!\Bigr]\!\Bigl[\mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr)\!\Bigr] \sminus \Bigl[\mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr) \!\Bigr]^2}
}}{2\bigl(\mathbf{z}_1^j\stimes\mathbf{z}_2^j\bigr)\scdot\bigl(\mathbf{z}_{1}^j\stimes\mathbf{z}_{\hat{3}}^j\bigr) \sminus \mathbf{z}_2^j\scdot\bigl(\mathbf{z}_{\hat{3}}^j \sminus \mathbf{z}_3^j\bigr)} \right)
\end{equation}
}

\end{document}

答案2

怎么样

\documentclass[fleqn]{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\omega_{\mp}^j=2\arctan\left(\frac{A^j \mp 
\sqrt{\left( A^j \right)^2  + 2 B^jC^j-\left(C^j \right)^2}}{2B^j- C^j} \right)
\;,
\end{equation}
where
\begin{subequations}
\begin{align}
 A^j&=\mathbf{z}_{\hat{3}}^j\cdot\left(\mathbf{z}_1^j
    \times \mathbf{z}_2^j\right)\;,\\
 B^j&=\left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)\cdot\left(\mathbf{z}_{1}^j\times\mathbf{z}_{\hat{3}}^j\right)\;,\\
 C^j&=\mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right)\;.
\end{align}
\end{subequations}
\end{document}

在此处输入图片描述

我个人也会使用\pm来代替\mp并避免\mathbf

答案3

我愿提出以下几点建议:

  • 删除所有\left\right大小指令。从使方程式更具可读性的角度来看,它们是不必要的,但它们往往会插入大量水平空白。

  • 完全省略最外面的一对圆括号(分数表达式周围的一对)。

  • 废除所有 7\cdot条指令。

经过这些调整,您可以更改\scriptsize\small。您的读者会感谢您这样做...

或者,\newcommand\bz{\mathbf{z}}在序言中定义并将\mathbf{z}等式中的所有 23 个 [!] 实例替换为\bz。这不会影响输出,但肯定有助于整理输入。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}
\usepackage{geometry} % set the page size parameters suitably
\newcommand\bz{\mathbf{z}}
\begin{document}

BEFORE
{\scriptsize
\begin{equation}
\omega_{\mp}^j=2\arctan\left(\frac{\mathbf{z}_{\hat{3}}^j\cdot\left(\mathbf{z}_1^j \times \mathbf{z}_2^j\right) \mp \sqrt{\left[ \mathbf{z}_{\hat{3}}^j \cdot \left(\mathbf{z}_1^j \times \mathbf{z}_2^j\right) \right]^2  + 2 \left[ \left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)\cdot\left(\mathbf{z}_{1}^j\times\mathbf{z}_{\hat{3}}^j\right) \right]\left[\mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right)\right]- \left[\mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right) \right]^2  }}{2\left(\mathbf{z}_1^j\times\mathbf{z}_2^j\right)\cdot\left(\mathbf{z}_{1}^j\times\mathbf{z}_{\hat{3}}^j\right) - \mathbf{z}_2^j\cdot\left(\mathbf{z}_{\hat{3}}^j-\mathbf{z}_3^j\right)} \right)
\end{equation}
}

\bigskip
AFTER
\bgroup
\small % <-- not "\scriptsize"
\begin{equation}
\omega_{\mp}^j=2\arctan\frac{\bz_{\hat{3}}^j(\bz_1^j \times \bz_2^j) \mp 
\sqrt{[ \bz_{\hat{3}}^j  (\bz_1^j \times \bz_2^j) ]^2  
+ 2 [ (\bz_1^j\times\bz_2^j)(\bz_{1}^j\times\bz_{\hat{3}}^j) ]%
[\bz_2^j(\bz_{\hat{3}}^j-\bz_3^j)]
- [\bz_2^j(\bz_{\hat{3}}^j-\bz_3^j) ]^2  }}{%
2(\bz_1^j\times\bz_2^j)(\bz_{1}^j\times\bz_{\hat{3}}^j) 
- \bz_2^j(\bz_{\hat{3}}^j-\bz_3^j)} 
\end{equation}
\egroup

\end{document}

答案4

\documentclass{article}
\usepackage{nccmath}
\usepackage{mathtools}
\newcommand{\scdot}{{\cdot}}
\newcommand{\stimes}{{\times}}
\newcommand{\splus}{{+}}
\newcommand{\sminus}{{-}}
\newcommand{\smp}{{\mp}}
\newcommand\bz{\mathbf{z}}

\setlength{\parindent}{0pt}

\begin{document} 

With use of the \verb+nccmath+ for reducing equation size, new command \verb+\bz+ and removing \verb+\left(+ and \verb+\right)+ from @Mico answer, and reducing horisontal space around math operators and use of the \verb+\splitfrac+ from @Vincent answer for spliting square root into two lines and:
    \begin{equation}\medmath{
\omega_{\mp}^j = 2\arctan\!\left\lgroup 
    \frac{
    \bz_{\hat{3}}^j\scdot(\bz_1^j \stimes \bz_2^j) \smp 
%                   
    \sqrt{\splitfrac{\Bigl[\bz_{\hat{3}}^j \scdot (\bz_1^j \stimes \bz_2^j) \!\Bigr]^2\! \splus }
                    {2 \Bigl[ 
    (\bz_1^j\stimes\bz_2^j)\scdot (\bz_{1}^j\stimes\bz_{\hat{3}}^j ) \Bigr]\!\Bigl[\bz_2^j\scdot (\bz_{\hat{3}}^j \sminus \bz_3^j ) \Bigr] \sminus \Bigl[\bz_2^j\scdot (\bz_{\hat{3}}^j \sminus \bz_3^j ) \Bigr]^2}}
        }{2 (\bz_1^j\stimes\bz_2^j )\scdot (\bz_{1}^j\stimes\bz_{\hat{3}}^j ) \sminus \bz_2^j\scdot (\bz_{\hat{3}}^j \sminus \bz_3^j )} \right\rgroup
    }\end{equation}
\end{document}

在此处输入图片描述

相关内容