2016-12-12 12:01 GMT+01:00 Guenter Milde :

> On 2016-12-11, Jürgen Spitzmüller wrote:
>
> >> As opposed to that, I would rather introduce a plain quote style and
> >> ditch the straight quote special char
>
> Seconded. This could also solve the issue with the currently missing
> straight single quote/apostrophe.
>

Yes, good point.


> >> (and a language/style option "RequirePlainQuote").
>
> Do we really require a separate option or could we just use the new
> "straight" style with the existing QuoteStyle keyword in lib/languages?
>

This would be needed if a language or style would not allow other than
straight quotes. The straight style itself would just be yet another style
to select (globally).
IOW the option would enforce plain quotes in the given context (such as
PassThru) even if a different quote style is selected in Document Settings.

Additionally, I would extend the quote-insert lfun to select a given style.
Then we can keep a way to insert straight quote from the menu.


> > BTW I am not so sure anymore that the Hebrew restriction is correct.
> > According to what I read on the Web, Hebrew uses typographic quotation
> > marks as well, just RTL, either ``so'' or ``so,, (and they seem to be
> > supported by babel-hebrew).
>
> > https://en.wikipedia.org/wiki/Hebrew_punctuation#Quotation_marks
>
> Yes, indeed.
>
> This means the special casing
>
>         // In PassThru and Hebrew, we use straight quotes
>         if (pass_thru_ || context_lang_ == "he_IL")
> and
>         || runparams.local_font->language()->lang() == "hebrew";
>
>
> in QuoteInset should be restrichted to PassThru, right?
>

Yes. Additionally, however, we'd need to output macros
(\textquote[dbl]{left,right}) instead of the ligatures, since the ligatures
are (apparently) not supported in the HE font encodings.

The attached patch works fine for me.


>
> This would also obsolete the lyx2lyx conversion for Hebrew quotes.
>

No, since in LyX 2.2.x and earlier, the LaTeX output does not compile. So
the current reversion routine, which produces the LyX 2.2.x state, seems OK
to me (an alternative would be to output the respective macros in ERT).

Jürgen


>
> Günter
>
>
diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp
index 6e19a1b2f6..7653caede8 100644
--- a/src/insets/InsetQuotes.cpp
+++ b/src/insets/InsetQuotes.cpp
@@ -85,6 +85,13 @@ char const * const latex_quote_ot1[2][5] = {
     "\\guillemotleft{}", "\\guillemotright{}" }
 };
 
+char const * const latex_quote_nonlatin[2][5] = {
+       { "\\quotesinglbase ",  "\\textquoteleft{}", "\\textquoteright{}",
+    "\\guilsinglleft{}", "\\guilsinglright{}" },
+  { "\\quotedblbase ", "\\textquotedblleft{}", "\\textquotedblright{}",
+    "\\guillemotleft{}", "\\guillemotright{}" }
+};
+
 char const * const latex_quote_babel[2][5] = {
        { "\\glq ",  "'", "`", "\\flq{}", "\\frq{}" },
   { "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" }
@@ -192,8 +199,8 @@ void InsetQuotes::parseString(string const & s)
 
 docstring InsetQuotes::displayString() const
 {
-       // In PassThru and Hebrew, we use straight quotes
-       if (pass_thru_ || context_lang_ == "he_IL")
+       // In PassThru, we use straight quotes
+       if (pass_thru_)
                return (times_ == DoubleQuotes) ? from_ascii("\"") : 
from_ascii("'");
 
        int const index = quote_index[side_][language_];
@@ -257,11 +264,8 @@ void InsetQuotes::latex(otexstream & os, OutputParams 
const & runparams) const
        const int quoteind = quote_index[side_][language_];
        string qstr;
 
-       // In some context, we output plain quotes
-       bool const force_plain = 
-               runparams.pass_thru
-               || runparams.local_font->language()->lang() == "hebrew";
-       if (force_plain)
+       // In pass-thru context, we output plain quotes
+       if (runparams.pass_thru)
                qstr = (times_ == DoubleQuotes) ? "\"" : "'";
        else if (language_ == FrenchQuotes && times_ == DoubleQuotes
            && prefixIs(runparams.local_font->language()->code(), "fr")
@@ -272,10 +276,16 @@ void InsetQuotes::latex(otexstream & os, OutputParams 
const & runparams) const
                        qstr = "\\og "; //the spaces are important here
                else
                        qstr = " \\fg{}"; //and here
-       } else if (fontenc_ == "T1" && !runparams.use_polyglossia) {
+       } else if (fontenc_ == "T1"
+                  && !runparams.local_font->language()->internalFontEncoding()
+                  && !runparams.use_polyglossia) {
                // Quotation marks for T1 font encoding
                // (using ligatures)
                qstr = latex_quote_t1[times_][quoteind];
+       } else if (runparams.local_font->language()->internalFontEncoding()) {
+               // Quotation marks for internal font encodings
+               // (ligatures not featured)
+               qstr = latex_quote_nonlatin[times_][quoteind];
 #ifdef DO_USE_DEFAULT_LANGUAGE
        } else if (doclang == "default") {
 #else
@@ -290,7 +300,7 @@ void InsetQuotes::latex(otexstream & os, OutputParams const 
& runparams) const
                qstr = latex_quote_babel[times_][quoteind];
        }
 
-       if (!force_plain) {
+       if (!runparams.pass_thru) {
                // Always guard against unfortunate ligatures (!` ?` `` '' ,, 
<< >>)
                char_type const lastchar = os.lastChar();
                if (prefixIs(qstr, "`")) {

Reply via email to