3

enter image description here how to align in the right side? to result like in the picture.

6

Something like this?

enter image description here

\documentclass{article}
\begin{document}
\begin{enumerate}
\item blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl blabla blabla blabl
\newline\hspace*{\fill}\textbf{(theorem 1)}
\end{enumerate}
\end{document}
| improve this answer | |
  • 1
    thanks a lot @mico – El Numeral May 24 at 8:41
  • What if the last line is short? You'll get a big hole. – egreg May 24 at 12:21
  • Besides, \null is not a documented command and \hspace*{\fill} should be used instead of \null\hfill. – egreg May 24 at 12:38
  • @Mico I read a few times the LaTeX manual and I can assure you that \null is not metioned. ;-) – egreg May 24 at 13:47
  • 1
    Thank you, that clarifies it :-) – Mast May 25 at 14:50
12

You don't want the remark to go to the next line if the last line of the paragraph is short.

Here I propose a better solution, comparing to the output one gets with the code suggested by Mico.

enter image description here

As you see, the other proposal leaves big holes in the second and third case.

The code below comes from another answer of mine.

\documentclass{article}

\newcommand{\what}[1]{% the Bourbaki trick
  \unskip{\nobreak\hfill\penalty50\hskip1em\null\nobreak
   \hfill\mbox{\normalfont\bfseries(#1)}%
   \parfillskip=0pt \finalhyphendemerits=0 \par}%
}

\begin{document}

\section{My proposal}

\begin{enumerate}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla
\what{Theorem 1}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla
\what{Theorem 1}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\what{Theorem 1}

\end{enumerate}

\section{Less attractive output}

\begin{enumerate}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla
\newline\null\hfill\textbf{(theorem 1)}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla
\newline\null\hfill\textbf{(theorem 1)}

\item bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\newline\null\hfill\textbf{(theorem 1)}

\end{enumerate}

\end{document}
| improve this answer | |
  • @Schrödinger'scat No, that's not the result of another answer, which in the test case is good. Check the picture. However, I'll change the wording. – egreg May 24 at 20:39
  • thanks a lot! it helps me so much. – El Numeral May 26 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.