]> git.lyx.org Git - features.git/commitdiff
context-sensitive command termination at some more places.
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 16 Dec 2016 09:20:25 +0000 (10:20 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 16 Dec 2016 09:20:25 +0000 (10:20 +0100)
src/Paragraph.cpp
src/insets/InsetIndex.cpp
src/insets/InsetNewpage.cpp
src/insets/InsetNomencl.cpp

index 135ba96b0abec1a1ee170e4338c49dc964919535..62380336ee7b7e0f804ba7ef323bc6b2dc314272 100644 (file)
@@ -1079,7 +1079,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
            // decorations at all
            && inset->lyxCode() != ERT_CODE) {
                if (running_font.language()->lang() == "farsi")
-                       os << "\\beginL{}";
+                       os << "\\beginL" << termcmd;
                else
                        os << "\\L{";
                close = true;
@@ -1135,7 +1135,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 
        if (close) {
                if (running_font.language()->lang() == "farsi")
-                               os << "\\endL{}";
+                               os << "\\endL" << termcmd;
                        else
                                os << '}';
        }
@@ -1194,19 +1194,19 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
        // Otherwise, we use what LaTeX provides us.
        switch (c) {
        case '\\':
-               os << "\\textbackslash{}";
+               os << "\\textbackslash" << termcmd;
                column += 15;
                break;
        case '<':
-               os << "\\textless{}";
+               os << "\\textless" << termcmd;
                column += 10;
                break;
        case '>':
-               os << "\\textgreater{}";
+               os << "\\textgreater" << termcmd;
                column += 13;
                break;
        case '|':
-               os << "\\textbar{}";
+               os << "\\textbar" << termcmd;
                column += 9;
                break;
        case '-':
@@ -1223,7 +1223,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
                }
                break;
        case '\"':
-               os << "\\char`\\\"{}";
+               os << "\\char`\\\"" << termcmd;
                column += 9;
                break;
 
@@ -1236,12 +1236,12 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
                break;
 
        case '~':
-               os << "\\textasciitilde{}";
+               os << "\\textasciitilde" << termcmd;
                column += 16;
                break;
 
        case '^':
-               os << "\\textasciicircum{}";
+               os << "\\textasciicircum" << termcmd;
                column += 17;
                break;
 
@@ -1339,7 +1339,7 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
                // but we should avoid ligatures
                if (i + 1 >= int(text_.size()) || text_[i + 1] != c)
                        return true;
-               os << "\\textcompwordmark{}";
+               os << "\\textcompwordmark" << termcmd;
                column += 19;
                return true;
        case '|':
@@ -1347,7 +1347,7 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
                return true;
        case '\"':
                // soul.sty breaks with \char`\"
-               os << "\\textquotedbl{}";
+               os << "\\textquotedbl" << termcmd;
                column += 14;
                return true;
        default:
@@ -1367,7 +1367,7 @@ bool Paragraph::Private::latexSpecialT3(char_type const c, otexstream & os,
                os.put(c);
                return true;
        case '|':
-               os << "\\textvertline{}";
+               os << "\\textvertline" << termcmd;
                column += 14;
                return true;
        default:
index f8dca3b3c117acb86a9d101e2c02174c61cdd8ee..455b09fa87638d4ecd4c00d205b5cecd1c18b74d 100644 (file)
@@ -562,7 +562,7 @@ void InsetPrintIndex::latex(otexstream & os, OutputParams const & runparams_in)
 {
        if (!buffer().masterBuffer()->params().use_indices) {
                if (getParam("type") == from_ascii("idx"))
-                       os << "\\printindex{}";
+                       os << "\\printindex" << termcmd;
                return;
        }
        OutputParams runparams = runparams_in;
index e83f56dc705348556b60b667c8aa954eb2debc1a..e062e8bbecf583f1a8610b487c35c81bf64978fb 100644 (file)
@@ -215,21 +215,21 @@ void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
 {
        switch (params_.kind) {
                case InsetNewpageParams::NEWPAGE:
-                       os << "\\newpage{}";
+                       os << "\\newpage" << termcmd;
                        break;
                case InsetNewpageParams::PAGEBREAK:
                        if (runparams.moving_arg)
                                os << "\\protect";
-                       os << "\\pagebreak{}";
+                       os << "\\pagebreak" << termcmd;
                        break;
                case InsetNewpageParams::CLEARPAGE:
-                       os << "\\clearpage{}";
+                       os << "\\clearpage" << termcmd;
                        break;
                case InsetNewpageParams::CLEARDOUBLEPAGE:
-                       os << "\\cleardoublepage{}";
+                       os << "\\cleardoublepage" << termcmd;
                        break;
                default:
-                       os << "\\newpage{}";
+                       os << "\\newpage" << termcmd;
                        break;
        }
 }
index 76bd7b3a0aa8d56da215ddc628cc16c88f23a59d..7395b6c19e71c2c9f619d9b3e5810fb757784450 100644 (file)
@@ -407,7 +407,8 @@ void InsetPrintNomencl::latex(otexstream & os, OutputParams const & runparams_in
                   << from_ascii(getCmdName())
                   << '['
                   << from_ascii(width)
-                  << "]{}";
+                  << "]"
+                  << termcmd;
                return;
        }
        // output the command \printnomenclature