My question is similar to Adding right aligned text to a list item?. The important difference is that my items span multiple lines.
- The right-aligned text itself never spans more than 1 line.
- The right-aligned text must be at the end of the first line of the item.
- The space between the end of the first line and the start of the right-aligned text must be larger than a specified minimum distance x.
- The lines after the first line of the item must be allowed to go beyond the first line.
- In the code, the contents of the item text must not be interrupted by the contents of the right-aligned text.
I could not satisfy the final condition. Here is what I produced:
Here is my code:
\begin{itemize}
\item
This item spans two lines.
This item spans two lines.
This item
\hfill \textit{Some right-aligned text.} \\
spans two lines.
This item spans two lines.
This item spans two lines.
This item spans two lines.
\end{itemize}
My failure to satisfy the no-interruption condition is problematic because whenever I change the contents of the item text, I need to remove the right-aligned text, change the item text, then figure out where to reinsert the right-aligned text by means of tedious trial and error. There has to be a better way.
I'm open to any solutions that produce the same visual results and satisfy the no-interruption condition, even if they are somewhat unorthodox. However, I'd think there has to be a simple way to do this.
Another way to solve this issue would be to have a tabular environment wherein the contents of a cell are allowed to overflow. Does anyone know how to make the contents of a tabular cell overflow off the right side?
Thanks in advance!