正如标题所说,\underbrace
我的代码中的 未对齐,而\overbrace
不会造成任何问题。这在第一张图片中可见:
这是我正在使用的代码
\documentclass[11pt,a4paper,openany]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage{mathtools}
\newcommand{\deff}[1]{\large{\underline{\textbf{#1}}}}
\newcommand{\X}{\mathcal{X}}
\newcommand{\Y}{\mathcal{Y}}
\newcommand*{\Vimplies}{\mathrel{\text{\raisebox{.25ex}{\rotatebox[origin=c]{270}{$\implies$}}}}}
\begin{document}
DIM.
\begin{gather*}
\lefteqn{
\textcolor{red}{
\underbrace{\phantom{a) \iff b)}}_{a) \implies b) \;\land\; b) \implies a)}}}
a) \iff
\textcolor{ForestGreen}{
\overbrace{\textcolor{black}{b) \iff c)}}^{b) \implies c) \;\land\; c) \implies b)}} \\
\Vimplies \\
\boxed{a) \implies b) \implies c) \implies a)}
\end{gather*}
\[\lefteqn{\underbrace{\phantom{1+2+3}}_{a+b+d}}1+2+\overbrace{3+4+5}^{e+f+g}\]
\end{document}
答案1
由于下支撑和上支撑标签都比支撑本身更宽,因此需要对其进行\mathclap
加宽。
\documentclass[11pt,a4paper,openany]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage{mathtools}
\newcommand{\deff}[1]{\large{\underline{\textbf{#1}}}}
\newcommand{\X}{\mathcal{X}}
\newcommand{\Y}{\mathcal{Y}}
\newcommand*{\Vimplies}{\mathrel{\text{\raisebox{.25ex}{\rotatebox[origin=c]{270}{$\implies$}}}}}
\newsavebox\MBox
\newcommand\Cline[2][red]{{\sbox\MBox{$#2$}%
\rlap{\usebox\MBox}\color{#1}\rule[-1.2\dp\MBox]{\wd\MBox}{0.8pt}}}
\begin{document}
DIM.
\begin{gather*}
\lefteqn{
\textcolor{red}{
\underbrace{\phantom{a) \iff b)}}_{\mathclap{a) \implies b) \;\land\; b) \implies a)}}}}
a) \iff
\textcolor{ForestGreen}{
\overbrace{\textcolor{black}{b) \iff c)}}^{\mathclap{b) \implies c) \;\land\; c) \implies b)}}} \\
\Vimplies \\
\boxed{a) \implies b) \implies c) \implies a)}
\end{gather*}
\[\lefteqn{\underbrace{\phantom{1+2+3}}_{a+b+d}}1+2+\overbrace{3+4+5}^{e+f+g}\]
\end{document}