§ INTRODUCTION

§.§ About csquotes

This package provides advanced facilities for inline and display quotations. It is designed for a wide range of tasks ranging from the most simple applications to the more complex demands of formal quotations. The facilities include commands, environments, and user"=definable <smart quotes> which dynamically adjust to their context. Quotation marks are switched automatically if quotations are nested and can adjust to the current language. There are additional features designed to cope with the more specific demands of academic writing. All quote styles as well as the optional active quotes are freely configurable.

§.§ License

Copyright © 2003–2011 Philipp Lehman, 2015–2018 Joseph Wright. Permission is granted to copy, distribute andor modify this software under the terms of the , version 1.3c or any later version.http://www.latex-project.org/lppl/

§.§ Contributions

The multilingual support of this package depends on user contributions. If you want to contribute a quote style, please refer to cfg:sty for an overview of the components a quote style is composed of and to tab:out for a list of commands which should be used in the definition of quote styles.

§ PACKAGE OPTIONS

All package options are given in syntax.

§.§ Main Options

This option turns all package warnings into error messages. This is useful to ensure that no problem will go unnoticed when finalizing a document. The short form strict is equivalent to stricttrue.

This option selects a fixed quotation style. The style is used throughout the document unless it is changed manually, see bas:set for details. This option implicitly sets autostylefalse. Please refer to tab:sty,tab:als for a list of available quote styles and aliases. See cfg:sty,cfg:als,use:spl for instructions on adding or modifying quote styles.

[tryonce]autostyletrue, false, try, once, tryonce

This option controls multilingual support. It requires either the babel package or the polyglossia package.[Note that polyglossia support is currently in a preliminary state because polyglossia is lacking a proper interface for other packages. In practice, this means that csquotes can detect the language () but not the language variant ().] autostyletrue continuously adapts the quote style to the current document language; once will only adapt the style once so that it matches the main language of the document. autostyletry and tryonce are similar to true and once if multilingual support is available but will not issue any warnings if not (if neither babel nor polyglossia have been loaded). The short form autostyle is equivalent to autostyletrue. See also bas:set.

1@HOption key     1@HPossible values

austrian	    quotes, guillemets

croatian	    quotes, guillemets, guillemets

czech		    quotes, guillemets

danish	    quotes, guillemets, topquotes

english	    american, british

french	    quotes, quotes, guillemets, guillemets

galician	    quotes, guillemets

german	    quotes, guillemets, swiss

italian	    guillemets, quotes

norwegian	    guillemets, quotes

portuguese	    portuguese, brazilian

spanish	    spanish, mexican

swedish	    quotes, guillemets, guillemets

[Language Options]Language Options Defined by Default

Use the language options listed in tab:lng to choose a style variant if there is more than one for a certain language. The first variant in the list is the default for the respective style. In the following example, the autostyle option causes csquotes to continuously adapt the quote style to the current language using the default style for that language. The defaults for German and Norwegian are changed:

Note that babel's language name is ngerman here whereas csquotes uses german. When selecting a quote style automatically, this package will essentially normalize the language names first, using a list of aliases which map languages to quote styles. See tab:als for details. tab:lng indicates the language options defined by default. Additional options may be defined in the configuration file. See cfg:opt,use:spl for details. Also see hnt:pre for some additional notes concerning the predefined styles.

This option controls the maximum nesting level of quotations. By default, this package supports two levels of quotations, outer and inner ones, and issues an error if quotations are nested more deeply. Alternatively, it can reuse the outer and inner quotes on further quotation levels. This alternative behavior is enabled implicitly when increasing the value of the maxlevel option. The minimum is .

This option controls whether the quotation commands scan ahead for trailing punctuation marks. See bas:txt:reg,bas:blk:reg,int:txt:reg,int:blk:reg for details. Also see DeclareAutoPunct in cfg:dap and cfg:aux on how to configure and use the punctuation look-ahead feature. The short form autopunct is equivalent to autopuncttrue.

This option defines the number of lines or words the block quotation facilities use as a threshold when determining whether a quotation should be typeset in inline or in display mode. It corresponds to the SetBlockThreshold command. See bas:blk:reg, cfg:blk for further details.

[lines]thresholdtypelines, words

This option selects the block threshold type. With thresholdtypelines, the block quotation facilities will determine the number of lines required to typeset the quotation; with thresholdtypewords, they count the number of words in the quotation.[The word counting code is based on an idea by Donald Arseneau.] The default threshold setup is 3 lines. If you prefer something like 50 words, set threshold50 and thresholdtypewords. See bas:blk:reg for further details.

This option fine-tunes the block threshold detection. If enabled, any explicit paragraph or line break in the quotation will trigger the threshold, the quotation will be typeset in display mode regardless of its length. If disabled, explicit paragraph or line breaks are applied normally if thresholdtypelines, and treated as a regular word boundary if thresholdtypewords. The short form parthreshold is equivalent to parthresholdtrue.

This option is applicable with thresholdtypewords only. It fine-tunes the handling of compounds with explicit hyphens. If enabled, compounds are split up at all hyphens and the components are counted as separate words. If disabled, compounds are treated as a single word. The short form splitcomp is equivalent to splitcomptrue.

By default, the block quotation facilities will automatically force inline quotations in footnotes, parboxes, minipages, and floats. Setting this option to  will permit context-sensitive switching to display quotations in these contexts, as in the text body. The short form csdisplay is equivalent to csdisplaytrue. This option may also be set locally with csdisplaytrue and csdisplayfalse, respectively.

This option controls the debugging feature of the block quotation facilities. If enabled, all block quotation commands will output diagnostic messages to the transcript file. These messages indicate the calculated lineword count, explicit paragaph or line breaks detected in the quotation text, and the final inlinedisplay determination. The short form debug is equivalent to debugtrue.

§.§ Compatibility Options

versionversion, 4.4, 3.6, 3.0

This option is an attempt at making csquotes backwards compatible with earlier versions, at least to some extent. Currently, it supports backwards compatibility with version 4.4, which covers 3.7–4.4, version 3.6, which covers 3.1–3.6, and version 3.0. Older versions are not supported. It is possible to specify any arbitrary version, even if it is not explicitly listed above. In this case, the package will keep increasing the version number until it either finds a suitable compatibility mode or hits the current version number. For example, when specifying version4.0, csquotes will increase the version number until it hits 4.4, and activate the v4.4 compatibility mode because this is the highest version still compatible with the requested 4.0 release. This implies that csquotes may be invoked in a, to some extent, <future proof> way by making the version which is current at the time of writing sticky. If future versions break backwards compatibility, they will automatically activate the best compatibility mode. If not, the version option will simply have no effect.

babeltrue, false, try, once, tryonce

An older name of the autostyle option. This option is depreciated.

§ BASIC INTERFACE

This package supports two ways to tag quotations: built-in commands and active quotes defined in the document preamble or the configuration file. This section will introduce the basic commands, active quotes are discussed in act. When working with automated citations, you might also want to learn about the integrated quotation facilities presented in cit.

§.§ Quoting Regular Text

The most basic command will simply enclose its argument in quotation marks:

Like all quotation facilities, this command is context sensitive. Depending on the nesting level, it will toggle between outer and inner quotation marks with plain and nested quotations. The starred version of this command skips directly to the inner level. If multilingual support is enabled, the style of all quotation marks will be adapted to the current language.

§.§ Quoting Text in a Foreign Language

To facilitate typesetting quotations in a foreign language, csquotes provides two commands which combine enquote with the language switches of the babel or the polyglossia package:

This command combines enquote with foreignlanguage. It switches hyphenation patterns and enables the extra definitions provided by babelpolyglossia for lang, which must be a language name known to the respective package. The quotation marks will match the language of the quoted piece of text.

This command combines enquote with the hyphenrules environment, that is, it merely switches hyphenation patterns. The quotation marks will match the language of the text surrounding the quotation.

§.§ Formal Quoting of Regular Text

Formal quotations are typically accompanied by a citation indicating the source of the quoted text. The following command is an extended version of enquote which encloses the quoted piece of text in quotation marks and adds a citation after the quotation:

The text may be any arbitrary piece of text to be enclosed in quotation marks. The optional arguments cite and punct specify the citation and any terminal punctuation of text. tpunct denotes trailing punctuation after the command. If the autopunct option is enabled, the quotation commands will scan ahead for punctuation marks immediately following their last argument and can move them around if required. See cfg:aux on how to change the way these arguments are handled and use:hok for reasons why you may want to specify the punctuation as a separate argument. The starred version of this command skips directly to the inner quotation level. Here are some usage examples:

