On 2017-02-26, Guenter Milde wrote:
> On 2017-02-26, Jürgen Spitzmüller wrote:
>> Am Sonntag, den 26.02.2017, 15:48 +0000 schrieb Guenter Milde:
>>> The patch e68afbe671394 "plain quote fixes" relies on two wrong
>>> assumptions:

>>> Instead of special-casing the replacement, I propose to provide the
>>> \textquotesingle and \textquotedbl macros for font encodings where
>>> they are
>>> missing.

>> Rather than that, we should output whatever is needed to produce plain
>> quotes in these encodings. I.e., add special cases for lgr in
>> InsetQuotes.

> IMO, this would be far more complicated than the preamble code:

>  % make straight quotes available in all font encodings:
>  \usepackage{textcomp} % provides \textquotesingle
>  \DeclareTextSymbolDefault{\textquotedbl}{T1}

> if plain quotes are used in a non-standard font encoding.

Especially, as the framework is already in place:

        case 0x0022: {
                if (features.runparams().isFullUnicode() && fontspec_)
                        features.require("textquotedblp");
                else if (fontenc_ != "T1")
                        features.require("textquotedbl");
                break;
        }
        case 0x0027: {
                if (features.runparams().isFullUnicode() && fontspec_)
                        features.require("textquotedblp");
                else if (fontenc_ != "T1")
                        features.require("textquotedbl");
                break;
        }


Also, using a LICR macro instead of hard-coded \char allows configuration in
the LaTeX preamble, e.g. if a user prefers teletype OT1 instead of a switch
to T1, she can define, e,g,

  \DeclareTextSymbolCommand{\textquotedbl}{OT1}{\texttt{\char34}}


> In any way, a solution is also required for literal plain quotes (" and ')
> in the LyX source.

... currently, they become curly quotes unless the document encoding is T1.

>>>  TU, 

>> Only since recently. However, TU is covered via the \textquote*plain
>> macros, which are needed since \textquotedbl and \textquotesingle
>> produces typographical quotes!

> \textquotedbl and \textquotesingle are the standard LICR macros
> for *straight* double and single quotes respectively.

> If they produce curly quotes with the TU font encoding, this is a bug.
> Hopefully, it will be fixed upstream.

> Until then, we can overwrite the buggy definitions with the preamble code

>   \ifdefined \UnicodeEncodingName
>     \DeclareTextCommand{\textquotedbl}{\UnicodeEncodingName}{%
>       {\addfontfeatures{Ligatures=ResetAll}\char"0022}}
>     \DeclareTextCommand{\textquotesingle}{\UnicodeEncodingName}{%
>       {\addfontfeatures{Ligatures=ResetAll}\char"0027}}
>   \fi

> and use the standard macros for any font encoding.

Günter

Reply via email to