
Я использую uderbraces для аннотирования текста. Когда я хочу получить подробный список, фрагменты текста, включающие нижние скобки, неловко отступают относительно маркера. Есть ли способ сделать его нормально выровненным (без отступа). Пример:
\documentclass[pdf]{beamer}
\usepackage{xcolor}
\usepackage{amsmath}
\makeatletter
\newcommand{\redub}{}
\def\redub#1{%
\@ifnextchar_%
{\@redub{#1}}
{\@latex@warning{Missing argument for \string\redub}\@redub{#1}_{}}%
}
\def\@redub#1_#2{%
\colorlet{currentcolor}{.}%
\color{red}%
\underbrace{\color{currentcolor}#1}_{\color{red}#2}%
\color{currentcolor}%
}
\makeatother
\begin{document}
\begin{frame}
\begin{itemize}
\item SAMPLE
\item
\[
\redub{\text{sample}}_{\mathclap{\text{sample}}}}{\text{sample}}
\]
\end{itemize}
\end{frame}
\end{document}
Итак, текст под первым пунктом не имеет отступа относительно пункта. Текст под вторым пунктом имеет отступ. Я пытаюсь выровнять их.
решение1
Если вам не нужноотображатьуравнение, переведите его в режим встроенной математики:
\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{xcolor,mathtools}% http://ctan.org/pkg/{xcolor,mathtools}
\makeatletter
\newcommand{\redub}{}
\def\redub#1{%
\@ifnextchar_%
{\@redub{#1}}
{\@latex@warning{Missing argument for \string\redub}\@redub{#1}_{}}%
}
\def\@redub#1_#2{%
\colorlet{currentcolor}{.}%
\color{red}%
\underbrace{\color{currentcolor}#1}_{\color{red}#2}%
\color{currentcolor}%
}
\makeatother
\begin{document}
\begin{frame}
\begin{itemize}
\item SAMPLE
\item $\redub{\text{sample}}_{\mathclap{\text{sample}}}{\text{sample}}$
\end{itemize}
\end{frame}
\end{document}
Обратите внимание, что вам нужноmathtools
для того, чтобы использовать \mathclap
-amsmath
одного этого недостаточно, но он будет загружен mathtools
.