公式与正文重叠

公式与正文重叠

在下面的 MWE 中,我的公式与文档正文和标题的文本发生冲突。如何才能使公式不与文档文本发生冲突/重叠?

这是我的代码:

\documentclass[11pt]{book}
\usepackage{lipsum}
\usepackage[thicklines]{cancel}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{etoolbox,fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrule}{{%
\hrule width\headwidth height\headrulewidth depth\headrulewidth}}
\renewcommand{\headrulewidth}{.5pt}
\addtolength{\headheight}{2.5pt}
\newcommand{\footrulecolor}[1]{\patchcmd{\footrule}{\hrule}{\color{#1}\hrule}{}{}}
\renewcommand{\headrulewidth}{.5pt}
\addtolength{\headheight}{2.5pt}

\begin{document}
\chapter{Equation}
\lipsum[1-2]

Given that the structures of $f_{i}$ are known a priori (where $i=0,1,2,3$ and $f_{0}=1$), we will then have the following matrix:
\newpage
\begin{equation}
\smash{\underbrace{\begin{pmatrix}
  E(t_{1}) \\
  E(t_{2}) \\
  E(t_{3}) \\
  E(t_{4})
\end{pmatrix}}_{\mathbf{Z}(k)}}
=\smash{\underbrace{\begin{pmatrix}
   f_{11} & f_{12} & f_{13} & f_{14} \\
   f_{21} & f_{22} & f_{23} & f_{24} \\
   f_{31} & f_{32} & f_{33} & f_{34} \\
   f_{41} & f_{42} & f_{43} & f_{44}
 \end{pmatrix}}_{\mathbf{H}(k)(known)}}
\smash{\underbrace{ \begin{pmatrix}
   C_{1} \\
   C_{2} \\
   C_{3} \\
   C_{4}
 \end{pmatrix}}_{\boldsymbol{\theta}}}
 +
  \smash{\vspace{10pt}\underbrace{\cancelto{0}{\begin{pmatrix}
   v_{1} \\
   v_{2} \\
   v_{3} \\
   v_{4}
 \end{pmatrix}}}_{\mathbf{V}(k)}}
\end{equation}

\noindent

We set the modelling error matrix $v(t)$ to zero and then we end up with an equation of the form:

\begin{equation}
  \mathbf{Z}(k)=\mathbf{H}(k)\boldsymbol{\theta} \label{genlinmod}
\end{equation}

\end{document}

答案1

您应该删除前三条指令,并为第四条指令\smash添加修饰符。[t]

在此处输入图片描述

\documentclass[11pt]{book}
\usepackage[thicklines]{cancel}
\usepackage{amsmath}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrule}{{%
\hrule width\headwidth height\headrulewidth depth\headrulewidth}}
\renewcommand{\headrulewidth}{.5pt}
\addtolength{\headheight}{2.5pt}
\newcommand{\footrulecolor}[1]{\patchcmd{\footrule}{\hrule}{\color{#1}\hrule}{}{}}
\renewcommand{\headrulewidth}{.5pt}
\addtolength{\headheight}{2.5pt}

\begin{document}
\chapter{Equation}

Given that the structures of $f_{i}$ are known a priori (where $i=0,1,2,3$ and $f_{0}=1$), we have the following matrix:
\begin{equation}
\smash{\underbrace{\begin{pmatrix}
  E(t_{1}) \\ E(t_{2}) \\ E(t_{3}) \\ E(t_{4})
\end{pmatrix}}_{\mathbf{Z}(k)}}
=\underbrace{\begin{pmatrix}
   f_{11} & f_{12} & f_{13} & f_{14} \\
   f_{21} & f_{22} & f_{23} & f_{24} \\
   f_{31} & f_{32} & f_{33} & f_{34} \\
   f_{41} & f_{42} & f_{43} & f_{44}
  \end{pmatrix}}_{\mathbf{H}(k)(\textit{known})}
\underbrace{ \begin{pmatrix}
   C_{1} \\ C_{2} \\ C_{3} \\ C_{4}
  \end{pmatrix}}_{\boldsymbol{\theta}}
+
\smash[t]{\underbrace{\cancelto{0}{\begin{pmatrix}
   v_{1} \\ v_{2} \\ v_{3} \\ v_{4}
\end{pmatrix}}}_{\mathbf{V}(k)}}
\end{equation}
We set the modelling error matrix $\mathbf{V}(k)$ to zero and end up with an equation of the form:
\begin{equation}
  \mathbf{Z}(k)=\mathbf{H}(k)\boldsymbol{\theta} \label{genlinmod}
\end{equation}

\end{document}

答案2

这是 的效果\smash。它将参数的高度和深度设置为零。然后 TeX 看不到材料并覆盖前一个方程。没有 和 的示例\smash有一些小的修复:

\documentclass[11pt]{book}
\usepackage[thicklines]{cancel}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\underbrace{\begin{pmatrix}
  E(t_{1}) \\
  E(t_{2}) \\
  E(t_{3}) \\
  E(t_{4})
\end{pmatrix}}_{\mathbf{Z}(k)}
=\underbrace{\begin{pmatrix}
   f_{11} & f_{12} & f_{13} & f_{14} \\
   f_{21} & f_{22} & f_{23} & f_{24} \\
   f_{31} & f_{32} & f_{33} & f_{34} \\
   f_{41} & f_{42} & f_{43} & f_{44}
 \end{pmatrix}}_{\mathbf{H}(k)(\text{known})}
\underbrace{ \begin{pmatrix}
   C_{1} \\
   C_{2} \\
   C_{3} \\
   C_{4}
 \end{pmatrix}}_{\boldsymbol{\theta}}
 +
  \underbrace{\cancelto{0}{\begin{pmatrix}
   v_{1} \\
   v_{2} \\
   v_{3} \\
   v_{4}
 \end{pmatrix}}}_{\mathbf{V}(k)}
\end{equation}

\noindent

We set the modelling error matrix $v(t)$ to zero and then we end up with an
equation of the form:

\begin{equation}
  \mathbf{Z}(k)=\mathbf{H}(k)\boldsymbol{\theta} \label{genlinmod}
\end{equation}

\end{document}

结果

相关内容