# [Tex/LaTex] Right alignment of a single line

horizontal alignmentquoting

I have some pieces of metrical text, set in quoting environments, in which some verse halves are longer than a line. The standard verse environment would just break automatically and indent the second line. I am not so happy with that solution, and anyway I want to use the quoting environment for its flexibility. I would now actually like to try the following: Manually break the line, and right align its second half. But I don't quite get it working the way I want, I don't think I understand yet how \raggedleft works, see the following example:

\begin{document}
Some text here.
\begin{quoting}
Here some metrical text, longer than one line, and I want the
{\raggedleft second line to be right aligned.\quad 1\par}
%The result of the two lines above looks about what
%I want, but curiously "second" remains in the first line.
Here some metrical text, longer than one line, and I want the\\
{\raggedleft second line to be right aligned.\quad 1\par}
and another line.
%And if I force a line break, the first line gets indented oddly.
\end{quoting}
\end{document}


Another option might be to use verse and gmverse, but that would probably require more changes to my document which I would currently like to avoid. It's just around 10 lines I have to deal with, thus it's not such a big thing to do it manually. I might be able to live with the first solution in my example, I'm a bit scared though as I don't understand what LaTeX does there.

When you process the first example

Here some metrical text, longer than one line, and I want the
{\raggedleft second line to be right aligned.\quad 1\par}


the \par command appears when \raggedleft is in effect and so the whole paragraph will be ragged left. In the second case you're telling TeX where to break the first line, but the paragraph is ragged left nonetheless.

Here's how you can do it:

\documentclass{article}
\usepackage{quoting}
\begin{document}
Some text here.
\begin{quoting}[indentfirst=true]
Here some metrical text, longer than one line, and I want the\\
\hspace*{\fill}second line to be right aligned.\quad 1

Here some metrical text, longer than one line, and I want the\\
\hspace*{\fill}second line to be right aligned.\quad 1
\end{quoting}
\end{document}