context-sensitive command termination at some more places.

This commit is contained in:
Juergen Spitzmueller 2016-12-16 10:20:25 +01:00
parent 5dfd1d0f4b
commit 14dbaa7608
4 changed files with 20 additions and 19 deletions

View File

@ -1079,7 +1079,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
// decorations at all // decorations at all
&& inset->lyxCode() != ERT_CODE) { && inset->lyxCode() != ERT_CODE) {
if (running_font.language()->lang() == "farsi") if (running_font.language()->lang() == "farsi")
os << "\\beginL{}"; os << "\\beginL" << termcmd;
else else
os << "\\L{"; os << "\\L{";
close = true; close = true;
@ -1135,7 +1135,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
if (close) { if (close) {
if (running_font.language()->lang() == "farsi") if (running_font.language()->lang() == "farsi")
os << "\\endL{}"; os << "\\endL" << termcmd;
else else
os << '}'; os << '}';
} }
@ -1194,19 +1194,19 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
// Otherwise, we use what LaTeX provides us. // Otherwise, we use what LaTeX provides us.
switch (c) { switch (c) {
case '\\': case '\\':
os << "\\textbackslash{}"; os << "\\textbackslash" << termcmd;
column += 15; column += 15;
break; break;
case '<': case '<':
os << "\\textless{}"; os << "\\textless" << termcmd;
column += 10; column += 10;
break; break;
case '>': case '>':
os << "\\textgreater{}"; os << "\\textgreater" << termcmd;
column += 13; column += 13;
break; break;
case '|': case '|':
os << "\\textbar{}"; os << "\\textbar" << termcmd;
column += 9; column += 9;
break; break;
case '-': case '-':
@ -1223,7 +1223,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
} }
break; break;
case '\"': case '\"':
os << "\\char`\\\"{}"; os << "\\char`\\\"" << termcmd;
column += 9; column += 9;
break; break;
@ -1236,12 +1236,12 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
break; break;
case '~': case '~':
os << "\\textasciitilde{}"; os << "\\textasciitilde" << termcmd;
column += 16; column += 16;
break; break;
case '^': case '^':
os << "\\textasciicircum{}"; os << "\\textasciicircum" << termcmd;
column += 17; column += 17;
break; break;
@ -1339,7 +1339,7 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
// but we should avoid ligatures // but we should avoid ligatures
if (i + 1 >= int(text_.size()) || text_[i + 1] != c) if (i + 1 >= int(text_.size()) || text_[i + 1] != c)
return true; return true;
os << "\\textcompwordmark{}"; os << "\\textcompwordmark" << termcmd;
column += 19; column += 19;
return true; return true;
case '|': case '|':
@ -1347,7 +1347,7 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
return true; return true;
case '\"': case '\"':
// soul.sty breaks with \char`\" // soul.sty breaks with \char`\"
os << "\\textquotedbl{}"; os << "\\textquotedbl" << termcmd;
column += 14; column += 14;
return true; return true;
default: default:
@ -1367,7 +1367,7 @@ bool Paragraph::Private::latexSpecialT3(char_type const c, otexstream & os,
os.put(c); os.put(c);
return true; return true;
case '|': case '|':
os << "\\textvertline{}"; os << "\\textvertline" << termcmd;
column += 14; column += 14;
return true; return true;
default: default:

View File

@ -562,7 +562,7 @@ void InsetPrintIndex::latex(otexstream & os, OutputParams const & runparams_in)
{ {
if (!buffer().masterBuffer()->params().use_indices) { if (!buffer().masterBuffer()->params().use_indices) {
if (getParam("type") == from_ascii("idx")) if (getParam("type") == from_ascii("idx"))
os << "\\printindex{}"; os << "\\printindex" << termcmd;
return; return;
} }
OutputParams runparams = runparams_in; OutputParams runparams = runparams_in;

View File

@ -215,21 +215,21 @@ void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
{ {
switch (params_.kind) { switch (params_.kind) {
case InsetNewpageParams::NEWPAGE: case InsetNewpageParams::NEWPAGE:
os << "\\newpage{}"; os << "\\newpage" << termcmd;
break; break;
case InsetNewpageParams::PAGEBREAK: case InsetNewpageParams::PAGEBREAK:
if (runparams.moving_arg) if (runparams.moving_arg)
os << "\\protect"; os << "\\protect";
os << "\\pagebreak{}"; os << "\\pagebreak" << termcmd;
break; break;
case InsetNewpageParams::CLEARPAGE: case InsetNewpageParams::CLEARPAGE:
os << "\\clearpage{}"; os << "\\clearpage" << termcmd;
break; break;
case InsetNewpageParams::CLEARDOUBLEPAGE: case InsetNewpageParams::CLEARDOUBLEPAGE:
os << "\\cleardoublepage{}"; os << "\\cleardoublepage" << termcmd;
break; break;
default: default:
os << "\\newpage{}"; os << "\\newpage" << termcmd;
break; break;
} }
} }

View File

@ -407,7 +407,8 @@ void InsetPrintNomencl::latex(otexstream & os, OutputParams const & runparams_in
<< from_ascii(getCmdName()) << from_ascii(getCmdName())
<< '[' << '['
<< from_ascii(width) << from_ascii(width)
<< "]{}"; << "]"
<< termcmd;
return; return;
} }
// output the command \printnomenclature // output the command \printnomenclature