2

I'm trying to forge a macro to produce nice formatting for pairs of sample Japanese sentences and their translation, but I seem to have run into a problem with indentation.

If I have a hard line break (\\) and the following line starts with the opening quote 「, the quote gets negatively indented into the margin. There's actually nothing wrong with this -- hanging punctuation is normal and desirable in Japanese typography -- but the first line's does not get the same hanging indent.

How do I get these quotation marks aligned?

(I'd prefer to have them aligned the same as the western quotation marks that come right below. The relevant negative indent removed altogether, I think.)

 % good
    「疲れたか」
    「いいや、ちっとも」
    "Are you tired?"
    "No, not at all."

 % bad
    「疲れたか」
   「いいや、ちっとも」
    "Are you tired?"
    "No, not at all."

The code:

\documentclass[12pt,a5paper]{article}

\usepackage{geometry}
\usepackage{lipsum}

\usepackage{xeCJK}
\setCJKmainfont{Hiragino Mincho Pro}

\newcommand{\example}[2]
{\medbreak%
\begingroup% make parindent change local
\setlength{\parindent}{0mm}%
#1
\par\textit{#2}%
\endgroup%
\medbreak}



% some sample sentences for testing the macro
% taken from tanaka corpus, except the haiku

\newcommand{\mkex}{%
\example
{青いスーツ、白いシャツ、赤いネクタイが男性従業員全員の必需品だ。}
{A blue suit, white shirt and red tie are essential for all male workers.}

\example
{「疲れたか」\\「いいや、ちっとも」}
{``Are you tired?'' \\ ``No, not at all.''}

\example
{コンタクトすると目が乾いた感じになって、目が赤くなります。}
{When I use contacts my eyes feel dry and become red.}

\example
{「寝てた?」\\
「爆睡」\\
「そ、そうか?」\\
「なんかうなされてたよ。怖い夢でも見てた?」}
{``I fell asleep?'' \\
``Totally.'' \\
``Really?'' \\
``You were very restless, did you have a scary dream?''}

\example
{ネクタイを締める間、ちょっとじっとしてね。}
{Hold still a moment while I fix your tie.}

\example
{花火の弾ける音が止むと、急に辺りが静かになる。後に残った火薬の匂いが、なんだか俺をセンチメンタルな気分にさせた。}
{As the popping sound of the fireworks stopped, it suddenly became quiet
around me. The smell of gunpowder somehow put me in a sentimental mood.}

\example
{古池や \\
蛙飛び込む \\
水の音}
{old pond\ldots \\
a frog leaps in \\
water's sound}

\example
{ウィルソンの解法は、同じ定数を使用したという点でハドソンのものと類似している。}
{Wilson's solution is similar to Hudson's in that they used the same constants.}

\example
{人の出会いなんて、なんだかんだ、最初のインパクトで50%以上は決まってしまっている。}
{When people meet, first impressions determine more than 50 percent of whatever
happens next.}

\example
{「なんだか焦げ臭いね」\\
「うっかりパンを黒こげにしちゃったの」}
{``Can you smell something burning?'' \\
``Oh, I went and burnt the toast.''}
}



\begin{document}
\lipsum[1]

\mkex

\lipsum
\end{document}

My texlive is somewhat dated (2009), so if newer versions behave differently, I'd like to know.

  • Welcome to TeX.SX! My chrystal ball says: Update to TeXLive 2014 (as a general remark) – user31729 Oct 9 '14 at 18:19
2

enter image description here

Using the latest TeX Live 2014 (with xeCJK 2014/06/20 v3.2.13), there is no error.

It is a very old bug of xeCJK, and is roughly fixed since TeX Live 2013 (with xeCJK 2013/05/28 v3.2.1). There may be still some special situations that xeCJK cannot handle well, but you can hardly meet the issue now.

Anyway, it is always preferred to use an empty line to start a new paragraph rather than break the line with \\.

  • 1
    It is issue 114 and some derivative revisions. – Qing Lee Oct 11 '14 at 3:08
  • I upgraded to texlive 2013 (I think; whatever's included with ubuntu 14.04) and it seems to indeed fix the problem. – oals Oct 12 '14 at 11:19
  • I originally settled on \` because it seemed to suppress indentation (but it currently seems unnecessary since I suppressed it through other means). I tried to start new paragraphs (empty line or \par`) as you suggested but just got compilation errors; but that's probably material for a new question. – oals Oct 12 '14 at 11:36

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.