Nested quotations

From ConTeXt wiki

Jump to: navigation, search

The following commands can be used to automatically nest double and single quotes. \dq and \sq can be used to force double or single quotation. It is better to use the Context commands below. These plain Tex commands simply alternate single and double quotes, whether nested or not.

\def\q#1{%
  \dq{#1}}

\def\dq#1{%
  \def\q##1{\sq{##1}}%
  \quotation{#1}}

\def\sq#1{%
  \def\q##1{\dq{##1}}%
  \quote{#1}}

A poorly worded example:

Testing, \q {A long quotation in which one character says, \q {Eh? What
am I supposed to say? Something like, \q {Quotations
in this sentance are nested}?}} testing, 1, 2, 3.


[edit] The ConTeXt alternative is:

\setupdelimitedtext
  [quotation]
  [1]
  [left={\symbol[leftquotation]},
   right={\symbol[rightquotation]}]

\setupdelimitedtext
  [quotation]
  [2]
  [left={\symbol[leftquote]},
   right={\symbol[rightquote]}]

\setupdelimitedtext
  [quotation]
  [3]
  [left={\symbol[leftquotation]},
   right={\symbol[rightquotation]}]

Testing, \quotation{A long quotation in which one character says,
\quotation{Eh? What am I supposed to say? Something like, \quotation{Quotations in this sentence are nested}?}} testing, 1, 2, 3.

Personal tools
Toolbox