[Doe 1990, 67]...

Note the use of the optional arguments in the examples above. As seen in the second example, cite is required whenever punct is used, even if it is empty. Also keep in mind that an optional argument containing square brackets must be wrapped in an additional pair of curly braces as shown in the last example. When working with automated citations, you might also want to learn about the integrated quotation facilities presented in cit.

§.§ Formal Quoting of Text in a Foreign Language

There are two additional commands which combine textquote with the language switches of the babel or the polyglossia package:

This command combines textquote with foreignlanguage. Apart from the language, the arguments are handled as with textquote.

This command combines textquote with the hyphenrules environment. Apart from the language, the arguments are handled as with textquote.

§.§ Block Quoting of Regular Text

Formal requirements in academic writing frequently demand that quotations be embedded in the text if they are short but set off as a distinct and typically indented paragraph, a so-called block quotation, if they are longer than a certain number of lines or words. In the latter case no quotation marks are inserted. The following command deals with this requirement automatically:

This command determines the length of the text. If the length exceeds a certain threshold, the text will be typeset in display mode, as a block quotation. If not, blockquote will behave like textquote. Depending on the thresholdtype option, the threshold may be based on the number of lines required to typeset the text or on the number of words in the text. If the parthreshold option has been enabled, any explicit paragraph or line break in the text will trigger the threshold, it will be typeset in display mode regardless of its length. The default threshold setup is three lines with parthreshold enabled. The default environment used for display quotations is the quote environment. See opt:opt, cfg:blk on how to change these parameters. Note that csquotes will force inline quotations in footnotes, parboxes, minipages, and floats by default. Use the csdisplay option from opt:opt to change this behavior. The optional arguments cite and punct specify the citation and any terminal punctuation of the text. tpunct denotes trailing punctuation after the command. If the autopunct option is enabled, the quotation commands will scan ahead for punctuation marks immediately following their last argument and can move them around if required. See cfg:aux on how to change the way these arguments are handled and use:hok for reasons why you may want to specify the punctuation as a separate argument.

§.§ Block Quoting of Text in a Foreign Language

The following commands combine blockquote with the language switches of the babel or the polyglossia package:

This command behaves like foreignquote if the quotation is short. If it exceeds the threshold, it will be wrapped in an otherlanguage* environment which is in turn wrapped in a block quotation environment. The arguments are handled as with blockquote.

This command behaves like hyphenquote if the quotation is short. If it exceeds the threshold, it will be wrapped in a hyphenrules environment which is in turn wrapped in a block quotation environment. The arguments are handled as with blockquote.

This command behaves like hyphenquote if the quotation is short. If it exceeds the threshold, the command behaves like foreignblockquote. In other words, it combines features of foreignblockquote and hyphenblockquote. The arguments are handled as with blockquote.

§.§ Selecting Quote Styles

Quote styles may be selected manually at any point in the document body by way of the following command:

The regular form of this command selects a quote style and disables multilingual support. Its mandatory argument may be a quote style or an alias. If it is a quote style, the optional argument indicates the style variant. The starred version, which takes no arguments, enables multilingual support. Please refer to tab:sty,tab:als for a list of available styles, style variants, and language aliases.

§ ACTIVE QUOTES

This package also supports active characters corresponding to the commands presented in bas. Roughly speaking, an active character is a single character which functions as a command. Like the corresponding control sequences, active quotes are fully"=fledged markup elements which verify the nesting level and issue an error if quotations are nested in an invalid way. If multilingual support is enabled, the style of all quotation marks will be adapted to the current language. The commands presented in the following allocate such active quotes. They may be used in the configuration file, the preamble, or the document body. Note that all characters are automatically checked for validity as they are allocated. This package will reject characters which are unsuitable as active quotes. See hnt:val for details on the characters which may be used as active quotes.

§.§ Quoting Regular Text

MakeOuterQuote and MakeInnerQuote define active quotes which print outer and inner quotation marks. Both take one mandatory argument, the character serving as both opening and closing mark:

MakeAutoQuote defines active quotes which toggle between outer and inner quotations automatically. The two mandatory arguments serve as opening and closing mark and must be distinct:

MakeAutoQuotecharacter 1character 2
*MakeAutoQuote*character 1character 2

All active quotes defined with MakeAutoQuote work like enquote. Those defined with MakeOuterQuote and MakeInnerQuote cover only a part of this functionality. The former correspond to the outer level of enquote whereas the latter correspond to the starred version. MakeAutoQuote* is similar to MakeInnerQuote, i.e. it corresponds to enquote*.

§.§ Quoting Text in a Foreign Language

These commands combine MakeAutoQuote with the language switches of the babel or the polyglossia package:

MakeForeignQuotelangcharacter 1character 2
*MakeForeignQuote*langcharacter 1character 2

The active quotes defined with the above commands are similar in concept and function to foreignquote and foreignquote*, respectively.

MakeHyphenQuotelangcharacter 1character 2
*MakeHyphenQuote*langcharacter 1character 2

The active quotes defined with the above commands are similar in concept and function to hyphenquote and hyphenquote*, respectively.

§.§ Block Quoting of Regular Text

MakeBlockQuote defines active quotes which will set quotations inline or as a separate paragraph, depending on their length. This command takes three mandatory arguments which must be distinct:

MakeBlockQuotecharacter 1delimitercharacter 2

The arguments are checked for validity, see hnt:val for details. All active quotes defined with MakeBlockQuote behave essentially the same as blockquote, but the handling of the citation is slightly different. character 1 will serve as the opening mark in the source file, character 2 as the closing one. The character indicated by the middle argument delimiter will serve as a delimiter separating the quoted text from the citation which is given last as the active quotes are used:

If the delimiter is omitted, the entire text between the opening and the closing mark will be treated as quotation text.

§.§ Block Quoting of Text in a Foreign Language

These commands combine MakeBlockQuote with the language switches of the babel or the polyglossia package:

MakeForeignBlockQuotelangcharacter 1delimitercharacter 2

The active quotes defined with this command are similar in concept and function to foreignblockquote. The behavior of the delimiter character is similar to MakeBlockQuote.

MakeHyphenBlockQuotelangcharacter 1delimitercharacter 2

The active quotes defined with this command are similar in concept and function to hyphenblockquote. The behavior of the delimiter character is similar to MakeBlockQuote.

MakeHybridBlockQuotelangcharacter 1delimitercharacter 2

The active quotes defined with this command are similar in concept and function to hybridblockquote. The behavior of the delimiter character is similar to MakeBlockQuote.

§.§ Controlling Active Quotes

The commands introduced above merely allocate active quotes, but these characters are not immediately made active. All allocated quotes are automatically enabled at the beginning of the document body. If any active quotes are allocated in the document body, they need to be enabled with EnableQuotes. The following commands control the state of the active quotes within a local scope.

Enables all active quotes by redefining the allocated characters and making them active. It also restores them when disabled, set to verbatim, or overwritten.

Disables all active quotes by restoring the original category codes and definitions of all allocated characters.

Switches to verbatim active quotes. All active quotes will be printed verbatim until their default behavior is restored with EnableQuotes.

Disables and deallocates all active quotes, i.e. performs a complete reset of all allocated characters so that they may be newly defined.

§ INTEGRATED INTERFACE

The commands presented in this section are extended versions of some of those discussed in bas. They differ from their counterparts in that they integrate automated citations into their syntax. Instead of adding cite manually, you pass the citation arguments to the respective quotation command. See cfg:blk on how to use a command other than cite to handle the citations.

§.§ Formal Quoting of Regular Text

The basic integrated command is an extended version of textquote:

The text may be any arbitrary piece of text to be enclosed in quotation marks. The optional arguments cite and punct specify the citation and any terminal punctuation of text. tpunct denotes trailing punctuation after the command. If the autopunct option is enabled, the quotation commands will scan ahead for punctuation marks immediately following their last argument and can move them around if required. See cfg:aux on how to change the way these arguments are handled and use:hok for reasons why you may want to specify the punctuation as a separate argument. The starred version of this command skips directly to the inner quotation level. The remaining arguments are handed over to cite. Note that cite normally supports one optional argument only. prenote is only available in conjunction with the natbib, jurabib, and biblatex packages. How these arguments are handled depends on the citation command. With natbib and biblatex, prenote is in fact a notice such as <see>. With jurabib, this argument has a different function by default. The argument postnote, which is always available, indicates the citation postnote. This is usually a page number. key is the citation key. See cfg:blk,cfg:aux on how to customize the citation.

