I am trying to create a command that moves (short) keywords to the left side of the text. They should be "right" aligned" with a fixed separation between the keyword and the text.
The command below does what I want, but only if the text is indented or not - not with a combination, e.g. after the start of a new section.
Can I check whether the note is in an indented paragaph \hspace{\parindent} and issue conditionally? Or is there a better approach? I don't want to use the marginnote package (or the marginpar in general) for this.
\documentclass{scrartcl}
\newcommand{\parnote}[1]{%
\begingroup
\setlength{\fboxsep}{0pt}
\hspace*{0pt}\llap{%
\framebox[2cm][r]{% normally use makebox
#1%
% \hspace{\parindent}%
\hspace{8pt}%
}%
}%
\endgroup
\ignorespaces
}
\begin{document}
\section{Dummy}
\parnote{Keyword 1} This paragraph has no indent.
\bigskip
\parnote{Other Word} This paragraph has an indent.
\end{document}


