
Estoy usando llaves para anotar texto. Sin embargo, cuando quiero tener una lista detallada, los fragmentos de texto que incluyen llaves tienen una sangría incómoda sin la viñeta. ¿Hay alguna manera de que esté normalmente alineado (sin sangría)? Ejemplo:
\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}
Por lo tanto, el texto debajo de la primera viñeta no tiene sangría con respecto a la viñeta. El texto debajo del segundo punto tiene sangría. Estoy intentando que estén alineados.
Respuesta1
Si no tienes que hacerlomostrarla ecuación, ponla en modo matemático en línea:
\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}
Tenga en cuenta que necesitamathtools
para usar \mathclap
-amsmath
por sí solo es insuficiente, pero será cargado por mathtools
.