§.§ Formal Quoting of Text in a Foreign Language

The following commands combine textcquote with the language switches of the babel or the polyglossia package:

This command combines textcquote with foreignlanguage. The handling of the arguments is similar to textcquote.

This command combines textcquote with the hyphenrules environment. The handling of the arguments is similar to textcquote.

§.§ Block Quoting of Regular Text

Block quotations may be combined with automated citations by using the extended version of blockquote:

The difference between blockcquote and blockquote is that there are three citation arguments instead of one. The handling of these citation arguments is similar to textcquote; see int:txt:reg for details. Also see cfg:blk,cfg:aux,use:hok on how to customize block quotations.

§.§ Block Quoting of Text in a Foreign Language

The following commands combine blockcquote with the language switches of the babel or the polyglossia package:

This command combines blockcquote with foreignlanguage. Long quotations will be wrapped in an otherlanguage* environment. The handling of the citation arguments is similar to textcquote.

This command combines blockcquote with the hyphenrules environment. The handling of the citation arguments is similar to textcquote.

This command behaves like hyphenblockcquote if the quotation is short, and like foreignblockquote if it is long. The handling of the citation arguments is similar to textcquote.

§ DISPLAY ENVIRONMENTS

The environments introduced in this section will typeset quotations as a separate paragraph which looks exactly like a long quotation set by means of the block quotation facilities. Use them for quotations which are to be presented as a separate paragraph regardless of their length. Note that these environments are not replacements for the standard quote environment in the strict sense. They function as an additional layer on top of the latter, just like the block quotation facilities. The advantage of using these environments instead of resorting to the standard quote environment is that they are configurable, support citations, and will always be in sync with the block quotation facilities with respect to the configuration options discussed in cfg:blk,cfg:aux.

§.§ Basic Display Environments

The arguments of all display environments are generally appended to the begin section of the environment:

The optional arguments cite and punct specify the citation and any terminal punctuation of the quotation. See cfg:blk,cfg:aux on how to customize this environment. Also see cfg:aux on how to change the way the optional arguments are handled and use:hok for reasons why you may want to specify the punctuation as a separate argument. Trailing white space at the end of the environment is removed automatically. There are two additional environments which combine displayquote with the language switches of the babel or the polyglossia package:

This environment combines displayquote with otherlanguage*. Apart from the language, the arguments are handled as with displayquote.

This environment combines displayquote with hyphenrules. Apart from the language, the arguments are handled as with displayquote.

§.§ Integrated Display Environments

The following environment is an extended version of displayquote:

The difference between displaycquote and its more basic counterpart is that there are three citation arguments instead of one. The placement of the citation is similar to displayquote. The handling of the citation arguments is similar to textcquote, see int:txt:reg for details. See cfg:blk,cfg:aux on how to customize this environment. Also see cfg:aux on how to change the way the optional arguments are handled and use:hok for reasons why you may want to specify the punctuation as a separate argument. There are two environments which combine displaycquote with the language switches of the babel or the polyglossia package:

This environment combines displaycquote with otherlanguage*. Apart from the language, the arguments are handled as with displaycquote.

This environment combines displaycquote with hyphenrules. Apart from the language, the arguments are handled as with displaycquote.

§ AUXILIARY COMMANDS

When quoting text in a formal way, any changes applied to the quoted material, such as omissions, insertions, or alterations, are typically marked as such by using square brackets or parentheses and, where appropriate, ellipses. Use the following commands to indicate such changes in formal quotations:

When used with an empty text argument, this command prints an ellipsis symbol to indicate the omission of material from the quoted material. When used with a non-empty argument, the ellipsis symbol is followed by the text enclosed in square brackets to indicate that the text has been added after the omitted material. The starred version reverts the order, it prints the text followed by an ellipsis symbol to indicate that the text has been added before the omitted material. In sum, there are three ways to use this command:

The insertion of text or individual letters may be indicated with the following command:

By default, textins will enclose the text added to the quoted material in square brackets. The starred version is intended for minor changes, such as the capitalization of a word, which are required to adapt the quoted material to the new context in which it is quoted.

The deletion of individual letters may be indicated with the following command:

By default, textdel will output two square brackets. The omitted text is not output.

See cfg:elp on how to configure the appearance of ellipses and insertions.

§ CONFIGURATION

If available, this package will load the configuration file csquotes.cfg. You may use this file to define new quote styles and aliases or redefine existing ones.

1@HQuote style     1@HStyle variants

austrian	    quotes, guillemets

croatian	    quotes, guillemets, guillemets

czech		    quotes, guillemets

danish	    quotes, guillemets

dutch		    –

english	    american, british

finnish	    –

french	    quotes, quotes, guillemets, guillemets

german	    quotes, guillemets, swiss

greek		    –

italian	    guillemets, quotes

norwegian	    guillemets, quotes

portuguese	    portuguese, brazilian

russian	    –

spanish	    spanish, mexican

swedish	    quotes, guillemets, guillemets

[Styles and Variants]Quote Styles and Style Variants Defined by Default

§.§ Defining Quote Styles

Use the following command to define quote styles and style variants:

DeclareQuoteStyle[variant]style[outer init][inner init]

opening outer mark[middle outer mark]closing outer mark[kern]

opening inner mark[middle inner mark]closing inner mark

This command may be used in the configuration file or in the document preamble. The term <outer> refers to the first quotation level, <inner> means quotations within another quotation. A <middle mark> is a quotation mark inserted at the beginning of every paragraph within a quotation spanning multiple paragraphs. In most cases, the arguments defining the quotation marks will simply contain one of the commands listed in tab:out. If both an outer and an inner quotation begin or end simultaneously, the kerning specified by the value kern will be inserted between the adjoining quotation marks. While this value can be given in any unit known to , it is advisable to use the relative, font"=dependent unit <em> instead of absolute units such as points, inches, or millimeters. Note that kern is used as a fallback value only. If the font provides kerning data for the respective pair of quotation marks the font's kerning takes precedence. outer init and inner init are all"=purpose hooks initializing the quote style. Selecting a quote style will make these hooks available to all quotation commands without expanding them. The execution of outer init will take place immediately before the opening outer quote is inserted, but inside the group formed by the quotation. inner init is executed before the opening inner quote is inserted. It is advisable to avoid any global assignments in this context to prevent interference with other styles. Whenever inner init is used outer init has to be given as well, even if the argument is empty. Refer to tab:sty for a list of all predefined quote styles and their variants. These are the backend styles only, see also tab:als for a list of language aliases. See use:spl for some examples as well as an illustration of how quote styles, aliases, and package options interact.

§.§ Defining Quote Aliases

The following command defines quote aliases:

*DeclareQuoteAliasfirst-level aliassecond-level alias

This command may be used in the configuration file or in the document preamble. The alias may point to a backend style or to another alias. Most language aliases refer to a backend style, but some point to an intermediate alias instead. If the alias is defined for the sake of the babel or the polyglossia package, its name must be identical to the language name used by babelpolyglossia, the expansion of languagename. See use:spl for an illustration of how quote styles, aliases, and package options interact. A list of all aliases defined by default is given in tab:als.

1@HAlias     1@HBackend style or alias
1@HAlias     1@HBackend style or alias

american	    english/american
newzealand	    english/british

australian	    english/british
ngerman	    german

austrian	    austrian/quotes
norsk		    norwegian

brazil	    brazilian
norwegian	    norwegian/guillemets

brazilian	    portuguese/brazilian
nswissgerman	    swissgerman

british	    english/british
nynorsk	    norwegian

canadian	    english/american
portuges	    portuguese

croatian	    croatian/quotes
portuguese	    portuguese/portuguese

danish	    danish/quotes
spanish	    spanish/spanish

english	    english/american
swedish	    swedish/quotes

french	    french/quotes
swiss		    german/swiss

german	    german/quotes
swissgerman	    german/swiss

italian	    italian/guillemets
UKenglish	    british

mexican	    spanish/mexican
USenglish	    american

naustrian	    austrian

[Language Aliases]Language Aliases Defined by Default

§.§ Defining Package Options

The following command creates a new package option based on a keyvalue syntax. It takes one mandatory argument, the quote style name:

When using the new option, the name of the quote style will serve as the key. The value may be any style variant defined for the respective style. The package option will select a variant by defining an alias pointing to the desired backend style. This command is available in the configuration file only. See use:spl for an illustration of how quote styles, aliases, and package options interact.

§.§ Executing Package Options

