15.07.2013 Views

The csquotes Package

The csquotes Package

The csquotes Package

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

\DeclareQuoteStyle[official]{newspeak}<br />

{\textquotedblleft}{\textquotedblright}<br />

{\textquoteleft}{\textquoteright}<br />

\DeclareQuoteStyle[unofficial]{newspeak}<br />

{\textquotedblright}{\textquotedblleft}<br />

{\textquoteright}{\textquoteleft}<br />

<strong>The</strong> ocial variant should be the default for this style. <strong>The</strong>re is no need to copy the<br />

definition of the official variant to accomplish that. We simply define an alias<br />

labeled newspeak which points to the desired variant:<br />

\DeclareQuoteAlias[official]{newspeak}{newspeak}<br />

<strong>The</strong> reason why we are using variants and aliases instead of two independent styles<br />

will become clear in a moment. Suppose that the babel package oered support<br />

for Newspeak, but this language was known to babel as otherspeak:<br />

\DeclareQuoteAlias{newspeak}{otherspeak}<br />

This is an example of a second-level alias pointing to a first-level alias. If the current<br />

language is otherspeak, the above aliases will be expanded as follows:<br />

otherspeak = newspeak = newspeak/official<br />

We also define a new package option to choose a style variant:<br />

\DeclareQuoteOption{newspeak}<br />

This will add a new package option with a key called newspeak. <strong>The</strong> value of<br />

this option may be any variant of the newspeak style defined in the configuration<br />

file. In this example, there are two possible values: official and unofficial. To<br />

select the default or the alternative style for the entire document we use:<br />

\usepackage[style=newspeak]{<strong>csquotes</strong>}<br />

\usepackage[style=newspeak,newspeak=unofficial]{<strong>csquotes</strong>}<br />

To select the default or the alternative style with multilingual support we use:<br />

\usepackage[babel]{<strong>csquotes</strong>}<br />

\usepackage[babel,newspeak=unofficial]{<strong>csquotes</strong>}<br />

<strong>The</strong> base style must be implemented as an alias in this case since the newspeak<br />

option will select a variant by redefining and thus overwriting the newspeak alias.<br />

Since the otherspeak alias points to newspeak and not directly to any backend<br />

style, using the newspeak option will also have the desired eect if multilingual<br />

support is enabled. Note that there are some style names which have a special<br />

meaning. See § 10.9 for details.<br />

9.2 Using Quotation and Citation Hooks<br />

Style guides for writers usually make detailed provisions concerning the formatting<br />

of quotations and citations, including rules dealing with punctuation placement.<br />

This section will discuss some typical usage scenarios, using hooks and other facilities<br />

introduced in §§ 8.7, 8.8, 8.9. In the examples below, we assume the following<br />

input:<br />

22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!