diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-30 22:56:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-30 22:56:17 +0000 |
commit | bce65f52a3f2fd1c56c758f8d3440caac7dd2549 (patch) | |
tree | 619be4a5a84c6c2baf88659a7316ce51f613ae34 /Master/texmf-dist/tex/latex | |
parent | 002b09de2b07d6155b7dca17dace030555dfe592 (diff) |
csquotes 4.4 (30may09)
git-svn-id: svn://tug.org/texlive/trunk@13534 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/csquotes/csquotes.cfg | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/csquotes/csquotes.def | 126 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/csquotes/csquotes.sty | 724 |
3 files changed, 489 insertions, 365 deletions
diff --git a/Master/texmf-dist/tex/latex/csquotes/csquotes.cfg b/Master/texmf-dist/tex/latex/csquotes/csquotes.cfg index ef1ba59ccac..4a2c445c558 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csquotes.cfg +++ b/Master/texmf-dist/tex/latex/csquotes/csquotes.cfg @@ -1,6 +1,6 @@ -% $Id: csquotes.cfg,v 4.3 2008/11/23 16:02:45 lehman stable $ +% $Id: csquotes.cfg,v 4.4 2009/05/30 13:12:20 lehman stable $ -\ProvidesFile{csquotes.cfg}[2008/11/23 v4.3 csquotes configuration] +\ProvidesFile{csquotes.cfg}[2009/05/30 v4.4 csquotes configuration] % Put your definitions here. diff --git a/Master/texmf-dist/tex/latex/csquotes/csquotes.def b/Master/texmf-dist/tex/latex/csquotes/csquotes.def index 53104924cff..03c2719e337 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csquotes.def +++ b/Master/texmf-dist/tex/latex/csquotes/csquotes.def @@ -1,12 +1,12 @@ -% $Id: csquotes.def,v 4.3 2008/11/23 16:02:45 lehman stable $ +% $Id: csquotes.def,v 4.4 2009/05/30 13:12:20 lehman stable $ \ProvidesFile{csquotes.def} -[\csq@rcsid $Id: csquotes.def,v 4.3 2008/11/23 16:02:45 lehman stable $ +[\csq@rcsid $Id: csquotes.def,v 4.4 2009/05/30 13:12:20 lehman stable $ csquotes generic definitions] % Set defaults -\ExecuteQuoteOptions{babel=tryonce} +\ExecuteQuoteOptions{babel=tryonce,maxlevel=2} \SetBlockEnvironment{quote} \SetBlockThreshold{3} \SetCiteCommand{\cite} @@ -64,6 +64,7 @@ [\mkfrenchopenquote{\guillemotleft}] {\mkfrenchclosequote{\guillemotright}} {\mkfrenchopenquote{\guillemotleft}} + [\mkfrenchopenquote{\guillemotleft}] {\mkfrenchclosequote{\guillemotright}} \DeclareQuoteStyle[guillemets*]{french} [\initfrenchquotes] @@ -71,6 +72,7 @@ [\mkfrenchopenquote{\guillemotright}] {\mkfrenchclosequote{\guillemotright}} {\mkfrenchopenquote{\guillemotleft}} + [\mkfrenchopenquote{\guillemotright}] {\mkfrenchclosequote{\guillemotright}} \DeclareQuoteStyle[quotes]{german}% verified {\quotedblbase} @@ -102,6 +104,7 @@ {\guillemotright} [0.025em] {\textquotedblleft} + [\textquotedblright]% unsure {\textquotedblright} \DeclareQuoteStyle[guillemets]{norwegian} {\guillemotleft} @@ -115,6 +118,11 @@ [0.05em] {\quotesinglbase} {\textquoteright} +\DeclareQuoteStyle{russian}% verified + {\guillemotleft} + {\guillemotright} + {\quotedblbase} + {\textquotedblleft} \DeclareQuoteStyle[mexican]{spanish} {\textquotedblleft} {\textquotedblright} @@ -148,14 +156,6 @@ {\guilsinglright} {\guilsinglleft} -% Fallback style - -\DeclareQuoteStyle{fallback} - {\dummyquotemark} - {\dummyquotemark} - {\dummyquotemark} - {\dummyquotemark} - % Plain style for PDF strings \DeclarePlainStyle{"}{"}{'}{'} @@ -206,6 +206,110 @@ \DeclareQuoteOption{spanish} \DeclareQuoteOption{swedish} +% Register quotation marks (per output encoding) + +\DeclareQuoteGlyph{OT1}{34}% = \textquotedblright +\DeclareQuoteGlyph{OT1}{39}% = \textquoteright +\DeclareQuoteGlyph{OT1}{92}% = \textquotedblleft +\DeclareQuoteGlyph{OT1}{96}% = \textquoteleft + +\DeclareQuoteGlyph{OT2}{34}% = \textquotedbl +\DeclareQuoteGlyph{OT2}{39}% = \textquoteright +\DeclareQuoteGlyph{OT2}{60}% = \guillemotleft +\DeclareQuoteGlyph{OT2}{62}% = \guillemotright +\DeclareQuoteGlyph{OT2}{91}% = [[ ligature = \guillemotleft +\DeclareQuoteGlyph{OT2}{93}% = ]] ligature = \guillemotright +\DeclareQuoteGlyph{OT2}{96}% = \textquoteleft + +\DeclareQuoteGlyph{OT4}{34}% = \textquotedblright +\DeclareQuoteGlyph{OT4}{39}% = \textquoteright +\DeclareQuoteGlyph{OT4}{92}% = \textquotedblleft +\DeclareQuoteGlyph{OT4}{96}% = \textquoteleft +\DeclareQuoteGlyph{OT4}{174}% = \guillemotleft +\DeclareQuoteGlyph{OT4}{175}% = \guillemotright +\DeclareQuoteGlyph{OT4}{255}% = \quotedblbase + +\DeclareQuoteGlyph{T1}{13}% = \quotesinglbase +\DeclareQuoteGlyph{T1}{14}% = \guilsinglleft +\DeclareQuoteGlyph{T1}{15}% = \guilsinglright +\DeclareQuoteGlyph{T1}{16}% = \textquotedblleft +\DeclareQuoteGlyph{T1}{17}% = \textquotedblright +\DeclareQuoteGlyph{T1}{18}% = \quotedblbase +\DeclareQuoteGlyph{T1}{19}% = \guillemotleft +\DeclareQuoteGlyph{T1}{20}% = \guillemotright +\DeclareQuoteGlyph{T1}{34}% = \textquotedbl +\DeclareQuoteGlyph{T1}{39}% = \textquoteright +\DeclareQuoteGlyph{T1}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{T1}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{T1}{96}% = \textquoteleft + +\DeclareQuoteGlyph{LY1}{34}% = \textquotedbl +\DeclareQuoteGlyph{LY1}{39}% = \textquoteright +\DeclareQuoteGlyph{LY1}{96}% = \textquoteleft +\DeclareQuoteGlyph{LY1}{129}% = \textquotesingle +\DeclareQuoteGlyph{LY1}{130}% = \quotesinglbase +\DeclareQuoteGlyph{LY1}{132}% = \quotedblbase +\DeclareQuoteGlyph{LY1}{139}% = \guilsinglleft +\DeclareQuoteGlyph{LY1}{147}% = \textquotedblleft +\DeclareQuoteGlyph{LY1}{148}% = \textquotedblright +\DeclareQuoteGlyph{LY1}{155}% = \guilsinglright +\DeclareQuoteGlyph{LY1}{171}% = \guillemotleft +\DeclareQuoteGlyph{LY1}{187}% = \guillemotright + +\DeclareQuoteGlyph{T2A}{16}% = \textquotedblleft +\DeclareQuoteGlyph{T2A}{17}% = \textquotedblright +\DeclareQuoteGlyph{T2A}{34}% = \textquotedbl +\DeclareQuoteGlyph{T2A}{39}% = \textquoteright +\DeclareQuoteGlyph{T2A}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{T2A}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{T2A}{96}% = \textquoteleft +\DeclareQuoteGlyph{T2A}{189}% = \quotedblbase +\DeclareQuoteGlyph{T2A}{190}% = \guillemotleft +\DeclareQuoteGlyph{T2A}{191}% = \guillemotright + +\DeclareQuoteGlyph{T2B}{16}% = \textquotedblleft +\DeclareQuoteGlyph{T2B}{17}% = \textquotedblright +\DeclareQuoteGlyph{T2B}{34}% = \textquotedbl +\DeclareQuoteGlyph{T2B}{39}% = \textquoteright +\DeclareQuoteGlyph{T2B}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{T2B}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{T2B}{96}% = \textquoteleft +\DeclareQuoteGlyph{T2B}{189}% = \quotedblbase +\DeclareQuoteGlyph{T2B}{190}% = \guillemotleft +\DeclareQuoteGlyph{T2B}{191}% = \guillemotright + +\DeclareQuoteGlyph{T2C}{16}% = \textquotedblleft +\DeclareQuoteGlyph{T2C}{17}% = \textquotedblright +\DeclareQuoteGlyph{T2C}{34}% = \textquotedbl +\DeclareQuoteGlyph{T2C}{39}% = \textquoteright +\DeclareQuoteGlyph{T2C}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{T2C}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{T2C}{96}% = \textquoteleft +\DeclareQuoteGlyph{T2C}{189}% = \quotedblbase +\DeclareQuoteGlyph{T2C}{190}% = \guillemotleft +\DeclareQuoteGlyph{T2C}{191}% = \guillemotright + +\DeclareQuoteGlyph{X2}{16}% = \textquotedblleft +\DeclareQuoteGlyph{X2}{17}% = \textquotedblright +\DeclareQuoteGlyph{X2}{34}% = \textquotedbl +\DeclareQuoteGlyph{X2}{39}% = \textquoteright +\DeclareQuoteGlyph{X2}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{X2}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{X2}{96}% = \textquoteleft +\DeclareQuoteGlyph{X2}{189}% = \quotedblbase +\DeclareQuoteGlyph{X2}{190}% = \guillemotleft +\DeclareQuoteGlyph{X2}{191}% = \guillemotright + +\DeclareQuoteGlyph{LCY}{13}% = \textquotesingle +\DeclareQuoteGlyph{LCY}{34}% = \textquotedbl +\DeclareQuoteGlyph{LCY}{39}% = \textquoteright +\DeclareQuoteGlyph{LCY}{60}% = << ligature = \guillemotleft +\DeclareQuoteGlyph{LCY}{62}% = >> ligature = \guillemotright +\DeclareQuoteGlyph{LCY}{96}% = \textquoteleft +\DeclareQuoteGlyph{LCY}{253}% = \guillemotleft +\DeclareQuoteGlyph{LCY}{254}% = \guillemotright +\DeclareQuoteGlyph{LCY}{255}% = \quotedblbase + \endinput % Auxiliary commands for some styles diff --git a/Master/texmf-dist/tex/latex/csquotes/csquotes.sty b/Master/texmf-dist/tex/latex/csquotes/csquotes.sty index 1d56c2337d3..0d9a486f7a1 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csquotes.sty +++ b/Master/texmf-dist/tex/latex/csquotes/csquotes.sty @@ -1,6 +1,6 @@ -% $Id: csquotes.sty,v 4.3 2008/11/23 16:02:45 lehman stable $ +% $Id: csquotes.sty,v 4.4 2009/05/30 13:12:20 lehman stable $ -% Copyright (c) 2003-2008 Philipp Lehman. +% Copyright (c) 2003-2009 Philipp Lehman. % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License @@ -18,7 +18,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{csquotes} -[\csq@rcsid $Id: csquotes.sty,v 4.3 2008/11/23 16:02:45 lehman stable $ +[\csq@rcsid $Id: csquotes.sty,v 4.4 2009/05/30 13:12:20 lehman stable $ context-sensitive quotations] %% Compatibility and requirements @@ -31,7 +31,7 @@ {\PackageError{csquotes} {Outdated 'etoolbox' package} {Upgrade to etoolbox v1.7 (2008/06/28) or later.\MessageBreak - I found: '\csname ver@etoolbox.sty\endcsname'.\MessageBreak + I found: '\csuse{ver@etoolbox.sty}'.\MessageBreak This is a fatal error. I'm aborting now.}% \endinput} @@ -53,16 +53,28 @@ {\let\csq@ifucs\@firstoftwo} {}}} +\AtEndPreamble{% + \@ifpackageloaded{biblatex} + {\@ifpackagelater{biblatex}{2009/05/30} + {} + {\csq@error + {Outdated 'biblatex' package} + {Upgrade to biblatex v0.8d (2009/05/30) or later.\MessageBreak + I found: '\csuse{ver@biblatex.sty}'}}} + {}} + %% Category codes -\def\csq@docatcodes{\do\~\do\&\do\:\do\"} +\def\csq@docatcodes{\do\~\do\&\do\:\do\"\do\<\do\>} \def\do#1{\noexpand\do\noexpand#1{\the\catcode`#1}} \edef\csq@docatcodes{\csq@docatcodes} \catcode`\~=\active \catcode`\&=3 -\catcode`\:=12 -\catcode`\"=12 +\@makeother\: +\@makeother\" +\@makeother\< +\@makeother\> %% General things @@ -74,6 +86,7 @@ \newcount\csq@gtype \newcount\csq@glevel \newcount\csq@qlevel +\newcount\csq@maxlvl \newcount\csq@tshold \providecommand{\@gobblethree}[3]{} @@ -91,13 +104,24 @@ \appto#2{#3#1}% \fi} -\newtoks\csq@ltxeverypar -\def\csq@addto@everypar#1{% - \let\csq@everypar\everypar - \csq@ltxeverypar=\expandafter{\the\everypar}% - \csq@everypar={\the\csq@ltxeverypar#1}% - \let\everypar\csq@ltxeverypar - \let\csq@addto@everypar\@gobble} +% {<macro>} + +\def\csq@everypar#1{% + \let\csq@theeverypar#1% + \ifx\csq@theeverypar\@empty + \else + \csq@everypar@i + \fi} + +\def\csq@everypar@i{% + \leavevmode + \let\csq@new@everypar\everypar + \csq@ltx@everypar=\expandafter{\the\everypar}% + \csq@new@everypar={\the\csq@ltx@everypar\csq@theeverypar}% + \let\everypar\csq@ltx@everypar + \let\csq@everypar@i\relax} + +\newtoks\csq@ltx@everypar % Miscellaneous tests @@ -174,34 +198,16 @@ \ifnum\csq@gtype=\currentgrouptype \ifnum\csq@glevel=\currentgrouplevel \else - \csq@mismatch{% - I have detected a group level mismatch. Verify that all - groups\MessageBreak and all active quotes are properly - balanced and nested. If you\MessageBreak continue, I - will write a summary of all previously opened - groups\MessageBreak to the transcript file}% - \showgroups + \csq@err@glevel \fi \else - \csq@mismatch{% - I have detected a group type mismatch. Verify that all - groups\MessageBreak and all active quotes are properly - balanced and nested. If you\MessageBreak continue, I - will write a summary of all previously opened - groups\MessageBreak to the transcript file}% - \showgroups + \csq@err@gtype \fi \egroup} \AtEndDocument{% \ifnum\csq@qlevel>\z@ - \csq@err@mismatch{% - Still some open quote group(s); the current - level is \the\csq@qlevel.\MessageBreak - If you continue, I will write a summary of all - previously\MessageBreak opened groups to the - transcript file}% - \showgroups + \csq@err@gleft \fi} %% User feedback @@ -226,6 +232,13 @@ % Errors +\protected\def\csq@errormark{% + \rule[0.25ex]{1.25ex}{1.25ex}} + +\protected\def\csq@eqerror{% + \csq@eqgroup + \csq@errormark} + \protected\def\csq@mismatch{% \csq@errormark \csq@err@mismatch} @@ -240,26 +253,51 @@ {'\string#1' invalid in math mode} {This command may not be used in math mode}} -\protected\def\csq@err@notdef#1{% +\protected\def\csq@err@undef#1{% \csq@error {'\string#1' not defined} {This command or environment environment appears to be\MessageBreak undefined}} -\protected\def\csq@err@invldopt#1{% +\protected\def\csq@err@opt#1{% \csq@error {Option '#1' invalid} {The option you have supplied is invalid. See the csquotes manual\MessageBreak for valid option keys and their possible values}} +\protected\def\csq@err@glevel{% + \csq@mismatch{% + I have detected a group level mismatch. Verify that all + groups\MessageBreak and all active quotes are properly + balanced and nested. If you\MessageBreak continue, I + will write a summary of all previously opened + groups\MessageBreak to the transcript file}% + \showgroups} + +\protected\def\csq@err@gtype{% + \csq@mismatch{% + I have detected a group type mismatch. Verify that all + groups\MessageBreak and all active quotes are properly + balanced and nested. If you\MessageBreak continue, I + will write a summary of all previously opened + groups\MessageBreak to the transcript file}% + \showgroups} + +\protected\def\csq@err@gleft{% + \csq@err@mismatch{% + Still \the\csq@qlevel\space quote\ifnum\csq@qlevel>\@ne s\fi + \space open. If you continue, I will write a summary\MessageBreak + of all previously opened groups to the transcript file}% + \showgroups} + \protected\def\csq@err@alloc{% \csq@error {Invalid argument} {One of the arguments you have supplied is already allocated as\MessageBreak active quote or delimiter}} -\protected\def\csq@err@invldchar{% +\protected\def\csq@err@char{% \csq@error {Invalid argument} {Only single characters with category code 12 or 13 may @@ -268,7 +306,7 @@ are part of the LaTeX syntax or reserved\MessageBreak for a specific purpose are invalid}} -\protected\def\csq@err@invldutf{% +\protected\def\csq@err@utf{% \csq@error {Invalid argument} {Only valid UTF-8 sequences representing a single @@ -304,15 +342,31 @@ {#1} {Load the 'babel' package to use this feature}} +\protected\def\csq@warn@nostyle#1{% + \csq@warning + {No style for language '#1'.\MessageBreak + Using fallback style} + {No style for language '#1'} + {Define a style or alias for this language first}} + \protected\def\csq@warn@location#1{% \csq@warning {'\string#1' invalid at this point.\MessageBreak Ignoring command} {'\string#1' invalid at this point} {This command may not be used at this particular - point.\MessageBreak See the user manual of the 'csquotes' + point.\MessageBreak See the manual of the 'csquotes' package for details}} +\protected\def\csq@warn@sfcodes#1{% + \csq@warning + {No space factor codes for '#1' encoding.\MessageBreak + Punctuation tracker may fail} + {Punctuation tracker may fail at this point} + {No space factor codes for '#1' encoding. + See \string\DeclareQuoteGlyph\MessageBreak + in the 'csquotes' manual for details}} + \protected\def\csq@warn@legacy#1#2{% \csq@warning {'\string#1' is deprecated.\MessageBreak @@ -321,190 +375,147 @@ {Please use '\string#2' instead}% \let#1#2#2} -%% Opening quotation mark - -% Outer marks +%% Outer quotations \protected\def\csq@oqmark{% + \csq@bqgroup \ifnum\csq@qlevel>\z@ \csq@mismatch{% - Level 1 quote group invalid at this point; - the current level is \the\csq@qlevel}% - \csq@bqgroup + Level 1 quote invalid at this point. + The current level is \the\csq@qlevel}% \advance\csq@qlevel\@ne - \let\csq@oqmark\csq@qerror + \let\csq@oqmark\csq@eqerror \else - \csq@bqgroup \csq@qlevel\@ne - \csq@resetstyle - \csq@init \let\csq@oqmark\csq@qclose - \let\csq@kerntok@i\csq@theqmark@oopen - \csq@theqmark@oopen - \csq@setmark@open - \expandafter\csq@restkern + \expandafter\csq@qopen \fi} -% Inner marks +%% Inner quotations \protected\def\csq@iqmark{% + \csq@bqgroup \ifnum\csq@qlevel>\@ne \csq@mismatch{% - Level 2 quote group invalid at this point; - the current level is \the\csq@qlevel}% - \csq@bqgroup + Level 2 quote invalid at this point. + The current level is \the\csq@qlevel}% \advance\csq@qlevel\@ne - \let\csq@iqmark\csq@qerror + \let\csq@iqmark\csq@eqerror \else - \csq@bqgroup \csq@qlevel\tw@ - \csq@resetstyle - \csq@init \let\csq@iqmark\csq@qclose - \csq@addkern@open - \csq@theqmark@iopen + \expandafter\csq@qopen \fi} -% Nestable marks +%% Nestable quotations -\protected\def\csq@qopen{% - \csq@bqgroup\csq@qopen@i} +\protected\def\csq@oqopen{% + \csq@bqgroup + \csq@oqopen@i} -\protected\def\csq@qopen@i{% - \ifnum\csq@qlevel>\@ne - \csq@mismatch{% - New quote group invalid at this point; - the current level is \the\csq@qlevel}% - \advance\csq@qlevel\@ne +\def\csq@oqopen@i{% + \advance\csq@qlevel\@ne + \csq@qopen} + +\protected\def\csq@iqopen{% + \csq@bqgroup + \csq@iqopen@i} + +\def\csq@iqopen@i{% + \ifnum\csq@qlevel=\z@ + \advance\csq@qlevel\tw@ \else \advance\csq@qlevel\@ne - \csq@resetstyle - \csq@init - \ifnum\csq@qlevel=\@ne - \let\csq@kerntok@i\csq@theqmark@oopen - \csq@theqmark@oopen - \csq@setmark@open - \expandafter\expandafter - \expandafter\csq@restkern - \else - \csq@addkern@open - \csq@theqmark@iopen - \fi - \fi} + \fi + \csq@qopen} -\protected\def\csq@iqopen{% - \csq@bqgroup\csq@iqopen@i} +%% Opening marks -\protected\def\csq@iqopen@i{% - \ifnum\csq@qlevel>\@ne +\def\csq@qopen{% + \ifnum\csq@qlevel>\csq@maxlvl \csq@mismatch{% - Level 2 quote group invalid at this point; - the current level is \the\csq@qlevel}% - \advance\csq@qlevel\@ne + Level \the\csq@qlevel\space quote invalid at this point. + The maximum level is \the\csq@maxlvl}% \else - \csq@qlevel\tw@ \csq@resetstyle \csq@init \csq@addkern@open - \csq@theqmark@iopen + \ifodd\csq@qlevel + \let\csq@kernchar@i\csq@thequote@oopen + \csq@thequote@oopen + \else + \let\csq@kernchar@i\csq@thequote@iopen + \csq@thequote@iopen + \fi + \csq@setmarker@open + \expandafter\csq@fixkern \fi} -%% Closing quotation mark +%% Closing marks \protected\def\csq@qclose{% - \ifnum\csq@qlevel=\@ne - \ifdim\lastkern=\csq@frenchmark - \unkern\unkern - \csq@eqgroup + \ifnum\csq@qlevel=\z@ + \csq@mismatch{% + Cannot close any quote. The current level is 0}% + \else + \ifnum\csq@qlevel>\csq@maxlvl + \csq@eqerror \else - \csq@addkern@close - \csq@theqmark@oclose - \let\csq@kerntok@i\csq@theqmark@oclose - \csq@qclose@i \expandafter\expandafter - \expandafter\csq@restkern + \expandafter\csq@qclose@i \fi + \fi} + +\def\csq@qclose@i{% + \ifdim\lastkern=\csq@omitmarker + \csq@eqgroup \else - \ifnum\csq@qlevel=\tw@ - \csq@theqmark@iclose - \csq@setmark@close - \let\csq@kerntok@i\csq@theqmark@iclose - \csq@qclose@i - \expandafter\expandafter - \expandafter\csq@restkern + \csq@addkern@close + \ifodd\csq@qlevel + \csq@thequote@oclose + \let\csq@kernchar@i\csq@thequote@oclose \else - \ifnum\csq@qlevel>\z@ - \csq@qerror - \else - \csq@mismatch{% - Cannot close the current quote group; - the current level is \the\csq@qlevel}% - \fi + \csq@thequote@iclose + \let\csq@kernchar@i\csq@thequote@iclose \fi - \fi} - -\protected\def\csq@qclose@i{% - \expandafter\def - \expandafter\csq@tempa - \expandafter{% + \csq@setmarker@close \expandafter\csq@eqgroup - \expandafter\def - \expandafter\csq@kerntok@i - \expandafter{\csq@kerntok@i}}% - \csq@tempa} - -\protected\def\csq@qerror{% - \csq@eqgroup - \csq@errormark} + \expandafter\def + \expandafter\csq@kernchar@i + \expandafter{\csq@kernchar@i}% + \expandafter\csq@fixkern + \fi} %% Style initialization \def\csq@init{% \csq@setsfcodes - \ifnum\csq@qlevel=\@ne - \csq@theqmark@oinit - \ifx\csq@theqmark@omiddle\@empty - \else - \let\csq@theeverypar\csq@theqmark@omiddle - \leavevmode - \csq@addto@everypar{\csq@theeverypar}% - \fi - \begingroup - \settowidth{\@tempdima}{% - \csq@theqmark@oopen\csq@theqmark@iopen}% - \settowidth{\@tempdimb}{% - \csq@theqmark@oopen\unkern\csq@theqmark@iopen}% - \ifdim\@tempdima=\@tempdimb - \let\csq@tempa\endgroup - \else - \addtolength{\@tempdima}{-\@tempdimb}% - \edef\csq@tempa{\endgroup - \def\noexpand\csq@thekern@open{\the\@tempdima}}% - \fi - \csq@tempa - \begingroup - \settowidth{\@tempdima}{% - \csq@theqmark@iclose\csq@theqmark@oclose}% - \settowidth{\@tempdimb}{% - \csq@theqmark@iclose\unkern\csq@theqmark@oclose}% - \ifdim\@tempdima=\@tempdimb - \let\csq@tempa\endgroup - \else - \addtolength{\@tempdima}{-\@tempdimb}% - \edef\csq@tempa{\endgroup - \def\noexpand\csq@thekern@close{\the\@tempdima}}% - \fi - \csq@tempa + \ifodd\csq@qlevel + \csq@thequote@oinit + \csq@everypar\csq@thequote@omiddle + \else + \csq@thequote@iinit + \csq@everypar\csq@thequote@imiddle \fi - \ifnum\csq@qlevel=\tw@ - \csq@theqmark@iinit - \ifx\csq@theqmark@imiddle\@empty - \else - \let\csq@theeverypar\csq@theqmark@imiddle - \leavevmode - \csq@addto@everypar{\csq@theeverypar}% - \fi - \fi} + \csq@init@kern{open}{o}{i}% + \csq@init@kern{close}{i}{o}} + +\def\csq@init@kern#1#2#3{% + \begingroup + \settowidth{\@tempdima}{% + \csuse{csq@thequote@#2#1}% + \csuse{csq@thequote@#3#1}}% + \settowidth{\@tempdimb}{% + \csuse{csq@thequote@#2#1}\unkern + \csuse{csq@thequote@#3#1}}% + \ifdim\@tempdima=\@tempdimb + \let\csq@tempa\endgroup + \else + \edef\csq@tempa{\endgroup + \csdef{csq@thekern@#1}{% + \the\dimexpr\@tempdima-\@tempdimb\relax}}% + \fi + \csq@tempa} \appto\@parboxrestore{% \let\csq@bquote@i\csq@bquote@iii @@ -513,30 +524,30 @@ %% Restore kerning -\def\csq@restkern{% +\def\csq@fixkern{% \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter - \expandafter\csq@restkern@i} + \expandafter\csq@fixkern@i} -\def\csq@restkern@i{% - \futurelet\csq@kerntok@ii\csq@restkern@ii} +\def\csq@fixkern@i{% + \futurelet\csq@kernchar@ii\csq@fixkern@ii} -\def\csq@restkern@ii{% - \ifcat a\noexpand\csq@kerntok@ii - \expandafter\csq@restkern@iii +\def\csq@fixkern@ii{% + \ifcat a\noexpand\csq@kernchar@ii + \expandafter\csq@fixkern@iii \else - \ifcat 1\noexpand\csq@kerntok@ii + \ifcat 1\noexpand\csq@kernchar@ii \expandafter\expandafter - \expandafter\csq@restkern@iii + \expandafter\csq@fixkern@iii \fi \fi} -\def\csq@restkern@iii{% +\def\csq@fixkern@iii{% \begingroup \settowidth{\@tempdima}{% - \csq@kerntok@i\csq@kerntok@ii}% + \csq@kernchar@i\csq@kernchar@ii}% \settowidth{\@tempdimb}{% - \csq@kerntok@i\relax\csq@kerntok@ii}% + \csq@kernchar@i\relax\csq@kernchar@ii}% \ifdim\@tempdima=\@tempdimb \else \addtolength{\@tempdima}{-\@tempdimb}% @@ -546,24 +557,24 @@ %% Detect and kern adjoining quotes -\def\csq@kernmark{13sp} -\def\csq@frenchmark{17sp} -\let\csq@themark\csq@kernmark -\def\csq@thekern@open{\csq@theqmark@kern} -\def\csq@thekern@close{\csq@theqmark@kern} -\def\csq@theqmark@kern{0.1em} +\def\csq@kernmarker{13sp} +\def\csq@omitmarker{17sp} +\let\csq@themarker\csq@kernmarker +\def\csq@thekern@open{\csq@thequote@kern} +\def\csq@thekern@close{\csq@thequote@kern} +\def\csq@thequote@kern{0.1em} -\def\csq@setmark@open{% +\def\csq@setmarker@open{% \penalty\@M - \hskip-\csq@themark\relax - \hskip\csq@themark\relax} + \hskip-\csq@themarker\relax + \hskip\csq@themarker\relax} -\def\csq@setmark@close{% - \kern-\csq@themark\relax - \kern\csq@themark\relax} +\def\csq@setmarker@close{% + \kern-\csq@themarker\relax + \kern\csq@themarker\relax} \def\csq@addkern@open{% - \ifdim\lastskip=\csq@kernmark + \ifdim\lastskip=\csq@kernmarker \unskip\unskip\unpenalty \unkern % EC fix \ifdim\csq@thekern@open=\z@ @@ -573,7 +584,7 @@ \fi} \def\csq@addkern@close{% - \ifdim\lastkern=\csq@kernmark + \ifdim\lastkern=\csq@kernmarker \unkern\unkern \ifdim\csq@thekern@close=\z@ \else @@ -594,9 +605,9 @@ % 1009 suppress punctuation (biblatex only) \def\csq@setsfcodes{% - \ifcsundef{csq@sfcodes@\f@encoding} - {} - {\@nameuse{csq@sfcodes@\f@encoding}}% + \ifcsdef{csq@sfcodes@\f@encoding} + {\csuse{csq@sfcodes@\f@encoding}} + {\csq@warn@sfcodes\f@encoding}% \sfcode`\)=\z@ \sfcode`\]=\z@ \ifnum\sfcode`\.>2000 @@ -659,9 +670,9 @@ \def\csq@spacefactor{% \ifhmode - \@ifundefined{csq@sfactor@\the\spacefactor} - {\the\spacefactor} - {\@nameuse{csq@sfactor@\the\spacefactor}}% + \ifcsdef{csq@sfactor@\the\spacefactor} + {\csuse{csq@sfactor@\the\spacefactor}} + {\the\spacefactor}% \else 1000% \fi} @@ -727,47 +738,43 @@ \def\csq@setstyle#1{% \begingroup \let\if@safe@actives\iftrue - \ifcsundef{csq@qstyle@#1} + \ifcsdef{csq@qstyle@#1} + {\edef\csq@tempa{\endgroup + \def\noexpand\csq@currentstyle{#1}% + \noexpand\csuse{csq@qstyle@#1}}% + \csq@tempa} {\csq@warning {Quote style '#1' not defined.\MessageBreak Ignoring command} {Quote style '#1' not defined} {Define the style or alias first} - \endgroup} - {\edef\csq@tempa{\endgroup - \def\noexpand\csq@currentstyle{#1}% - \noexpand\@nameuse{csq@qstyle@#1}}% - \csq@tempa}} + \endgroup}} \def\csq@resetstyle{% \ifnum\csq@reset=\@ne \ifx\csq@currentstyle\languagename \else \ifcsundef{csq@qstyle@\languagename} - {\csq@warning - {No style for language '\languagename'.\MessageBreak - Using fallback style} - {No style for language '\languagename'} - {Define a style or alias for this language first}% + {\csq@warn@nostyle\languagename \csq@setstyle{fallback}} {\csq@setstyle{\languagename}}% \fi \fi} \def\csq@savelang{% - \ifundef\csq@mainlang - {\edef\csq@mainlang{\languagename}} - {}} + \ifdef\csq@mainlang + {} + {\edef\csq@mainlang{\languagename}}} \def\csq@resetlang{% - \ifundef\csq@mainlang - {} - {\@nameuse{otherlanguage*}{\csq@mainlang}}} + \ifdef\csq@mainlang + {\csuse{otherlanguage*}{\csq@mainlang}} + {}} % \lowercase: workaround for page headers of book.cls et al. \def\csq@lang#1{% \csq@savelang - \lowercase{\@nameuse{otherlanguage*}{#1}}} + \lowercase{\csuse{otherlanguage*}{#1}}} \def\csq@nolang#1{% \begingroup @@ -815,7 +822,10 @@ \csq@reset\@ne \else \csq@info{Adjusting default style}% - \DeclareQuoteAlias{\bbl@main@language}{default}% + \ifcsundef{csq@qstyle@\bbl@main@language} + {\csq@warn@nostyle\bbl@main@language + \DeclareQuoteAlias{fallback}{default}} + {\DeclareQuoteAlias{\bbl@main@language}{default}}% \fi} \appto\csq@mknobabel{% @@ -883,7 +893,7 @@ {\csq@quote@i{}}}} \long\def\csq@quote@i#1#2{% - \csq@bqgroup #1\csq@qopen@i #2\csq@qclose} + \csq@bqgroup #1\csq@oqopen@i #2\csq@qclose} \long\def\csq@quote@ii#1#2{% \csq@bqgroup #1\csq@iqopen@i #2\csq@qclose} @@ -942,7 +952,7 @@ {\csq@err@mmode\textquote} {\@ifstar {\csq@getcargs{\csq@tquote{\csq@iqopen@i}}} - {\csq@getcargs{\csq@tquote{\csq@qopen@i}}}}} + {\csq@getcargs{\csq@tquote{\csq@oqopen@i}}}}} % {<init><macro>}{<hook>}{<cite>}{<punct>}{<text>} @@ -966,7 +976,7 @@ {\@ifstar\csq@ftquote@ii\csq@ftquote@i}} \def\csq@ftquote@i#1{% - \csq@getcargs{\csq@tquote{\csq@lang{#1}\csq@qopen@i}}} + \csq@getcargs{\csq@tquote{\csq@lang{#1}\csq@oqopen@i}}} \def\csq@ftquote@ii#1{% \csq@getcargs{\csq@tquote{\csq@lang{#1}\csq@iqopen@i}}} @@ -976,7 +986,7 @@ {\@ifstar\csq@htquote@ii\csq@htquote@i}} \def\csq@htquote@i#1{% - \csq@getcargs{\csq@tquote{\csq@hyph{#1}\csq@qopen@i}}} + \csq@getcargs{\csq@tquote{\csq@hyph{#1}\csq@oqopen@i}}} \def\csq@htquote@ii#1{% \csq@getcargs{\csq@tquote{\csq@hyph{#1}\csq@iqopen@i}}} @@ -987,7 +997,7 @@ {\csq@err@mmode\textcquote} {\@ifstar {\csq@getccargs{\csq@tquote{\csq@iqopen@i}}} - {\csq@getccargs{\csq@tquote{\csq@qopen@i}}}}} + {\csq@getccargs{\csq@tquote{\csq@oqopen@i}}}}} % Integrated text quotes + babel @@ -997,7 +1007,7 @@ {\@ifstar\csq@ftcquote@ii\csq@ftcquote@i}} \def\csq@ftcquote@i#1{% - \csq@getccargs{\csq@tquote{\csq@lang{#1}\csq@qopen@i}}} + \csq@getccargs{\csq@tquote{\csq@lang{#1}\csq@oqopen@i}}} \def\csq@ftcquote@ii#1{% \csq@getccargs{\csq@tquote{\csq@lang{#1}\csq@iqopen@i}}} @@ -1007,7 +1017,7 @@ {\@ifstar\csq@htcquote@ii\csq@htcquote@i}} \def\csq@htcquote@i#1{% - \csq@getccargs{\csq@tquote{\csq@hyph{#1}\csq@qopen@i}}} + \csq@getccargs{\csq@tquote{\csq@hyph{#1}\csq@oqopen@i}}} \def\csq@htcquote@ii#1{% \csq@getccargs{\csq@tquote{\csq@hyph{#1}\csq@iqopen@i}}} @@ -1047,8 +1057,11 @@ \csq@mkblockquote \@fileswfalse \csq@blockfalse + \let\csq@newline\newline \setbox\@tempboxa=\vbox{% \def\par{\aftergroup\csq@blocktrue\@par}% + \def\newline{\aftergroup\csq@blocktrue + \let\newline\csq@newline\newline}% \parfillskip\z@ \@plus 1fil\relax \parindent\z@ \vrule \@height1\baselineskip \@width\z@ #1#5}% @@ -1102,7 +1115,7 @@ \ifblank{#3} {} {\appto\csq@tempa{#2{#3}}}% - #1\csq@qopen@i\quotetext#5\endquotetext + #1\csq@oqopen@i\quotetext#5\endquotetext \csq@tempa\mkfinblockpunct{#4}} \newrobustcmd*{\BlockquoteDisable}[1]{% @@ -1169,7 +1182,7 @@ \csq@bdquote{#1}} \def\csq@bdquote#1{% - \@nameuse{\csq@blockenvironment}% + \csuse{\csq@blockenvironment}% \csq@blocktrue \begingroup#1% \csq@setsfcodes @@ -1186,7 +1199,7 @@ \csq@tempb \expandafter\mkfindisppunct \expandafter{\csq@tempc}% - \@nameuse{end\csq@blockenvironment}} + \csuse{end\csq@blockenvironment}} % Display quotes + babel @@ -1480,65 +1493,65 @@ \newcommand*{\csqQQ}[1]{% \csq@ifsafeactives - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\csq@iftypeset {\csq@ifmmode - {\@nameuse{csq@saved@#1}} - {\@nameuse{csq@textdef@#1}}} + {\csuse{csq@saved@#1}} + {\csuse{csq@textdef@#1}}} {\csq@ifstrings - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\noexpand\csqQQ{#1}}}}} \newcommand*{\csqBQ}[1]{% \csq@ifsafeactives - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\csq@iftypeset {\csq@ifmmode - {\@nameuse{csq@saved@#1}} + {\csuse{csq@saved@#1}} {\csq@ifnested {\csq@err@nbquote} - {\csq@nbgobble{\@nameuse{csq@textdef@#1}}}}} + {\csq@nbgobble{\csuse{csq@textdef@#1}}}}} {\csq@ifstrings - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\noexpand\csqBQbeg{#1}}}}} \newcommand*{\csqBQbeg}[1]{% \csq@ifsafeactives - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\csq@iftypeset {\csq@ifmmode - {\@nameuse{csq@saved@#1}} + {\csuse{csq@saved@#1}} {\csq@ifnested {\csq@err@nbquote} - {\csq@nbgobble{\@nameuse{csq@xtxtdef@#1}}}}} + {\csq@nbgobble{\csuse{csq@xtxtdef@#1}}}}} {\csq@ifstrings - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\noexpand\csqBQbeg{#1}}}}} \newcommand*{\csqBQsep}[1]{% \csq@ifsafeactives - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\csq@iftypeset - {\@nameuse{csq@saved@#1}} + {\csuse{csq@saved@#1}} {\csq@ifstrings - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\noexpand\csqBQsep{#1}}}}} \newcommand*{\csqBQend}[1]{% \csq@ifsafeactives - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\csq@iftypeset - {\@nameuse{csq@saved@#1}} + {\csuse{csq@saved@#1}} {\csq@ifstrings - {\@nameuse{csq@string@#1}} + {\csuse{csq@string@#1}} {\noexpand\csqBQend{#1}}}}} \appto\csq@mkhyperref{% - \def\csqQQ#1{\@nameuse{csq@pdfdef@#1}}% - \def\csqBQ#1{\@nameuse{csq@pdfdef@#1}}% - \def\csqBQbeg#1{\@nameuse{csq@pdfdef@#1}}% - \def\csqBQsep#1{\@nameuse{csq@saved@#1}}% - \def\csqBQend#1{\@nameuse{csq@saved@#1}}} + \def\csqQQ#1{\csuse{csq@pdfdef@#1}}% + \def\csqBQ#1{\csuse{csq@pdfdef@#1}}% + \def\csqBQbeg#1{\csuse{csq@pdfdef@#1}}% + \def\csqBQsep#1{\csuse{csq@saved@#1}}% + \def\csqBQend#1{\csuse{csq@saved@#1}}} % Define specials @@ -1611,12 +1624,12 @@ {\ifcsundef{csq@special@\csq@number{#1}} {#3} {\csq@err@alloc}} - {\csq@err@invldutf}} + {\csq@err@utf}} {\csq@ifvalidchar{#1} {\ifcsundef{csq@special@\number`#1} {#2} {\csq@err@alloc}} - {\csq@err@invldchar}}} + {\csq@err@char}}} % {<char>}{<true>}{<false>} @@ -1628,13 +1641,13 @@ {\ifnum`#1<128\relax \expandafter\@secondoftwo \else - \csq@err@invldutf + \csq@err@utf \expandafter\@gobbletwo \fi} {\@firstoftwo}} {\csq@ifsingle{#1} {\@secondoftwo} - {\csq@err@invldchar + {\csq@err@char \@gobbletwo}}} \ifundef\inputencodingname % inputenc 2006/05/05 v1.1b @@ -1757,7 +1770,7 @@ \newrobustcmd*{\MakeAutoQuote}{% \@ifstar {\csq@mkaquote\csq@iqopen} - {\csq@mkaquote\csq@qopen}} + {\csq@mkaquote\csq@oqopen}} \def\csq@mkaquote#1#2#3{% \csq@addspecial{#2}{#1}{\csq@pdf@ooqmark}{}% \csq@addspecial{#3}{\csq@qclose}{\csq@pdf@coqmark}{}} @@ -1765,7 +1778,7 @@ \newrobustcmd*{\MakeForeignQuote}{% \@ifstar {\csq@mkfquote\csq@iqopen@i} - {\csq@mkfquote\csq@qopen@i}} + {\csq@mkfquote\csq@oqopen@i}} \def\csq@mkfquote#1#2#3#4{% \csq@addspecial{#3} {\csq@bqgroup\csq@lang{#2}#1} @@ -1775,7 +1788,7 @@ \newrobustcmd*{\MakeHyphenQuote}{% \@ifstar {\csq@mkhquote\csq@iqopen@i} - {\csq@mkhquote\csq@qopen@i}} + {\csq@mkhquote\csq@oqopen@i}} \def\csq@mkhquote#1#2#3#4{% \csq@addspecial{#3} {\csq@bqgroup\csq@hyph{#2}#1} @@ -1872,44 +1885,44 @@ \def\csq@declareqstyle@i[#1]{% \csgdef{csq@qstyle@\csq@tempa}{% - \def\csq@theqmark@oinit{% - \let\csq@themark\csq@kernmark#1}}% + \def\csq@thequote@oinit{% + \let\csq@themarker\csq@kernmarker#1}}% \@ifnextchar[%] {\csq@declareqstyle@ii} {\csq@declareqstyle@ii[]}} \def\csq@declareqstyle@ii[#1]#2{% \csgappto{csq@qstyle@\csq@tempa}{% - \def\csq@theqmark@iinit{#1}% - \def\csq@theqmark@oopen{#2}}% + \def\csq@thequote@iinit{#1}% + \def\csq@thequote@oopen{#2}}% \@ifnextchar[%] {\csq@declareqstyle@iii} {\csq@declareqstyle@iii[]}} \def\csq@declareqstyle@iii[#1]#2{% \csgappto{csq@qstyle@\csq@tempa}{% - \def\csq@theqmark@omiddle{#1}% - \def\csq@theqmark@oclose{#2}}% + \def\csq@thequote@omiddle{#1}% + \def\csq@thequote@oclose{#2}}% \@ifnextchar[%] {\csq@declareqstyle@iv} {\csq@declareqstyle@iv[]}} \def\csq@declareqstyle@iv[#1]#2{% \ifblank{#1} - {\def\csq@theqmark@kern{\z@}} - {\def\csq@theqmark@kern{#1}}% + {\def\csq@thequote@kern{\z@}} + {\def\csq@thequote@kern{#1}}% \csxappto{csq@qstyle@\csq@tempa}{% - \def\noexpand\csq@theqmark@kern{\csq@theqmark@kern}}% + \def\noexpand\csq@thequote@kern{\csq@thequote@kern}}% \csgappto{csq@qstyle@\csq@tempa}{% - \def\csq@theqmark@iopen{#2}}% + \def\csq@thequote@iopen{#2}}% \@ifnextchar[%] {\csq@declareqstyle@v} {\csq@declareqstyle@v[]}} \def\csq@declareqstyle@v[#1]#2{% \csgappto{csq@qstyle@\csq@tempa}{% - \def\csq@theqmark@imiddle{#1}% - \def\csq@theqmark@iclose{#2}}% + \def\csq@thequote@imiddle{#1}% + \def\csq@thequote@iclose{#2}}% \endgroup} \@onlypreamble\DeclareQuoteStyle @@ -1930,7 +1943,7 @@ {} {\csq@info{Redefining alias '#3' -> '\csq@tempa'}}% \csxdef{csq@qstyle@#3}{% - \noexpand\@nameuse{csq@qstyle@\csq@tempa}}}% + \noexpand\csuse{csq@qstyle@\csq@tempa}}}% \endgroup} \@onlypreamble\DeclareQuoteAlias @@ -1954,6 +1967,11 @@ \protected\def\DeclareQuoteOption#1{% \csq@warn@location\DeclareQuoteOption}} +%% Space factor codes + +\newrobustcmd*{\DeclareQuoteGlyph}[2]{% + \csgappto{csq@sfcodes@#1}{\sfcode#2=\z@\relax}} + %% Set defaults \newrobustcmd*{\SetBlockThreshold}[1]{% @@ -1961,12 +1979,12 @@ \newrobustcmd*{\SetBlockEnvironment}[1]{% \ifcsundef{#1} - {\csq@err@notdef{#1}} + {\csq@err@undef{#1}} {\def\csq@blockenvironment{#1}}} \newrobustcmd*{\SetCiteCommand}[1]{% \ifundef#1% - {\csq@err@notdef{#1}} + {\csq@err@undef{#1}} {\def\csq@cite{#1}}} % Legacy commands @@ -1976,12 +1994,27 @@ \newrobustcmd*{\setblockenvironment}{% \csq@warn@legacy\setblockenvironment\SetBlockEnvironment} +%% Internal interface for biblatex + +\newcommand*{\@quotelevel}{} +\let\@quotelevel\csq@qlevel + +\newrobustcmd*{\@setquotesfcodes}{% + \csq@setsfcodes} + +\newcommand*{\@ifquotemarker}{% + \ifdim\lastskip=\csq@kernmarker\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + %% Author interface to auto quotes \newrobustcmd*{\openautoquote}{% \csq@ifmmode {\csq@err@mmode\openautoquote} - {\csq@qopen}} + {\csq@oqopen}} \newrobustcmd*{\closeautoquote}{% \csq@ifmmode @@ -2009,93 +2042,65 @@ \newrobustcmd*{\initoquote}{% \csq@resetstyle \csq@qlevel\@ne - \csq@theqmark@oinit} + \csq@init} \newrobustcmd*{\initiquote}{% \csq@resetstyle \csq@qlevel\tw@ - \csq@theqmark@iinit} + \csq@init} \newrobustcmd*{\textooquote}{% \csq@resetstyle - \csq@theqmark@oopen - \csq@setmark@open - \let\csq@kerntok@i\csq@theqmark@oopen - \csq@restkern} + \csq@addkern@open + \let\csq@kernchar@i\csq@thequote@oopen + \csq@thequote@oopen + \csq@setmarker@open + \csq@fixkern} \newrobustcmd*{\textmoquote}{% \csq@resetstyle - \csq@theqmark@omiddle} + \csq@thequote@omiddle} \newrobustcmd*{\textcoquote}{% - \csq@resetstyle - \csq@addkern@close - \csq@theqmark@oclose - \let\csq@kerntok@i\csq@theqmark@oclose - \csq@restkern} + \ifdim\lastkern=\csq@omitmarker + \else + \csq@resetstyle + \csq@addkern@close + \csq@thequote@oclose + \let\csq@kernchar@i\csq@thequote@oclose + \csq@setmarker@close + \expandafter\csq@fixkern + \fi} \newrobustcmd*{\textoiquote}{% \csq@resetstyle \csq@addkern@open - \csq@theqmark@iopen} + \let\csq@kernchar@i\csq@thequote@iopen + \csq@thequote@iopen + \csq@setmarker@open + \csq@fixkern} \newrobustcmd*{\textmiquote}{% \csq@resetstyle - \csq@theqmark@imiddle} + \csq@thequote@imiddle} \newrobustcmd*{\textciquote}{% - \csq@resetstyle - \csq@theqmark@iclose - \csq@setmark@close - \let\csq@kerntok@i\csq@theqmark@iclose - \csq@restkern} - -%% Space factor codes - -\csdef{csq@sfcodes@OT1}{% - \sfcode 96=\z@ % textquoteleft - \sfcode 39=\z@ % textquoteright - \sfcode 92=\z@ % textquotedblleft - \sfcode 34=\z@ % textquotedblright -} - -\csdef{csq@sfcodes@T1}{% - \sfcode 96=\z@ % textquoteleft - \sfcode 39=\z@ % textquoteright - \sfcode 16=\z@ % textquotedblleft - \sfcode 17=\z@ % textquotedblright - \sfcode 13=\z@ % quotesinglbase - \sfcode 18=\z@ % quotedblbase - \sfcode 14=\z@ % guilsinglleft - \sfcode 15=\z@ % guilsinglright - \sfcode 19=\z@ % guillemotleft - \sfcode 60=\z@ % guillemotleft (<< ligature) - \sfcode 20=\z@ % guillemotright - \sfcode 62=\z@ % guillemotright (>> ligature) - \sfcode 34=\z@ % textquotedbl -} - -\csdef{csq@sfcodes@LY1}{% - \sfcode 96=\z@ % textquoteleft - \sfcode 39=\z@ % textquoteright - \sfcode147=\z@ % textquotedblleft - \sfcode148=\z@ % textquotedblright - \sfcode130=\z@ % quotesinglbase - \sfcode132=\z@ % quotedblbase - \sfcode139=\z@ % guilsinglleft - \sfcode155=\z@ % guilsinglright - \sfcode171=\z@ % guillemotleft - \sfcode187=\z@ % guillemotright - \sfcode129=\z@ % textquotesingle - \sfcode 34=\z@ % textquotedbl -} + \ifdim\lastkern=\csq@omitmarker + \else + \csq@resetstyle + \csq@addkern@close + \csq@thequote@iclose + \let\csq@kernchar@i\csq@thequote@iclose + \csq@setmarker@close + \expandafter\csq@fixkern + \fi} %% Auxiliary commands for some styles % French \newrobustcmd*{\initfrenchquotes}{% - \let\csq@themark\csq@frenchmark} + \let\csq@themarker\csq@omitmarker} \newrobustcmd*{\mkfrenchopenquote}[1]{% \leavevmode#1\penalty\@M\@frenchquotespace} @@ -2125,13 +2130,21 @@ \fi \fi} -% Fallback styles +% Special styles -\protected\def\csq@errormark{% - \kern0.2em\rule[0.25ex]{1.25ex}{1.25ex}\kern0.2em} +\DeclareQuoteStyle{debug} + {\textbf{[\the\csq@qlevel]}} + [\textbf{[\the\csq@qlevel]}] + {\textbf{[\the\csq@qlevel]}} + {\textbf{[\the\csq@qlevel]}} + [\textbf{[\the\csq@qlevel]}] + {\textbf{[\the\csq@qlevel]}} -\newrobustcmd*{\dummyquotemark}{% - \kern0.2em\textbf{?}\kern0.2em} +\DeclareQuoteStyle{fallback} + {\textbf{?}} + {\textbf{?}} + {\textbf{?}} + {\textbf{?}} %% Package options @@ -2142,8 +2155,8 @@ \define@key{csq}{strict}[true]{% \ifcsundef{csq@opt@strict@#1} - {\csq@err@invldopt{strict=#1}} - {\@nameuse{csq@opt@strict@#1}}} + {\csq@err@opt{strict=#1}} + {\csuse{csq@opt@strict@#1}}} \def\csq@opt@strict@true{% \csq@info{Enabling strict warnings}% \let\csq@warning\csq@warning@strict} @@ -2153,8 +2166,8 @@ \define@key{csq}{babel}[true]{% \ifcsundef{csq@opt@babel@#1} - {\csq@err@invldopt{babel=#1}} - {\@nameuse{csq@opt@babel@#1}}} + {\csq@err@opt{babel=#1}} + {\csuse{csq@opt@babel@#1}}} \def\csq@opt@babel@false{% \csq@info{Disabling multilingual support}% \csq@reset\z@} @@ -2168,6 +2181,13 @@ \def\csq@opt@babel@tryonce{% \csq@reset4\relax} +\define@key{csq}{maxlevel}{% + \ifnum#1<2 + \csq@err@opt{babel=#1}% + \else + \csq@maxlvl#1\relax + \fi} + \define@key{csq}{style}{% \csq@opt@babel@false \DeclareQuoteAlias{#1}{default}} |