Apart from passing options to this package as it is loaded, you may also execute options using the following command:

ExecuteQuoteOptionskey=value, …

This command permits presetting package options in the configuration file. It may also be used in the document preamble.

§.§ Defining Quotes for Strings

The following command specifies the quotation marks for strings:

DeclarePlainStyleopening outer markclosing outer mark

opening inner markclosing inner mark

This command may be used in the configuration file or in the document preamble. By default, outer quotations get straight double quotes and inner quotations straight single quotes. See hnt:pdf for additional hints concerning strings.

§.§ Configuring Quotations and Citations

The following commands change the default values used by various quotation facilities of this package. The commands affected by these parameters are indicated in tab:blk.

1@HParameter     21@HCommand or environment

Threshold	   _   _   _   _   _   _   _   _   _                     _   _   _   _   _   _

Environment	   _   _   _   _   _   _   _   _   _

Cite command	   _   _   _   _   _   _            _   _   _            _   _   _

[Configurable Parameters]Scope of Configurable Parameters

SetBlockThreshold defines the number of lines or words the block quotation facilities use as a threshold when determining whether a quotation should be typeset in inline or in display mode. The default is three. SetBlockEnvironment specifies the environment used for block and display quotations. It takes the name of an existing environment as its argument. The default is the quote environment provided by most document classes. The argument to SetCiteCommand specifies a replacement for cite which will be used by all integrated quotation facilities to handle citations. It must be a single command which takes one or two optional arguments followed by a mandatory one, the citation key. The default is cite. The citation commands of the natbib, jurabib, and biblatex packages, which take two optional arguments, are supported.

§.§ Hooks for Quotations and Citations

The appearance of quotes may be configured at a low level by redefining the hooks introduced below. This section will give an overview of their syntax. See use:hok for practical examples. The quotation facilities which are responsive to these hooks are indicated in tab:aux. Also see cfg:tst for tests which may be useful when redefining the hooks.

1@HHook     21@HCommand or environment

mktextquote	   _   _   _                                       _   _   _   _   _   _

mkblockquote	   _   _   _   _   _   _   _   _   _                     _   _   _   _   _   _

mkbegdispquote	   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _

mkenddispquote	   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _

mkcitation	   _   _   _            _   _   _            _   _   _            _   _   _

mkccitation	   _   _   _   _   _   _            _   _   _            _   _   _

[Auxiliary Hooks]Availability of Auxiliary Hooks

All facilities which take a cite argument will pass it to the mkcitation hook, which may be redefined to format the citation. mkcitation will only be executed if there is a citation. The default behavior is to separate the citation from the preceding text by an interword space and enclose it in parentheses. This is equivalent to the following definition:

mkccitationcite code

The integrated quotation facilities use mkccitation instead of mkcitation. The default behavior of this command is to separate the citation from the preceding text by an interword space. This is equivalent to the following definition:

The mktextquote hook controls the layout of all text quotations. This hook is used by textquote and related commands from bas:txt:reg,bas:txt:bbl,int:txt:reg,int:txt:bbl. blockquote and related commands from bas:blk:reg,bas:blk:bbl,int:blk:reg,int:blk:bbl use this hook for short quotations. It takes six arguments which may be arranged according to the desired output:

#1 The opening quotation mark.

#2 The text argument of the command.

#3 The closing quotation mark.

#4 The optional punct argument of the command. If there is no punct argument, this parameter is empty.

#5 Trailing tpunct punctuation immediately after the command. If there is no such punctuation or if the autopunct feature is disabled, this parameter is empty.

#6 The optional cite argument of the command, wrapped in mkcitation. If there is no cite argument, this parameter is empty. With integrated quotation commands, this parameter is the citation code, wrapped in mkccitation.

By default, mktextquote encloses the punct argument in the quotation marks along with the text and inserts the cite argument or the citation code before any trailing tpunct punctuation. This is equivalent to the following definition:

The way in which mktextquote hooks into the formatting process is best seen when looking at an example. The commands

[<<cite>>]<<short quote>>
[<<55>>]<<key1>>[<<.>>]<<short quote>>
[<<87>>]<<key2>><<short quote>><<.>>

would execute mktextquote with the following arguments:

open<<short quote>>close<<cite>>
open<<short quote>>close<<.>><cit.>
open<<short quote>>close<<.>><cit.>

where cite is the command selected with SetCiteCommand and  are internal macros which print the opening and closing quotation marks. Note that these internal macros are fully"=fledged markup elements with grouping and nesting control. They must be placed in the correct order, otherwise csquotes will report errors about unbalanced groups or invalidly nested quotations. Since the text should obviously be enclosed in the quotation marks, the parameter order |#1#2#3| is effectively fixed. The parameters |#4|, |#5|, |#6| may be placed freely.

The mkblockquote hook controls the layout of all block quotations. This hook is used by blockquote and related commands from bas:blk:reg,bas:blk:bbl,int:blk:reg,int:blk:bbl for long quotations. It takes four arguments which may be arranged according to the desired output:

#1 The text argument of the command.

#2 The optional punct argument of the command. If there is no punct argument, this parameter is empty.

#3 Trailing tpunct punctuation immediately after the command. If there is no such punctuation or if the autopunct feature is disabled, this parameter is empty.

#4 The optional cite argument of the command, wrapped in mkcitation. If there is no cite argument, this parameter is empty. With integrated quotation commands, this parameter is the citation code, wrapped in mkccitation.

By default, mkblockquote inserts the cite argument or the citation code immediately after the text and adds any trailing tpunct punctuation at the very end. This is equivalent to the following definition:

The mkbegdispquote and mkenddispquote hooks are used by displayquote and related environments from env:bas,env:cit. These hooks take two arguments:

#1 The punct argument passed to the begin line of the environment. If there is no punct argument, this parameter is empty.

#2 The cite argument passed to the environment, wrapped in mkcitation. If there is no cite argument, this parameter is empty. With integrated quotation environments, this parameter is the citation code, wrapped in mkccitation.

By default, mkenddispquote adds the punct argument as well as the cite argument or the citation code at the very end of the quotation. mkbegdispquote does not insert anything be default. This is equivalent to the following definition:

See use:hok for practical examples.

§.§ Additional Tests in Quotation Hooks

The commands in this section increase the flexibility of the hooks discussed in cfg:aux. For example, it may be desirable to adjust the format of a citation depending on the way the corresponding quotation is typeset. It may also be useful to known if the quotation ends with a punctuation mark.

Expands to true if preceeded by the punctuation mark character, and to false otherwise. The character may be a period, a comma, a semicolon, a colon, an exclamation mark, or a question mark. Note that this test is only available in the definition of the hooks from cfg:aux.

Expands to true if preceeded by any punctuation mark, and to false otherwise. Note that this test is only available in the definition of the hooks from cfg:aux.

Expands to true if preceeded by a terminal punctuation mark (period, exclamation mark, or question mark), and to false otherwise. Note that this test is only available in the definition of the hooks from cfg:aux.

Executes true if the text ends with the punctuation mark character, and to false otherwise. The character may be a period, a comma, a semicolon, a colon, an exclamation mark, or a question mark. This command is robust.

Executes true if the text ends with any punctuation mark, and to false otherwise. This command is robust.

Executes true if the text ends with a terminal punctuation mark (period, exclamation mark, or question mark), and to false otherwise. This command is robust.

Expands to true in all block and display quotations, and to false otherwise.

This generic command, which is provided by the etoolbox package, expands to true if the string is blank (empty or spaces), and to false otherwise. This is useful to test for an empty argument in the definition of the mk...quote commands. Note that this test is redundant in the definition of the citation hooks because they are only executed if there is a citation.

Removes preceding whitespace, removes all skips and penalties from the end of the current horizontal list.

§.§ Configuring Punctuation Look-Ahead

This command defines the punctuation marks to be considered by the quotation commands as they scan ahead for punctuation. Note that characters is an undelimited list of characters. Valid characters are period, comma, semicolon, colon, exclamation and question mark. The default setting is:

This definition is restored automatically whenever the autopunct package option is set to . Executing || is equivalent to setting autopunctfalse, it disables this feature.

§.§ Configuring Auxiliary Commands

The appearance of ellipses and insertions formatted with the auxiliary commands from aux is controlled by six hooks. When textelp is used with an empty argument (ellipsis only), it will execute mktextelp. When used with a non-empty text argument (ellipsis and insertion), the text will be passed as an argument to mktextelpins. The starred form will pass the text to mktextinselp instead. These are the default definitions:

