Difference between revisions of "Quotes"

From Wiki
Jump to navigation Jump to search
m
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
< [[Visuals]]
 
 
 
==Basic commands==
 
==Basic commands==
  
Line 6: Line 4:
 
Quotation marks and formatting are language dependent.
 
Quotation marks and formatting are language dependent.
  
; single quotes : <cmd>quote</cmd><tt>{some text}</tt>
+
; single quotes : {{cmd|quote|{some text}}}
; double quotes : <cmd>quotation</cmd><tt>{some text}</tt>
+
; double quotes : {{cmd|quotation|{some text}}}
; long quote sections : try <cmd>startquote</cmd> or <cmd>startquotation</cmd> etc.
+
; long quote sections : try {{cmd|startquote}} or {{cmd|startquotation}} etc.
  
  
Line 15: Line 13:
 
The following commands can be used to automatically nest double and single quotes.
 
The following commands can be used to automatically nest double and single quotes.
  
<texcode>
+
<context source="yes">
 +
\setuppapersize[A5]
 +
 
 
\setupdelimitedtext
 
\setupdelimitedtext
 
   [quotation]
 
   [quotation]
Line 33: Line 33:
 
   [left={\symbol[leftquotation]},
 
   [left={\symbol[leftquotation]},
 
   right={\symbol[rightquotation]}]
 
   right={\symbol[rightquotation]}]
</texcode>
 
  
<texcode>
+
\quotation{A long quotation in which one character says,
Testing, \quotation{A long quotation in which one character says,
 
 
\quotation{Eh? What am I supposed to say? Something like, \quotation
 
\quotation{Eh? What am I supposed to say? Something like, \quotation
{Quotations in this sentence are nested}?}} testing, 1, 2, 3.
+
{Quotations in this sentance are nested}?}}
</texcode>
+
</context>
 +
 
 +
 
 +
==Nested quotations in MkIV==
 +
 
 +
<context source="yes">
 +
\enableregime[utf]
 +
 
 +
\setuplanguage[cz]
 +
[leftquotation=„,
 +
rightquotation=“,
 +
leftquote=‚,
 +
rightquote=‘]
 +
 
 +
\mainlanguage[cz]
 +
 
 +
\starttext
 +
Following example is not correct. Typography rules for Czech language
 +
for quotes \quotation{of text in quotes define \quotation{nested inner} quotes}.
 +
 
 +
And now correct version. Typography rules for Czech language for quotes
 +
\quotation{of text in quotes define to \quote{nested inner} quotes}.
  
<context>
+
\setupdelimitedtext[quotation:1][left={\symbol[leftquotation]},right={\symbol[rightquotation]}]
\setupdelimitedtext
+
\setupdelimitedtext[quotation:2][left={\symbol[leftquote]}, right={\symbol[rightquote]}]
  [quotation]
+
 
  [1]
+
Automatic nesting. Typography rules for Czech language for quotes \quotation{of
  [left={\symbol[leftquotation]},
+
text in quotes define to \quotation{nested inner} quotes}.
  right={\symbol[rightquotation]}]
 
  
\setupdelimitedtext
+
\setupdelimitedtext[quotation:1][left=»,right=«]
  [quotation]
+
\setupdelimitedtext[quotation:2][left=,right=]
  [2]
 
  [left={\symbol[leftquote]},
 
  right={\symbol[rightquote]}]
 
  
\setupdelimitedtext
+
Another type of quotes now. Typography rules for Czech language for French quotes
  [quotation]
+
\quotation{of text in quotes define to \quotation{nested inner} quotes}.
  [3]
+
\stoptext
  [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 sentance are nested}?}} testing, 1, 2, 3.
 
 
</context>
 
</context>
 
  
 
==Long quotations and extracts==
 
==Long quotations and extracts==
Line 70: Line 79:
 
The following may serve as a guide to others in formatting long quotations or extracts:
 
The following may serve as a guide to others in formatting long quotations or extracts:
  
===Long quotations defined with <cmd>definestartstop</cmd>===
+
===Long quotations defined with {{cmd|definestartstop}}===
  
 
In body text:
 
