
Definí una macro que uso ocasionalmente al comienzo de las secciones. Después de utilizar esta macro, no quiero que se sangra el primer párrafo "real" (que técnicamente es el segundo párrafo). Sin embargo, sólo puedo lograr esto omitiendo cualquier línea nueva entre la macro y el primer párrafo. ¿Existe una forma más elegante?
\documentclass{article}
\begin{document}
\newcommand{\note}[1]{
\begin{flushright}
\textit{#1}
\end{flushright}
}
\section{First section}
First paragraph is correctly NOT indented.
\section{Second section}
\note{My Note}
First `real' paragraph is correctly NOT indented.
\section{Third section}
\note{My Note}
First `real' paragraph should NOT be indented, but IS.
\end{document}
Respuesta1
Puede utilizar los comandos utilizados por \section
para suprimir la sangría:
\documentclass{article}
\begin{document}
\makeatletter
\newcommand{\note}[1]{%
\begin{flushright}
\textit{#1}
\end{flushright}\par\@afterindentfalse\@afterheading
}
\makeatother
\section{First section}
First paragraph is correctly NOT indented.
\section{Second section}
\note{My Note}
First `real' paragraph is correctly NOT indented.
\section{Third section}
\note{My Note}
First `real' paragraph should NOT be indented, and ISN'T.
\end{document}