The textins command passes its text argument to mktextins for further processing. The starred variant of textins uses mktextmod instead. These are the default definitions:

The textdel command passes its text argument to mktextdel for further processing. This is the default definition (note that the argument is not output):

You may redefine the above hooks to change the format of the printed output. For example, if you prefer replacements to be indicated by «[…text]» rather than «[…] [text]», redefine mktextelpins accordingly:

The unkern in the default definitions is required because textellipsis adds asymmetric kerning by default. The kerning after the final dot is similar to the spacing between the dots, which is fine if textellipsis is followed by any text, but undesirable if it is enclosed in brackets.

§ USAGE NOTES

§.§ Adding a New Quote Style

This section will give some comprehensive examples of how to define new quote styles. The examples presented here will only make use of the most basic components a quote style can be composed of. The main point is to illustrate the interaction of quote styles, variants, aliases, and package options. To get started, consider a simple house style which may be selected by way of the package option style or the command setquotestyle:

Now suppose that we wanted to add a quote style for an imaginary language called Newspeak and that there were two quote styles commonly used in Newspeak, an official one and an unofficial one. In this case, we need two backend styles implemented as variants of the newspeak style, newspeak/official and newspeak/unofficial:

The official variant should be the default for this style. There is no need to copy the definition of the official variant to accomplish that. We simply define an alias labeled newspeak which points to the desired variant:

The reason why we are using variants and aliases instead of two independent styles will become clear in a moment. Suppose that the babel package offered support for Newspeak, but this language was known to babel as otherspeak:

This is an example of a second"=level alias pointing to a first"=level alias. If the current language is otherspeak, the above aliases will be expanded as follows:

otherspeak = newspeak = newspeak/official

We also define a new package option to choose a style variant:

This will add a new package option with a key called newspeak. The value of this option may be any variant of the newspeak style defined in the configuration file. In this example, there are two possible values: official and unofficial. To select the default or the alternative style for the entire document we use:

To select the default or the alternative style with multilingual support we use:

The base style must be implemented as an alias in this case since the newspeak option will select a variant by redefining and thus overwriting the newspeak alias. Since the otherspeak alias points to newspeak and not directly to any backend style, using the newspeak option will also have the desired effect if multilingual support is enabled. Note that there are some style names which have a special meaning. See hnt:pre for details.

§.§ Using Quotation and Citation Hooks

Style guides for writers usually make detailed provisions concerning the formatting of quotations and citations, including rules dealing with punctuation placement. This section will discuss some typical usage scenarios, using hooks and other facilities introduced in cfg:aux,cfg:tst,cfg:dap. In the examples below, we assume the following input:

[citation][.]This is a complete sentence
[citation][]This is an incomplete sentence.

We start off with semantically strict punctuation placement, terminal punctuation is enclosed in the quotation marks if it in fact is part of the quotation, and printed after the closing mark if it is not. Our first sample cases will use German quotation marks, but the formatting convention, as far as punctuation placement is concerned, is very common. We assume citations in footnotes in the first example, hence the desired output is as follows:

* [citation][.]This is a complete sentence

* [citation][]This is an incomplete sentence.

This is accomplished by the following definitions:

In some cases, slightly different placement of the punctuation in the second line is requested:

* [citation][.]This is a complete sentence

* [citation][]This is an incomplete sentence.

This is accomplished by the following definitions:

Let's switch to American quotation marks in the next examples. When using parenthetical citations, the terminal punctuation mark is typically placed at the very end of the entire sentence, after the closing quotation mark and the citation, even if it is part of the original quotation:

* [citation][.]This is a complete sentence

* [citation][]This is an incomplete sentence.

This is accomplished by the following definitions:

The American quotation style is special in that it requires that a period or a comma immediately after a closing quotation mark be moved inside the quotes, even if it is not part of the original quotation. Given the above input (and assuming citations in footnotes in the next example), we need the same output in both cases:

* [citation][.]This is a complete sentence

* [citation][]This is an incomplete sentence.

This is accomplished by the following definitions:

The style usually seen in French books uses semantically strict punctuation placement. The unusual aspect of this style is the footnote mark, which is placed inside the quotes, before the terminal punctuation mark. Given the above input, we need the following output:

* [citation][.]This is a complete sentence

* [citation][]This is an incomplete sentence.

This is accomplished by the following definitions:

Note that the spacing of the quotation marks, as is common in French typography, is handled by the quote style, as defined with DeclareQuoteStyle. There is no need to deal with these details when redefining mktextquote and similar hooks. mktextquote will get the quotation marks plus spacing as parameters |#1| and |#3|.

In addition to language and style specific adaptions, the formatting hooks discussed in this section may be used to further automate the quoting process. For example, they can be configured to automatically insert an ellipsis mark when quoting a sentence truncated at the end. In the following examples, we assume these lines of input:

[citation]This is an incomplete sentence.
[citation][.]This is a complete sentence
[citation]This is a complete sentence.

Let's assume American-style quotes combined with citations in footnotes. Our previous definition for that was:

We need to insert an ellipsis mark if the punct argument of the citation command is empty, or if it was omitted. Parameter |#4| will be blank in both cases:

Given the above input, this definition will yield the following output:

* [citation]This is an incomplete sentence.

* [citation][.]This is a complete sentence

* [citation]This is a complete sentence.

The first two cases are handled correctly but the third one needs more tuning: there is a spurious
ellipsis because the final period is not passed to textquote as a separate punct argument, but included in the quotation. To fix that, we add an additional ifpunct test to check if the quoted text ends with a punctuation mark, and omit the ellipsis if this is the case:

The ifpunct test will check the last character in |#2| and omit the ellipsis when detecting a punctuation mark. This yields the desired output:

* [citation]This is an incomplete sentence.

* [citation][.]This is a complete sentence

* [citation]This is a complete sentence.

When using automated citations, it is convenient to employ the integrated quotations commands from cit. For example, instead of this:

[<cit.>][.]This is a complete sentence
[<cit.>][]This is an incomplete sentence.

you might use textcquote instead of textquote:

[55]key[.]This is a complete sentence
[55]keyThis is an incomplete sentence.

The definition of the punctuation hooks is the same in both cases, but citations are set up in a slightly different way in the second case, using mkccitation instead of mkcitation. The first line in the example below is intended for parenthetical citations, the second one for citations in footnotes:

Advanced citation packages such as natbib and biblatex provide dedicated commands for various types of citations. In this case, it is advisable to hand control of citations to the respective citation command, mkccitation is used to add spacing where required but will leave the rest to the citation command. In the case of biblatex, this boils down to:

for parenthetical citations and

for citations in footnotes.

§ HINTS AND CAVEATS

§.§ Input Encodings

The active quotes provided by this package may depend on or benefit from the inputencinputenx packages under certain circumstances. As long as the active quotes are in the range 0–127, there is no benefit in loading inputenc. If you are using an 8-bit input encoding such as latin1, inputenc is required for the quotes to function properly in a verbatim context. It should therefore be loaded before any active quotes are allocated (not necessarily before csquotes is loaded). The macro-level support of this package builds on the utf8 module of the inputenc package. When using this encoding, make sure that inputenc is loaded with the utf8 option. Do not use the utf8x option as this would implicitly load the ucs package which is not supported by csquotes. encoding will be detected automatically. All commands discussed in act work as usual with this encoding. and in native mode will also work as expected and do not require any additional packages. See also hnt:mod.

§.§ Output Encodings

The OT1 font encoding, which is the default output encoding of , merely includes the quotation marks used in English. You will need an encoding like T1, LY1, or, with or , TU, in order to get guillemets or baseline quotation marks. This package deliberately refrains from providing any workarounds for the OT1 legacy encoding. If you need T1 or some other extended encoding for some of the quotation marks, you will most likely need it anyway to get proper hyphenation for the respective language. See tab:out for a list of common quotation marks included in T1, LY1, and TU.

2@HDouble quotation marks     2HSingle quotation marks

1@HCommand     1@HExample
1HCommand     1@HExample

textquotedblleft	    [60]“
textquoteleft		    [60]‘

textquotedblright	    [60]”
textquoteright		    [60]’

quotedblbase		    [60]„
quotesinglbase		    [60]‚

guillemotleft		    [60]«
guilsinglleft		    [60]‹

guillemotright		    [60]»
guilsinglright		    [60]›

[Quotation Marks]Quotation Marks Provided by Encodings T1, LY1, ETU

§.§ Valid Active Quotes