In body text:
Line 78: Line 87:
  
 
\definestartstop[extract][
 
\definestartstop[extract][
     before={\blank[extractdistance] %[extractdistance,force] causes spurious overfull \hbox warnings
+
     before={\blank[extractdistance] % [extractdistance,force] causes spurious  
 +
                                      % overfull \hbox warnings
 
     \setupnarrower[left=1.5pc,right=1.5pc]
 
     \setupnarrower[left=1.5pc,right=1.5pc]
 
     \startnarrower[left,right]
 
     \startnarrower[left,right]
Line 102: Line 112:
 
</texcode>
 
</texcode>
  
===Long quotations defined with <cmd>definedelimitedtext</cmd>===
+
===Long quotations defined with {{cmd|definedelimitedtext}} ===
  
 
In body text:
 
In body text:
Line 132: Line 142:
 
</texcode>
 
</texcode>
  
==Example using <cmd>setupdelimitedtext</cmd>==
+
==Example using {{cmd|setupdelimitedtext}}==
  
 
Here is how to get indented quotations set in small type:
 
Here is how to get indented quotations set in small type:
<texcode>
+
<context source="yes">
\setupdelimitedtext[blockquote][style={\setupbodyfont[9pt]}]
+
%\setupdelimitedtext[blockquote][style={\setupbodyfont[small]}]
 +
\setupdelimitedtext[blockquote][style=\slx,before={\setupinterlinespace[line=2.4ex]}]
 
Hello
 
Hello
 
\startblockquote
 
\startblockquote
 
\input knuth
 
\input knuth
\par
+
%\par
 
\stopblockquote
 
\stopblockquote
 
Hello
 
Hello
 +
</context>
 +
 +
The {{cmd|par}} inside the block quotation keeps TeX's paragraph builder happy.  Otherwise the last paragraph in the block quotation gets the wider linespacing of the outside environment rather than the narrower linespacing appropriate to the smaller text; Alternately, one can add <code>before={\setupinterlinespace}</code>, as shown above.
 +
 +
Using {{code|1=style=small}} does not work as well as <code>style={\setupbodyfont[small]}</code> or <code>style={\setupbodyfont[9pt]}</code>, because {{code|small}} shrinks only the font size but not the linespacing. Alternately, by using <code>before={\setupinterlinespace}</code>, one can then use commands such as <code>style=\tfx</code>, setting the size relatively rather than absolutely, advantageous for nestling and for inclusion in footnotes, for example.
 +
 +
== Pull quotes ==
 +
 +
Pull quotes can be implemented by floating a framed text. For example, the following definitions set up pull quotes with no border:
 +
 +
<texcode>
 +
 +
\definefloat[pullquote][pullquotes] % Define a new type of float
 +
\setupcaption[pullquote][location=none] % Set it to have no captions
 +
\defineframedtext[pullquote][frame=off] % Define a new type of framed text with no visible frame
 +
 +
</texcode>
 +
 +
You can then drop a pull quote in your main text like this:
 +
 +
<texcode>
 +
 +
\placepullquote[right]{}{
 +
\startpullquote[width=4cm]
 +
\tfc “All work and no play makes Jack a dull boy.”
 +
\stoppullquote}
 +
 
</texcode>
 
</texcode>
  
The <cmd>par</cmd> inside the block quotation keeps TeX's paragraph builder happy.  Otherwise the last paragraph in the block quotation gets the wider linespacing of the outside environment rather than the narrower linespacing appropriate to nine-point text.
 
  
Using <code>style=small</code> does not work as well as <code>style={\setupbodyfont[9pt]}</code> or <code>style={\setupbodyfont[10pt]}</code>, because <code>small</code> shrinks only the font size but not the linespacing.
+
 
 +
== Quotes symbols ==
 +
 
 +
=== Single quote ===
 +
 
 +
For short quotes you can switch the language (and depending setups like quotation marks) with the [[Languages#Language_tags|language tag]] like <tt>{</tt>{{cmd|de}} <tt>das ist Deutsch}</tt>.
 +
If you switch between longer sections or if the two-letter language code has some other meaning (like {{cmd|sl}} stands for <i>slanted</i> and can't be used to start Slovenian) you should use {{cmd|language}}<tt>[sl]</tt>.
 +
 
 +
=== Quotesingle ===
 +
 
 +
‘quotesingle’ (Unicode character 0x0027) is the unsexed single quotation mark (or quote, or apostrophe) character '. Putting this character in a ConTeXt (or other TeX) source file will usually result in the the ’ (quoteright) character in the output. Usually, this is what you want: it lets you use the more easily typed ' as an apostrophe in the source file, and have it typeset as the more aesthetically pleasing ’.
 +
 
 +
However, this causes problems if you actually want the ' character itself in the output. In MkIV, for OpenType fonts, the substitution is controlled by a non-standard OTF feature called trep (short for ‘TeX replacements’). So we can get the ' character throughout the document by ensuring that this feature is switched off in the defaults:
 +
 
 +
<texcode>
 +
\definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=no,mode=node]
 +
\starttext
 +
A straight quotation mark: '
 +
\stoptext
 +
</texcode>
 +
 
 +
But perhaps you want TeX replacement on by default so you can keep getting pretty apostrophes, and you just need the quotesingle character occasionally. In this case you can define a special feature set and activate it only when necessary.
 +
 
 +
<texcode>
 +
\definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=yes,mode=node]
 +
\definefontfeature[notrep][trep=no]
 +
\def\realquotesingle{{\addfs{notrep}'}}
 +
\starttext
 +
A straight quotation mark: \realquotesingle .
 +
A normal quotation mark: '.
 +
\stoptext
 +
</texcode>
 +
 
 +
Note that ‘mode=node’ is necessary for this to work. Also, as stated, this technique applies only to OTF fonts under MkIV.
 +
See also [http://www.ntg.nl/pipermail/ntg-context/2011/thread.html#57834 this mailing list discussion].
 +
 
 +
 
 +
clean up between wiki pages ==> merge with Quotes, in symbol part
 +
 
 +
[[Category:Basics]]

Latest revision as of 20:14, 8 June 2020

Basic commands

Don't try to type quotation marks, but use logical markup! Quotation marks and formatting are language dependent.

single quotes 
\quote{some text}
double quotes 
\quotation{some text}
long quote sections 
try \startquote or \startquotation etc.


Nested quotations

The following commands can be used to automatically nest double and single quotes.

\setuppapersize[A5]

\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]}]

\quotation{A long quotation in which one character says,
\quotation{Eh? What am I supposed to say? Something like, \quotation
{Quotations in this sentance are nested}?}}


Nested quotations in MkIV

\enableregime[utf]

\setuplanguage[cz]
[leftquotation=„,
 rightquotation=“,
 leftquote=‚,
 rightquote=]
  
\mainlanguage[cz]

\starttext
Following example is not correct. Typography rules for Czech language 
for quotes \quotation{of text in quotes define \quotation{nested inner} quotes}.
  
And now correct version. Typography rules for Czech language for quotes
\quotation{of text in quotes define to \quote{nested inner} quotes}.

\setupdelimitedtext[quotation:1][left={\symbol[leftquotation]},right={\symbol[rightquotation]}]
\setupdelimitedtext[quotation:2][left={\symbol[leftquote]}, right={\symbol[rightquote]}]
  
Automatic nesting. Typography rules for Czech language for quotes \quotation{of 
text in quotes define to \quotation{nested inner} quotes}.

\setupdelimitedtext[quotation:1][left=»,right=«]
\setupdelimitedtext[quotation:2][left=›,right=]

Another type of quotes now. Typography rules for Czech language for French quotes 
\quotation{of text in quotes define to \quotation{nested inner} quotes}.
\stoptext 

Long quotations and extracts

The following may serve as a guide to others in formatting long quotations or extracts:

Long quotations defined with \definestartstop

In body text:

\defineblank[extractdistance][3pt]

\definestartstop[extract][
     before={\blank[extractdistance]  % [extractdistance,force] causes spurious 
                                      % overfull \hbox warnings
    	\setupnarrower[left=1.5pc,right=1.5pc]
    	\startnarrower[left,right]
	\noindent},
      after={\stopnarrower
   	\blank[extractdistance]
	\indenting[yes]}]

In footnotes:

\defineblank[footenoteextractdistance][2.7pt]

\definestartstop[fnextract][
      before={\blank[footenoteextractdistance]
    	\setupnarrower[left=1.5pc,right=1.5pc]
    	\startnarrower[left,right]
	\noindent},
      after={\stopnarrower
   	\blank[footenoteextractdistance]
	\indenting[yes]}]

Long quotations defined with \definedelimitedtext

In body text:

\defineblank[extractdistance][3pt]

\definedelimitedtext[extract][blockquote]

\setupdelimitedtext
  [extract]
  [spacebefore=extractdistance,
   leftmargin=1.5pc,
   before={\setupindenting[next]}]

In footnotes:

\defineblank[footenoteextractdistance][2.7pt]

\definedelimitedtext[fnextract][blockquote]

\setupdelimitedtext
  [fnextract]
  [spacebefore=footenoteextractdistance,
   leftmargin=1.5pc,
   before={\setupindenting[next]}]

Example using \setupdelimitedtext

Here is how to get indented quotations set in small type:

%\setupdelimitedtext[blockquote][style={\setupbodyfont[small]}]
\setupdelimitedtext[blockquote][style=\slx,before={\setupinterlinespace[line=2.4ex]}]
Hello
\startblockquote
\input knuth
%\par
\stopblockquote
Hello

The \par inside the block quotation keeps TeX's paragraph builder happy. Otherwise the last paragraph in the block quotation gets the wider linespacing of the outside environment rather than the narrower linespacing appropriate to the smaller text; Alternately, one can add before={\setupinterlinespace}, as shown above.

Using style=small does not work as well as style={\setupbodyfont[small]} or style={\setupbodyfont[9pt]}, because small shrinks only the font size but not the linespacing. Alternately, by using before={\setupinterlinespace}, one can then use commands such as style=\tfx, setting the size relatively rather than absolutely, advantageous for nestling and for inclusion in footnotes, for example.

Pull quotes

Pull quotes can be implemented by floating a framed text. For example, the following definitions set up pull quotes with no border:


\definefloat[pullquote][pullquotes] % Define a new type of float
\setupcaption[pullquote][location=none] % Set it to have no captions
\defineframedtext[pullquote][frame=off] % Define a new type of framed text with no visible frame

You can then drop a pull quote in your main text like this:


\placepullquote[right]{}{
\startpullquote[width=4cm] 
\tfc “All work and no play makes Jack a dull boy.”
\stoppullquote}


Quotes symbols

Single quote

For short quotes you can switch the language (and depending setups like quotation marks) with the language tag like {\de das ist Deutsch}. If you switch between longer sections or if the two-letter language code has some other meaning (like \sl stands for slanted and can't be used to start Slovenian) you should use \language[sl].

Quotesingle

‘quotesingle’ (Unicode character 0x0027) is the unsexed single quotation mark (or quote, or apostrophe) character '. Putting this character in a ConTeXt (or other TeX) source file will usually result in the the ’ (quoteright) character in the output. Usually, this is what you want: it lets you use the more easily typed ' as an apostrophe in the source file, and have it typeset as the more aesthetically pleasing ’.

However, this causes problems if you actually want the ' character itself in the output. In MkIV, for OpenType fonts, the substitution is controlled by a non-standard OTF feature called trep (short for ‘TeX replacements’). So we can get the ' character throughout the document by ensuring that this feature is switched off in the defaults:

\definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=no,mode=node]
\starttext
A straight quotation mark: '
\stoptext

But perhaps you want TeX replacement on by default so you can keep getting pretty apostrophes, and you just need the quotesingle character occasionally. In this case you can define a special feature set and activate it only when necessary.

\definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=yes,mode=node]
\definefontfeature[notrep][trep=no]
\def\realquotesingle{{\addfs{notrep}'}}
\starttext
A straight quotation mark: \realquotesingle .
A normal quotation mark: '.
\stoptext

Note that ‘mode=node’ is necessary for this to work. Also, as stated, this technique applies only to OTF fonts under MkIV. See also this mailing list discussion.


clean up between wiki pages ==> merge with Quotes, in symbol part