
Estou usando colchetes para anotar texto. Porém, quando eu quero ter uma lista detalhada, os pedaços de texto que envolvem colchetes são desajeitadamente recuados com o marcador. Existe uma maneira de alinhá-lo normalmente (não recuado). Exemplo:
\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}
Portanto, o texto sob o primeiro marcador não é recuado em relação ao marcador. O texto sob o segundo marcador está recuado. Estou tentando alinhá-los.
Responder1
Se você não precisamostrara equação, coloque-a no modo matemático embutido:
\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}
Observe que você precisamathtools
para ser usado \mathclap
-amsmath
sozinho é insuficiente, mas será carregado por mathtools
.