In general, an active quote may be any single character with category code 12 or 13, or any multibyte sequence representing a single character. However, there are a few exceptions: numbers, punctuation marks, the apostrophe, the hyphen, and all characters which are part of the syntax are rejected. In sum, the following characters will be considered as reserved by this package:

§.§ Invalid Nesting and Unbalanced Active Quotes

Every quotation forms a group which includes both the quoted piece of text and the quotation marks. This package tracks the nesting level of all quotations and thus allows for basic validation. If quotations are nested in an invalid way, it will issue an error message. Keep in mind that the active quotes are more than a convenient way to enter quotation marks. They are fully"=fledged markup elements which imply grouping as well, hence they must always be balanced and must not interfere with other group boundaries. This package ensures that an error is triggered if quotes are unbalanced or nested in an invalid way. However, note that packages generally can not catch low-level errors caused by grouping mistakes, nor do they have any control over the wording of generic error messages.

§.§ Active Quotes in Special Contexts

All quotation commands are designed for use in text mode and will issue an error message in math mode. Note that all active quotes retain their original function in math mode. It is perfectly possible to use a character like the greater-than symbol as an active quote without interfering with math mode. In a verbatim context, the active quotes will normally be disabled. If a character is in the range 128–255, its original function is restored so that the inputencinputenx package may handle it in verbatim environments. This feature is available with the standard verbatim environments and with those provided by (or defined via) the packages verbatim, fancyvrb, moreverb, and alltt. This also applies to the verb command and the shortvrb package. The listings package provides dedicated support for extended input encodings. When using this package, activate its <extended characters> option and specify the input encoding. Note that listings does not support macro-level decoding. and in native mode will work as expected and do not require the inputenc package.

Some care is still required when choosing active quotes. Note that you normally cannot use active characters in the argument to commands expecting a string of characters, such as input, label, or cite. There are two packages which try to remedy this situation: the babel package and the underscore package (when loaded with the strings option). Both packages redefine several standard commands affected by this general problem. If any one of these packages is loaded, csquotes will take advantage of all improvements automatically. Unfortunately, both packages patch a different set of commands and neither one covers all possibly vulnerable commands.

§.§ Strings and hyperref Support

This package interfaces with the hyperref package as strings such as bookmarks are generated. See cfg:pdf on how to configure the quotation marks used in strings. Support for strings is only available with the basic facilities presented in bas:reg,bas:bbl as well as act:reg,act:bbl. Be advised that the way hyperref builds strings imposes severe limitations on the capabilities of all commands. Most notably, the nesting level of quotations cannot be tracked in this context. Nested quotations will generally get outer marks, but you may use starred commands or active inner quotes to request inner marks explicitly. If quotation marks are to be included in the document properties of a file, you must use hypersetup to specify the strings. The replacement mechanism will not function within the optional argument to usepackage. See the hyperref manual for further details.

§.§ Footnotes Inside Quotations

This package will automatically reset the nesting level within any footnote included in a quotation. If the babel or the polyglossia package has been loaded, it will also reset the language. The language of the footnote text including the hyphenation patterns will match the language of the text surrounding the quotation. This applies to parboxes, minipages, and floats as well.

§.§ Using csquotes with babel's Shorthands

The commands discussed in aut:amk may be combined with the shorthands of the babel package such that babel provides the user interface and csquotes the backend.[This also applies to the polyglossia package if the babelshorthands option of polyglossia has been enabled.] For example, the German module of the babel package defines, amongst other things, the shorthands |"`| and |"'|. Such shorthands are input aids, physical markup elements with a fixed definition. Typing |"`| is a short way of saying |„| but it is not different in concept. These shorthands can be transformed into <smart quotes> which behave like enquote. Here is a simple ad hoc solution suitable for documents with only one language:

It is possible to move such definitions to csquotes.cfg. In this case, the code is slightly more complex because it needs to be more general:

This code redefines the shorthands only if the babel package has been loaded and the main language is . Note that babel's shorthands are language"=specific. The way they are configured and handled is technically and conceptually different from the active quotes discussed in act. Active quotes are defined globally and automatically adapt to the current language. With babel, each language has its own set of shorthands. Also note that babel uses AtBeginDocument to initialize the main document language, including the corresponding shorthands. We use AtEndPreamble to defer the code until the end of the preamble. This way, we can be sure that babel has been loaded but that the main document language has not been initialized yet. See the babel manual for further details. The AtEndPreamble command is provided by the etoolbox package.

§.§ Miscellaneous Notes about the Predefined Styles

There are three styles which serve a special purpose: default, fallback, and debug. The default style is a dynamic alias pointing to the default quote style used if the multilingual interface is not enabled. The package option style and the command setquotestyle will redefine this alias. The fallback style is a backend style used as a fallback whenever the multilingual interface is enabled but there is no matching quote style for the current language. It will print bold question marks by default. The debug style will not print quotation marks but the current quote level as a bold number. This style may be selected using the style option or the setquotestyle command. It is intended for debugging only.

All variants of the french style use spaced out guillemets as outer marks. The style variant quotes uses double quotes as inner marks. The starred variant quotes* is similar to its regular counterpart except that it will also space out the inner marks. The guillemets variant employs spaced out guillemets on all levels. It will also insert guillemets at the beginning of every paragraph inside a quotation spanning multiple paragraphs. In addition to that, two adjoining marks at the end of a quotation are replaced by a single one; if two nested quotations end simultaneously, the second closing mark is omitted automatically. The starred variant guillemets* is similar to its regular counterpart, differing only in the middle mark inserted at the beginning of every paragraph. The regular variant uses a left"=pointing guillemet whereas the starred one uses a right"=pointing one.

§ AUTHOR INTERFACE

The following sections discuss the programmer interface to the csquotes package as well as some details of the implementation. They are intended for class and package authors who want to interface with this package.

§.§ Controlling Active Quotes

The author commands in this section behave essentially like the corresponding user commands discussed in act:ctl. The only difference is that they work quietly behind the scenes without writing any notices to the transcript file. The scope of these commands is local so that all changes may be confined to a group. Note that the active quotes are enabled at the beginning of the document body. Under no circumstances will this package make any characters active in the document preamble. You will only need the following commands when dealing with active quotes at the beginning of or in the document body.

This command enables all characters allocated as active quotes. It also restores their definitions if they were disabled or accidentally overwritten. With single-byte encodings, this command (re)defines all allocated characters and makes them active. With encoding, it redefines the internal macro used by the inputenc package to typeset the respective sequence (u8:character). characters in the range 0–127 are handled as with single-byte encodings. When using a engine with native support, such as , all characters are handled as with single-byte encodings.

This command restores the status quo ante of all active quotes. With single-byte encodings, there are two possible cases. (1) If a character had already been active when it was allocated as active quote, its former definition is restored. (2) If a character had not been active when it was allocated, its former category code is restored. With encoding, this command restores the former definition of the internal macro used by the inputenc package to typeset the respective sequence. characters in the range 0–127 are handled as with single-byte encodings. When using a engine with native support, such as , all characters are handled as with single-byte encodings.

For verbatim environments and similar applications, use this command rather than @disablequotes. It redefines the active quotes in a way that is better suited for verbatim typesetting. With single-byte encodings, it will do one of the following things. (1) If a character is in the range 0–127, it is redefined such that it expands to itself with category code 12. (2) If a character is in the range 128–255, there are two possibilities. (a) If it had already been active when it was allocated, its former definition is restored. (b) If it had not been active before, it is redefined such that it expands to itself with its former category code.

Characters in the range 0–127 are added to the dospecials list. Characters in the range 128–255 remain active, permitting the inputenc package to typeset them verbatim (due to case 2a, which implies that you must load inputenc before allocating active quotes). Case 2b is usually undesirable in verbatim environments. If inputenc is loaded, however, this should not happen. With encoding, this command restores the former definition of the internal macro used by the inputenc package to typeset the respective sequence. characters in the range 0–127 are handled as with single-byte encodings. When using a engine with native support, such as , all characters are handled as with single-byte encodings.

Due to case 1, @verbatimquotes itself is independent of any dospecials processing. You may typeset all active quotes verbatim by using this command exclusively. The advantage of this approach is that it does not require any category code changes, hence this command may also be used to modify an argument after it has been read. Also note that the standard verbatim environments as well as all environments provided by or defined via the packages verbatim, fancyvrb, moreverb, and alltt are catered for automatically. This also applies to the verb command and the shortvrb package.

This command implicitly executes @disablequotes and deallocates all active quotes, which results in a complete reset of all active quotes so that they may be newly defined. This command should be used with care because the reset is not visible to the user. Using DeleteQuotes may be preferable.

