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:



\setCJKmainfont{Hiragino Mincho Pro}

\begingroup% make parindent change local

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

{A blue suit, white shirt and red tie are essential for all male workers.}

{``Are you tired?'' \\ ``No, not at all.''}

{When I use contacts my eyes feel dry and become red.}

{``I fell asleep?'' \\
``Totally.'' \\
``Really?'' \\
``You were very restless, did you have a scary dream?''}

{Hold still a moment while I fix your tie.}

{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.}

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

{Wilson's solution is similar to Hudson's in that they used the same constants.}

{When people meet, first impressions determine more than 50 percent of whatever
happens next.}

{``Can you smell something burning?'' \\
``Oh, I went and burnt the toast.''}




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

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.