The Csquotes Package Context Sensitive Quotation Facilities Philipp Lehman, Joseph Wright Version V5.2L [email protected] 2021-02-22
Total Page:16
File Type:pdf, Size:1020Kb
The csquotes Package Context Sensitive Quotation Facilities Philipp Lehman, Joseph Wright Version v5.2l [email protected] 2021-02-22 Contents List of Tables1 7 Auxiliary Commands 15 1 Introduction1 8 Configuration 16 2 Package Options2 9 Usage Notes 26 3 Basic Interface5 10 Hints and Caveats 31 4 Active Quotes9 11 Author Interface 35 5 Integrated Interface 12 12 Bug reports 40 6 Display Environments 14 13 Revision History 40 List of Tables 1 Language Options........3 4 Configurable Parameters.... 20 2 Styles and Variants....... 17 5 Auxiliary Hooks......... 21 3 Language Aliases......... 18 6 Quotation Marks......... 31 1 Introduction 1.1 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. 1 1.2 License Copyright © 2003–2011 Philipp Lehman, 2015–2019,2021 Joseph Wright. Permis- sion is granted to copy, distribute and/or modify this software under the terms of the LaTeX Project Public License, version 1.3c or any later version.1 1.3 Contributions The multilingual support of this package depends on user contributions. If you want to contribute a quote style, please refer to § 8.1 for an overview of the components a quote style is composed of and to table6 for a list of commands which should be used in the definition of quote styles. 2 Package Options All package options are given in hkeyi=hvaluei syntax. 2.1 Main Options strict=true, false default: false 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 strict=true. style=hstylei default: american This option selects a fixed quotation style. The style is used throughout the docu- ment unless it is changed manually, see § 3.7 for details. This option implicitly sets autostyle=false. Please refer to tables2 and3 for a list of available quote styles and aliases. See §§ 8.1, 8.2, 9.1 for instructions on adding or modifying quote styles. autostyle=true, false, try, once, tryonce default: tryonce This option controls multilingual support. It requires either the babel package or the polyglossia package.2 autostyle=true 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. autostyle=try and tryonce are similar to true and once if multilingual support is available but will not issue any warnings if not (i. e., if neither babel nor polyglossia have been loaded). The short form autostyle is equivalent to autostyle=true. See also § 3.7. 1http://www.latex-project.org/lppl/ 2Note that polyglossia support requires polyglossia v1.45 (2019/10/27) or above. With older polyglossia versions language variants will not be detected as expected. 2 Option key Possible values austrian quotes, guillemets croatian quotes, guillemets czech quotes, guillemets danish quotes, guillemets, topquotes english american, british estonian french quotes, quotes*, guillemets, guillemets* galician quotes, guillemets german quotes, guillemets, swiss hungarian italian guillemets, quotes latin italianguillemets, germanquotes, germanguillemets, britishquotes, americanquotes latvian norwegian guillemets, quotes polish guillemets, guillemets* portuguese portuguese, brazilian romanian serbian quotes, guillemets, german spanish spanish, mexican swedish quotes, guillemets, guillemets* Table 1: Language Options Defined by Default hlanguagei=hvarianti Use the language options listed in table1 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: \usepackage[english,ngerman]{babel} \usepackage[autostyle,german=guillemets,norwegian=quotes]{csquotes} 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 table3 for details. Table1 indicates the language options defined by default. Additional options may be defined in the configuration file. See §§ 8.3 and 9.1 for details. Also see § 10.9 for some additional notes concerning the predefined styles. maxlevel=hintegeri default: 2 This option controls the maximum nesting level of quotations. By default, this pack- age supports two levels of quotations, outer and inner ones, and issues an error if 3 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 2. autopunct=true, false default: true This option controls whether the quotation commands scan ahead for trailing punc- tuation marks. See §§ 3.3, 3.5, 5.1, 5.3 for details. Also see \DeclareAutoPunct in § 8.9 and § 8.7 on how to configure and use the punctuation look-ahead feature. The short form autopunct is equivalent to autopunct=true. threshold=hintegeri default: 3 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 §§ 3.5 and 8.6 for further details. thresholdtype=lines, words default: lines This option selects the block threshold type. With thresholdtype=lines, the block quotation facilities will determine the number of lines required to typeset the quo- tation; with thresholdtype=words, they count the number of words in the quota- tion.3 The default threshold setup is 3 lines. If you prefer something like 50 words, set threshold=50 and thresholdtype=words. See § 3.5 for further details. parthreshold=true, false default: true This option fine-tunes the block threshold detection. If enabled, any explicit para- graph or line break in the quotation will trigger the threshold, i. e., the quotation will be typeset in display mode regardless of its length. If disabled, explicit para- graph or line breaks are applied normally if thresholdtype=lines, and treated as a regular word boundary if thresholdtype=words. The short form parthreshold is equivalent to parthreshold=true. splitcomp=true, false default: true This option is applicable with thresholdtype=words only. It fine-tunes the handling of compounds with explicit hyphens. If enabled, compounds are split up at all hy- phens and the components are counted as separate words. If disabled, compounds are treated as a single word. The short form splitcomp is equivalent to splitcomp= true. 3The word counting code is based on an idea by Donald Arseneau. 4 csdisplay=true, false default: false By default, the block quotation facilities will automatically force inline quotations in footnotes, parboxes, minipages, and floats. Setting this option to true will permit context-sensitive switching to display quotations in these contexts, as in the text body. The short form csdisplay is equivalent to csdisplay=true. This option may also be set locally with \csdisplaytrue and \csdisplayfalse, respectively. debug=true, false default: false This option controls the debugging feature of the block quotation facilities. If en- abled, all block quotation commands will output diagnostic messages to the tran- script file. These messages indicate the calculated line/word count, explicit para- gaph or line breaks detected in the quotation text, and the final inline/display de- termination. The short form debug is equivalent to debug=true. 2.2 Compatibility Options version=hversioni, 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 hversioni, even if it is not explicitly listed above. In this case, the package will keep increasing the hversioni number until it either finds a suitable compatibility mode or hits the current version number. For example, when specifying version=4.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. babel=true, false, try, once, tryonce An older name of the autostyle option. This option is depreciated. 3 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 §4. When working 5 with automated citations, you might also want to learn about the integrated quota- tion facilities presented in §5. 3.1 Quoting Regular Text The most basic command will simply enclose its argument in quotation marks: \enquote{htexti} \enquote*{htexti} Like all quotation facilities, this command is context sensitive.