§.§ Active Quotes in a Strings-Only Context

A possible problem with active characters are strings-only contexts, i. e. cases in which an active character is used in the formation of a control sequence name. A typical example is the label command which expects a string of characters. Any active character may break label when used in its argument. There are two packages which try to remedy this situation, albeit in different ways: babel and underscore.

The babel package defines the switch if@safe@actives and patches several standard commands such that the switch is set to true while they process their arguments. The approach taken by the underscore package is slightly different. If underscore is loaded with the strings option, it patches several commands such that protect is equivalent to string while the arguments are processed. If any one of these packages is loaded, csquotes will take advantage of that automatically. Unfortunately, both packages patch a different set of commands and neither one covers all possibly vulnerable commands. If babel is loaded, for example, you may use active quotes in the argument of label, but not in the argument of input. If you load underscore with its strings option, active quotes may also be used in the argument of input.

When writing a package which may have to process user"=supplied arguments in a strings-only context, there are two ways to deal with active quotes. Taking the approach of the babel package, you may do the following:

This is best done in a group. If grouping is not feasible, you must ensure that the switch is properly restored. In contrast to using @safe@activestrue, this approach works even if babel is not loaded. However, note that you must take three states into account when restoring the switch in this case: true, false, and undefined. Taking the approach of the underscore package, you may also do the following:

This could either be done in a group or without any grouping, but followed by restore@protect. The first approach works with the active characters of the babel and the underscore packages. The second one works with the underscore and the at packages. Unfortunately, the active characters of the inputenc package support neither of the above"=mentioned techniques. As far as csquotes is concerned, it does not matter which approach you take. In both cases all active quotes expand to themselves with category code 12. With macro-level support, encoded active quotes expand to a string of characters with category code 12. This string will be valid . In a verbatim write operation, you should employ one of the techniques discussed in this section rather than @verbatimquotes, which is geared to verbatim typesetting.

§.§ Block Quotations

The block quotation facilities need to typeset all quotations twice. The first pass is required to measure the length of the quotation. The actual typesetting takes place on the second pass, in a format depending on the result of the first one. In order to prevent any side"=effects of the first (trial) pass, the csquotes package (1) performs the first pass inside a group, (2) employs checkpointing to freeze all LaTeX counters, and (3) sets if@filesw to . However, it can not prevent side"=effects caused by commands that (1) make any global assignments which are not overwritten on the second pass (for example, by way of g@addto@macro), (2) increment counters globally in a way that circumvents 's counter commands, or (3) do not check if@filesw every time they are about to write to an auxiliary file. If you observe any malfunctions related to the trial pass (for example, if counters are incremented twice or if an item appears twice in a list), use BlockquoteDisable to redefine or disable the affected command temporarily.

The code may be arbitrary code which redefines vulnerable commands locally such that they work differently during the trial pass. The code itself should obviously not include any global assignments. This solution should be considered as a last ressort but may be the quickest way to fix a vulnerable package. Note that there is no need to escape parameter characters by doubling them in the code argument. Simply use this command like AtBeginDocument and similar hooks.

§.§ Registering Quotation Marks

In order to track punctuation marks inside quotations, this package requires that all quotation marks be transparent to the space factor, that they have a space factor code of zero. This setting is specific to the output encoding. Settings for the encodings OT1, OT2, OT4, T1, LY1, LGR, T2A, T2B, T2C, LCY, X2, and ETU are provided by default. Other encodings may be set up in the configuration file using the following command:

The encoding is the name of the output encoding, for example . This string corresponds to the identifiers used when loading the fontenc package. The position argument is an integer indicating the position of a glyph in this encoding. You need to reqister all quotation marks in the output encoding, using one declaration for each glyph. As an example, these are the settings for the OT1 encoding:

The position argument may use any notation accepted by in integer assignments,  in decimal or  in hexadecimal notation. See the settings in csquotes.def for further examples. The advantage of registering quotes with the above command (rather than adjusting the space factor codes globally) is that the declarations are only used locally inside quotations and will not affect any other part of the document.

§.§ Automatic Quotation Marks

The commands in this section provide access to the automatic quotation facilities at a slightly lower level than the user commands in bas:reg,act:reg. In contrast to the commands discussed in aut:imk, the facilities in this section are fully"=fledged markup elements which verify the nesting level and issue an error if quotations are nested in an invalid way. They form groups and must always be balanced, see hnt:grp for details. In other words, the facilities in this section are semantic markup elements, the ones in aut:imk are physical markup elements.

openautoquote Opens a nestable quotation.
closeautoquote Closes a nestable quotation.

In terms of their function, the above commands correspond to the regular versions of enquote and MakeAutoQuote. The following commands correspond to the starred variants enquote* and MakeAutoQuote*:

openinnerquote Opens an inner quotation.
closeinnerquote Closes an inner quotation.

The above commands may be used to implement an alternative user interface. For example, you can combine them with the shorthands of the babel package such that babel provides the user interface and csquotes the backend. See hnt:bbl and the babel manual for details.

§.§ Internal Quotation Marks

The commands in this section print the quotation marks of the current style, as defined with DeclareQuoteStyle, without any grouping or nesting control. The quotation marks reflect all changes to the quotation style. If the multilingual interface is enabled, they are also synced with the current language.

textooquote Prints the opening outer quotation mark of the currently active quote style.
textcoquote Prints the closing outer quotation mark.
textmoquote Prints the middle outer quotation mark.

textoiquote Prints the opening inner quotation mark.
textciquote Prints the closing inner quotation mark.
textmiquote Prints the middle inner quotation mark.

Note that the initialization hooks for the respective quotation style are not executed automatically. They may be accessed separately:

initoquote Executes the outer initialization hook.
initiquote Executes the inner initialization hook.

The scope of these hooks must always be confined to a group.

§ REVISION HISTORY

This revision history is a list of changes relevant to users of this package. Changes of a more technical nature which do not affect the user interface or the behavior of the package are not included in the list. If an entry in the revision history states that a feature has been extended, this indicates a syntactically backwards compatible modification, such as the addition of an optional argument to an existing command. Entries stating that a feature has been modified, renamed, or removed demand attention. They indicate a modification which may require changes to existing documents in some, hopefully rare, cases. The version option from opt:opt may be helpful in this case. The numbers on the right indicate the relevant section of this manual.

* Update for  kernel changes in 2018

* Added language option galicianopt:opt

* Added language option latvianopt:opt

* Improve language support for czech

* Added language option portugueseopt:opt

* Fix behaviour of blockquote inside parbox and
related constructs

* Add textdel auxiliary command.aux

* Adapt fixligatures to work correctly with

* Update for new TU Unicode encoding

* Update (n)swissgerman and (n)austrian quote styles

* New maintainer: Joseph Wright

* Update danish quote style

* Slightly modified quote style italian/guillemets

* Made variant guillemets the default for italian

* Fixed kerning issue

* Fixed spurious language reset

* Fixed conflict with polyglossia and French

* Fix for paragraph environments inside blockquote

* Added package option debugopt:opt

* Added package option thresholdopt:opt

* Added package option thresholdtypeopt:opt

* Added package option parthresholdopt:opt

* Added package option splitcompopt:opt

* Improved block quotation facilitiesbas:blk:reg

* Improved integrated block quotation facilitiesint:blk:reg

* Added package option csdisplayopt:opt

* Added csdisplaytrue and csdisplayfalseopt:opt

* Fixed conflict with polyglossia

* Fixed issue with babel's active punctuation marks

* Fixed bug related to middle quote marks

* Minor internal update for biblatex

* Renamed package option babel to autostyleopt:opt

* Added compatibility option babelopt:leg

* Added preliminary polyglossia interfaceopt:opt

* Added package option autopunctopt:opt

* Added package option versionopt:leg

* Added hybridblockquotebas:blk:bbl

* Added hybridblockcquoteint:blk:bbl

* Added MakeHybridBlockQuoteact:blk:bbl

* Added DeclareAutoPunctcfg:dap

* Extended textquotebas:txt:reg

* Extended foreigntextquotebas:txt:bbl

* Extended hyphentextquotebas:txt:bbl

* Extended blockquotebas:blk:reg

* Extended foreignblockquotebas:blk:bbl

* Extended hyphenblockquotebas:blk:bbl

* Extended textcquoteint:txt:reg

* Extended foreigntextcquoteint:txt:bbl

* Extended hyphentextcquoteint:txt:bbl

