开始方程中的垂直对齐问题

开始方程中的垂直对齐问题

“红色和绿色”线和“蓝色和棕色”线的长度不一样。当我开始书写时,这些距离会发生变化。我该如何修复它? 在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage[most]{tcolorbox}
\usepackage{refcount}
\usepackage[margin=1.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{lastpage}
%\usepackage{hyperref}
\usepackage{fancyhdr}
\pagestyle{fancy}
% 
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage/\pageref{LastPage}}
% 
\newcounter{numex}
\newcommand\equationnumberoffset{0}%
\makeatletter
\newcommand\setequationnumberoffset[1]{%
\edef\equationnumberoffset{\number\numexpr#1\relax}%
}%
\renewcommand\theequation{\@arabic{\number\numexpr\c@equation-\equationnumberoffset\relax}}%
\newcommand\MyBox[1]{%
  \begingroup
  \edef\equationnumberoffset{\number\value{equation}}%
  \renewcommand\theequation{\arabic{numex}.\@arabic{\number\numexpr\c@equation-\equationnumberoffset\relax}}%
  \stepcounter{numex}%
  \begin{tcolorbox}[enhanced,title=\textbf{Example~\thenumex)},
  attach boxed title to top left={xshift=5mm,yshift=-2.75mm},
  boxed title style={size=title,height=0.6cm,boxrule=1.7pt,valign=center,colframe=cyan!20,colback=cyan!20,boxsep=0mm,sharp corners},
  sharp corners,
  boxrule=1.7pt,
  colframe=cyan!20,
  colback=white, coltitle=black, top=5.5mm]
  #1%
  \end{tcolorbox}%
  \endgroup
}%
\makeatother
% 
\setlength{\columnsep}{1.2cm}
\setlength\columnseprule{1.3pt}
% 

\begin{document}
%
\begin{multicols*}{2}

\MyBox{%
so we have solved equation
so we have solved equation
so we have solved equation
  \begin{equation*}
  \label{eq:solveA}
  x^2-5x+6 = 0
  \end{equation*}
  \begin{equation*}
  x_1=\frac{5+\sqrt{25-4\times6}}{2} = 3
  \end{equation*}
  \begin{equation*}
  x_2=\frac{5-\sqrt{25-4\times6}}{2} =2
  \end{equation*}
  \par
  \begingroup\centering and so we have solved equation so we have solved equation so we have solved equation so we  have solved equation
  so we have solved equation
  so we have solved equation
  so we have solved equation
  so we have solved equation
  so we have solved equation
  \ref{eq:solveA}\par\endgroup
}
\vskip 15 em
\MyBox{%
  \begin{equation}
  \label{eq:solveB}
  x^2-5x+6 = 0
  \end{equation}
  \begin{equation}
  x_1=\frac{5+\sqrt{25-4\times6}}{2} = 3
  \end{equation}
  \begin{equation}
   x_2=\frac{5-\sqrt{25-4\times6}}{2} =2
  \end{equation}
  \par\centering
  \begingroup\centering and so we have solved equation so we have solved equation so we have solved equation so we have solved equation \ref{eq:solveB}\par\endgroup
}
\vfill\null
\columnbreak
\MyBox{%
  \begin{equation*}
  \label{eq:solveF}
  x^2-5x+6 = 0
  \end{equation*}
  \begin{equation*}
  x_1=\frac{5+\sqrt{25-4\times6}}{2} = 3
  \end{equation*}
  \begin{equation*}
  x_2=\frac{5-\sqrt{25-4\times6}}{2} =2
  \end{equation*}
  \par\centering
  \begingroup\centering and so we have solved equation \ref{eq:solveF}\par\endgroup
  so we have solved equation
}

\end{multicols*}
\end{document}

相关内容