2

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.

2
  • Why are you using the quote environment? Could you elaborate on the surrounding context of the document?
    – Werner
    Jan 11, 2015 at 16:02
  • Basically, I was just using quote it because it was originally part of a block quote in a larger essay. With the solution provided below, I didn't have to change that aspect, fortunately, and basically the document looks more or less like the answer from @egreg below
    – Tom
    Jan 12, 2015 at 11:25

1 Answer 1

3

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}
4
  • Thank you very much, this is just what I was trying to do. I also found the info about the quoting environment. Since I'm quite a newbie, would you say that your solution would be the "canonical" way to do somethign like this (by which I guess I mean, move text outside the margins)? I mean, I knew about \makebox for enclosing text, but like I said my first intuition was to do it with tabs. Also, I wasn't really able to find a lot of examples for tabbing, so just out of curiosity, is it possible to the same thing using tabbing?
    – Tom
    Jan 12, 2015 at 11:33
  • @Tom You can do it with tabbing precisely as you did, just hiding \>\hfill[11-9]\> in a macro; instead of using -3em and 3em in the \kill line, just use 0pt. But with a list (quoting uses internally list) you have much more flexibility.
    – egreg
    Jan 12, 2015 at 12:37
  • Thanks again for your answer. If I understand you correctly I should have \begin{tabbing} \hspace{0pt} \= \hspace{0pt} \= \kill \>\hfill[11-9]\> 顏淵死… \\ …killing me!” \end{tabbing} ? If I do it like that then the [11-9] and the first few characters (顏淵死) overlap each other, and the \hfill doesn't seem to do anything. If I have -3em and 3em in the tabs, it has basically the desired effect, except that depending on the legnth of the verse number, the space between the right bracket and the first character changes throughough the document, which I was trying to avoid.
    – Tom
    Jan 13, 2015 at 14:02
  • @Tom I added a tabbing version.
    – egreg
    Jan 13, 2015 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .