]> git.lyx.org Git - features.git/commitdiff
Properly terminate quote macros by means of new textstream function
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 12 Dec 2016 14:57:42 +0000 (15:57 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 12 Dec 2016 14:57:42 +0000 (15:57 +0100)
This prevents kerning destruction.

src/insets/InsetQuotes.cpp

index 6e19a1b2f698214613d870b9d62a91970d906889..53d204616dfe9cd78ce2d56511f10dc8a1e05bfe 100644 (file)
@@ -73,21 +73,21 @@ int quote_index[2][6] = {
 
 // Corresponding LaTeX code, for double and single quotes.
 char const * const latex_quote_t1[2][5] = {
-       { "\\quotesinglbase ",  "'", "`",
-    "\\guilsinglleft{}", "\\guilsinglright{}" },
+       { "\\quotesinglbase",  "'", "`",
+    "\\guilsinglleft", "\\guilsinglright" },
   { ",,", "''", "``", "<<", ">>" }
 };
 
 char const * const latex_quote_ot1[2][5] = {
-       { "\\quotesinglbase ",  "'", "`",
-    "\\guilsinglleft{}", "\\guilsinglright{}" },
-  { "\\quotedblbase ", "''", "``",
-    "\\guillemotleft{}", "\\guillemotright{}" }
+       { "\\quotesinglbase",  "'", "`",
+    "\\guilsinglleft", "\\guilsinglright" },
+  { "\\quotedblbase", "''", "``",
+    "\\guillemotleft", "\\guillemotright" }
 };
 
 char const * const latex_quote_babel[2][5] = {
-       { "\\glq ",  "'", "`", "\\flq{}", "\\frq{}" },
-  { "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" }
+       { "\\glq",  "'", "`", "\\flq", "\\frq" },
+  { "\\glqq", "''", "``", "\\flqq", "\\frqq" }
 };
 
 char const * const html_quote[2][5] = {
@@ -269,9 +269,9 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
                // Specific guillemets of French babel
                // including correct French spacing
                if (side_ == LeftQuote)
-                       qstr = "\\og "; //the spaces are important here
+                       qstr = "\\og";
                else
-                       qstr = " \\fg{}"; //and here
+                       qstr = " \\fg"; // the space is important here
        } else if (fontenc_ == "T1" && !runparams.use_polyglossia) {
                // Quotation marks for T1 font encoding
                // (using ligatures)
@@ -302,6 +302,10 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
        }
 
        os << from_ascii(qstr);
+       
+       if (prefixIs(qstr, "\\"))
+               // properly terminate the command depending on the context
+               os << termcmd;
 }