# Beamer raggedright unintended for complete line instead of part of the line

I am trying to create a slide in Beamer, and in one line, I would like to switch from left to right alignment (after haven written some words with left alignment). Unfortunately, I cannot use \hfill, as the text I would like to have right aligned is too long (it doesn't fit in one line, so part of the text would be left aligned in the new line). I used raggedleft which works fine, however it seems that "About my topic" gets also right aligned or at least indented (what I don't want). Is there a way so that "About my topic" is written similar to "About me" and "Some other stuff", but the name of the topic is right aligned as seen in the picture below?

Thank you very much!

This is my code (the problematic line is "About my topic"):

\documentclass[•]{beamer}

\newenvironment{itemlist}[1]{%
\begin{trivlist}
\item \textbf{\large #1}
\begin{itemize}
}{%
\end{itemize}
\end{trivlist}
}

\begin{document}

\begin{frame}{Titel}
\item Studying XXX in YYY
\item Some additional information
\end{itemlist}
\begin{itemlist}{About my topic \footnotesize \raggedleft ("This is the name of my very interesting topic which is too long for one line") \\}
\item Topic information 1
\item Topic Information 2
\end{itemlist}
\begin{itemlist}{Some other stuff}
\item Stuff 1
\item Stuff 2
\end{itemlist}
\end{frame}

\end{document}

• Of course, one quick and dirty solution would be \begin{itemlist}{About my topic \footnotesize ("This is the name of my very interesting topic \linebreak \phantom{x} \hfill which is too long for one line") \\} However, this solution doesn't look nice to me (as code as well as the output in the pdf) – Unicorn May 2 '18 at 17:28

I'd use \hfill - It does not matter if your text is more than one line.

\documentclass{beamer}

\newenvironment{itemlist}[1]{%
\begin{trivlist}
\item \textbf{\large #1}
\begin{itemize}
}{%
\end{itemize}
\end{trivlist}
}

\begin{document}

\begin{frame}{Titel}
\item Studying XXX in YYY
\item Some additional information
\end{itemlist}
\begin{itemlist}{About my topic \footnotesize \hfill \raggedleft ("This is the name of my very interesting topic which is too long for one line") \\}
\item Topic information 1
\item Topic Information 2
\end{itemlist}
\begin{itemlist}{Some other stuff}
\item Stuff 1
\item Stuff 2
\end{itemlist}
\end{frame}

\end{document}


• Thanks for the quick answer, that works fine. I'm still wondering, as I am almost certainly sure I tried hfill myself and it didn't work (see above). Don't know what my mistake was. – Unicorn May 2 '18 at 17:40