* Extended blockcquoteint:blk:reg

* Extended foreignblockcquoteint:blk:bbl

* Extended hyphenblockcquoteint:blk:bbl

* Added mktextquotecfg:aux

* Added mkblockquotecfg:aux

* Added mkbegdispquotecfg:aux

* Added mkenddispquotecfg:aux

* Removed mkpretextpunctcfg:aux

* Removed mkmidtextpunctcfg:aux

* Removed mkfintextpunctcfg:aux

* Removed mkpreblockpunctcfg:aux

* Removed mkmidblockpunctcfg:aux

* Removed mkfinblockpunctcfg:aux

* Removed mkpredisppunctcfg:aux

* Removed mkmiddisppunctcfg:aux

* Removed mkfindisppunctcfg:aux

* Removed quotetextcfg:aux

* Removed quoteblockcfg:aux

* Renamed ifquotepunct to ifpunctcfg:tst

* Renamed ifquoteterm to iftermcfg:tst

* Added ifpunctmarkcfg:tst

* Removed ifquotecoloncfg:tst

* Removed ifquotecommacfg:tst

* Removed ifquoteexclamcfg:tst

* Removed ifquoteperiodcfg:tst

* Removed ifquotequestioncfg:tst

* Removed ifquotesemicoloncfg:tst

* Renamed ifstringblank to ifblankcfg:tst

* Added unspacecfg:tst

* Added textelpaux

* Added textinsaux

* Added mktextelpcfg:elp

* Added mktextelpinscfg:elp

* Added mktextinselpcfg:elp

* Added mktextinscfg:elp

* Added mktextmodcfg:elp

* Expanded documentationuse:hok

* Removed cquote legacy alias (use textcquote instead)int:txt:reg

* Removed foreigncquote legacy alias (use foreigntextcquote)int:txt:bbl

* Removed hyphencquote legacy alias (use hyphentextcquote)int:txt:bbl

* Removed RestoreQuotes legacy alias (use EnableQuotes)act:ctl

* Removed @restorequotes legacy alias (use @enablequotes)aut:ctl

* Added support for EU2 encodingaut:sfc

* Added quote style for Croatian

* Added quote style for Dutch

* Added quote style for Finnish

* Added quote style for Greek

* Added support for LGR encodingaut:sfc

* Fixed incompatibility with inputenx package

* Fixed bug in glyph declarations for EU1 encodingaut:sfc

* Added support for EU1 encodingaut:sfc

* Added quote style for Brazilian

* Added preliminary quote style for Portuguese

* Added package option maxlevelopt:opt

* Added special quote style debughnt:pre

* Added DeclareQuoteGlyphaut:sfc

* Added support for OT2 and OT4 encodingsaut:sfc

* Added support for T2A, T2B, T2C, X2 encodingsaut:sfc

* Added support for LCY encodingaut:sfc

* Added quote style for Russian

* Made package option babeltryonce the default settingopt:opt

* Internal updates for biblatex package

* Upgrade to etoolbox 1.6

* Fixed timing issue with active quotes introduced in 4.0

* now mandatory requirement

* New dependency on etoolbox package

* Added package option spanishopt:opt

* Added variant mexican to style spanishopt:opt

* Removed variant oldstyle from english styleopt:opt

* Removed variant oldstyle from french styleopt:opt

* Removed variant imprimerie from french styleopt:opt

* Expanded documentationhnt:bbl

* Added openautoquote and closeautoquoteaut:amk

* Added openinnerquote and closeinnerquoteaut:amk

* Moved predefined styles, variants, options to csquotes.def

* Added more hints and examples to csquotes.cfg

* Added extended bookmarks to this manual

* Added variant guillemets* to style swedishopt:opt

* Added language alias australiancfg:als

* Added language alias newzealandcfg:als

* Internal improvements

* Added package option babeltryopt:opt

* Added package option babeltryonceopt:opt

* Added MakeAutoQuote*act:reg

* Added MakeForeignQuote*act:bbl

* Added MakeHyphenQuote*act:bbl

* Added mkpretextpunctcfg:aux

* Added mkpreblockpunctcfg:aux

* Added mkpredisppunctcfg:aux

* Removed compatibility code for blockcite legacy command

* Internal updates for biblatex package

* Added BlockquoteDisableaut:blk

* Fix for amsmath package (active quotes in split and other environments)

* Fix for endnotes package (endnotes in block quotations)

* Revised Spanish quote style

* Exchanged definitions of French quotes and quotes* variantshnt:pre

* Internal updates for inputenc 1.1 b (2006-05-05)

* Stricter validation of user"=defined active charactershnt:val

* Author interface now documented in this manualaut

* Added documentation of @enablequotesaut:ctl

* Added documentation of @disablequotesaut:ctl

* Added documentation of @verbatimquotesaut:ctl

* Added documentation of @deletequotesaut:ctl

* Added documentation concerning string handling aut:str

* Added documentation of interface to internal marksaut:imk

* Added support for encoded active quoteshnt:inc

* Modified active quotes, category codes 7, 8 no longer validhnt:val

* Modified delimiters, category codes 3, 4, 7, 8 no longer validhnt:val

* Active quotes may now be defined in the document bodyact:ctl

* Renamed RestoreQuotes to EnableQuotesact:ctl

* Added DeleteQuotesact:ctl

* Added VerbatimQuotesact:ctl

* Added ExecuteQuoteOptionscfg:exe

* Added package option babelonceopt:opt

* Added new style variant for Frenchhnt:pre

* Improved nesting control of active block quotes

* Made active block quotes robust

* Added quote style for Spanish

* Fixed bug in hyperref interface

* Added textquotebas:txt:reg

* Added foreigntextquotebas:txt:bbl

* Added hyphentextquotebas:txt:bbl

* Renamed cquote to textcquoteint:txt:reg

* Renamed foreigncquote to foreigntextcquoteint:txt:bbl

* Renamed hyphencquote to hyphentextcquoteint:txt:bbl

* Extended textcquoteint:txt:reg

* Extended foreigntextcquoteint:txt:bbl

* Extended hyphentextcquoteint:txt:bbl

* Modified environment displayquoteenv:bas

* Modified environment foreigndisplayquoteenv:bas

* Modified environment hyphendisplayquoteenv:bas

* Extended environment displaycquoteenv:cit

* Extended environment foreigndisplaycquoteenv:cit

* Extended environment hyphendisplaycquoteenv:cit

* Added mkmidtextpunctcfg:aux

* Added mkfintextpunctcfg:aux

* Added mkmiddisppunctcfg:aux

* Added mkfindisppunctcfg:aux

* Added auxiliary environment quotetextcfg:aux

* Added detection of paragraphs to all block quotation facilitiesbas:blk:reg

* ifquote... now usable in mkcitation and mkccitationcfg:tst

* Terminal punctuation now evaluated by all quotation facilities

* Prevent undesirable |¿| and |¡| ligatures in T1 encoding

* Always adjust space factor codes of backend quotes

* Extended blockquotebas:blk:reg

* Extended foreignblockquotebas:blk:bbl

* Extended hyphenblockquotebas:blk:bbl

* Extended setquotestylebas:set

* Added cquoteint:txt:reg

* Added foreigncquoteint:txt:bbl

* Added hyphencquoteint:txt:bbl

* Added blockcquoteint:blk:reg

* Added foreignblockcquoteint:blk:bbl

* Added hyphenblockcquoteint:blk:bbl

* Added environment displayquoteenv:bas

* Added environment foreigndisplayquoteenv:bas

* Added environment hyphendisplayquoteenv:bas

* Added environment displaycquoteenv:cit

* Added environment foreigndisplaycquoteenv:cit

* Added environment hyphendisplaycquoteenv:cit

* Modified DeclarePlainStylecfg:pdf

* Added SetCiteCommandcfg:blk

* Renamed blockcite to mkcitationcfg:aux

* Added mkccitationcfg:aux

* Added mkmidblockpunctcfg:aux

* Added mkfinblockpunctcfg:aux

* Added ifquotepunctcfg:tst

* Added ifquotetermcfg:tst

* Added ifquoteperiodcfg:tst

* Added ifquotecommacfg:tst

* Added ifquotesemicoloncfg:tst

* Added ifquotecoloncfg:tst

* Added ifquoteexclamcfg:tst

* Added ifquotequestioncfg:tst

* Added ifstringblankcfg:tst

* Added evaluation of terminal punctuation within block quotations

* With nonfrenchspacing, adjust space factor codes of backend quotes

* Improved nesting control when running under