メモ帳

備忘録

TeXで引用符のネストにより'と"が連続してしまう場合は\thinspaceでスペースを空けるとよい

解決方法

``Nested `quotation'\thinspace''のように\thinspaceコマンドを入れるとよい。

理由

``Nested `quotation'''とすると、最後の'''の部分が、ダブルクォーテーションの後にシングルクォーテーションが続いていると解釈され、「” ’」と表示されてしまい、クォーテーションの対応が合わなくなる。 これを回避するために{'}''とすると、等間隔な三つのシングルクォートのように見えてしまう。 また、空白文字を追加して' ''とすると、スペースが大きすぎる。 '\thinspace''とすることで適切な表示が得られる。

Donald E. Knuth, The TeXbook, p. 5より引用:

In case you need to type quotes within quotes, for example a single quote followed by a double quote, you can’t simply type ''' because  {\TeX} will interpret this as ”’ (namely, double quote followed by single quote). If you have already read Chapter 5, you might expect that the solution will be to use grouping—namely, to type something like {'}''. But it turns out that this doesn’t produce the desired result, because there is usually less space following a single right quote than there is following a double right quote: What you get is ’”, which is indeed a single quote followed by a double quote (if you look at it closely enough), but it looks almost like three equally spaced single quotes. On the other hand, you certainly won’t want to type ' '', because that space is much too large—it’s just as large as the space between words—and  {\TeX} might even start a new line at such a space when making up a paragraph! The solution is to type '\thinspace'', which produces ’” as desired.