[Tex/LaTex] align something to the right using tabbing

marginstabbing

I have two questions regarding the "tabbing" environment.
Basically I am trying to set up formatting for parallel translation. I would like the original Chinese aligned flush left with the English translation, with the verse number in brackets (here [11-9]) sticking just to the left of the Chinese text. I can't do this with a negative indent because the actual width of the brackets + verse-number varies. In Word or something I would use something like a right-aligned tab, so I thought I could do this with tabbing and perhaps the \< command, but no luck. Here is basically the closest I got to what I want, but the text doesn't really line up properly.

Also, in the "tabbing" environment, it seems to ignore whatever right margin is set; is there a way to fix this too?

\begin{quote}
\begin{tabbing}
    \hspace*{-3em} \= \hspace*{3em}\= \kill
    \>[11-9]\>
    顏淵死、子曰:「噫天喪予、天喪予。」\\
    When Yanyuan died, the master cried: “How cruel! Heaven is killing me! Heaven is killing me!”
\end{tabbing}
\end{quote}

I'm using XeLatex with the "article" class, in case that makes a difference.
Thanks for your help, and sorry if I was too verbose with my question; its my first time asking.

Best Answer

You don't need tabbing; just make a command that typesets the verse number in a zero width box:

\documentclass{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{lipsum} % just for the example
\usepackage{xeCJK}
\setmainfont{Linux Libertine O}
\setCJKmainfont{Hiragino Mincho Pro}

\newcommand{\versenum}[1]{%
  \makebox[0pt][r]{[#1]\enspace}\ignorespaces
}

\begin{document}
\lipsum[2]
\begin{flushleft}
\versenum{11-9}
顏淵死、子曰:「噫天喪予、天喪予。」\\*
When Yanyuan died, the master cried: “How cruel! Heaven is killing me! Heaven is killing me!”
\end{flushleft}
\lipsum[3]
\begin{list}{}{\leftmargin=5em \rightmargin=5em}\raggedright\item\relax
\versenum{11-9}
顏淵死、子曰:「噫天喪予、天喪予。」\\*
When Yanyuan died, the master cried: “How cruel! Heaven is killing me! Heaven is killing me!”
\end{list}
\lipsum[2]
\end{document}

You may want to look at the quoting package instead of making up a list manually.

enter image description here

You get the same result as with flushleft also using tabbing:

\begin{tabbing}
\=\=\kill
\>\versenum{11-9}\>
顏淵死、子曰:「噫天喪予、天喪予。」\\*
When Yanyuan died, the master cried: “How cruel! Heaven is killing me! Heaven is killing me!”
\end{tabbing}

but you need to set the verse number in a zero width box anyway.

A convenient definition for this would be

\newenvironment{vt}
 {\begin{tabbing}\=\=\kill}
 {\end{tabbing}}
\newcommand{\vtnum}[1]{\>\makebox[0pt][r]{[#1]\enspace}\>}

and the input would be

\begin{vt}
\vtnum{11-9}
顏淵死、子曰:「噫天喪予、天喪予。」\\*
When Yanyuan died, the master cried: “How cruel! Heaven is killing me! Heaven is killing me!”
\end{vt}