mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
parent
c88f331a06
commit
4d1d07ea10
@ -1036,7 +1036,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
|
|||||||
if (open_font && fontswitch_inset) {
|
if (open_font && fontswitch_inset) {
|
||||||
bool lang_closed = false;
|
bool lang_closed = false;
|
||||||
// Close language if needed
|
// Close language if needed
|
||||||
if (closeLanguage) {
|
if (closeLanguage && !lang_switched_at_inset) {
|
||||||
// We need prev_font here as language changes directly at inset
|
// We need prev_font here as language changes directly at inset
|
||||||
// will only be started inside the inset.
|
// will only be started inside the inset.
|
||||||
Font const prev_font = (i > 0) ?
|
Font const prev_font = (i > 0) ?
|
||||||
@ -2686,59 +2686,63 @@ void Paragraph::latex(BufferParams const & bparams,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do we need to change font?
|
// Do we need to change font?
|
||||||
if (!fontswitch_inset &&
|
if ((current_font != running_font ||
|
||||||
(current_font != running_font ||
|
|
||||||
current_font.language() != running_font.language())
|
current_font.language() != running_font.language())
|
||||||
&& i != body_pos - 1)
|
&& i != body_pos - 1)
|
||||||
{
|
{
|
||||||
if (in_ct_deletion) {
|
if (!fontswitch_inset) {
|
||||||
// We have to close and then reopen \lyxdeleted,
|
if (in_ct_deletion) {
|
||||||
// as strikeout needs to be on lowest level.
|
// We have to close and then reopen \lyxdeleted,
|
||||||
bool needPar = false;
|
// as strikeout needs to be on lowest level.
|
||||||
OutputParams rp = runparams;
|
bool needPar = false;
|
||||||
column += running_font.latexWriteEndChanges(
|
OutputParams rp = runparams;
|
||||||
os, bparams, rp, basefont,
|
column += running_font.latexWriteEndChanges(
|
||||||
basefont, needPar);
|
os, bparams, rp, basefont,
|
||||||
os << '}';
|
basefont, needPar);
|
||||||
column += 1;
|
os << '}';
|
||||||
}
|
column += 1;
|
||||||
otexstringstream ots;
|
}
|
||||||
InsetText const * textinset = inInset().asInsetText();
|
otexstringstream ots;
|
||||||
bool const cprotect = textinset
|
InsetText const * textinset = inInset().asInsetText();
|
||||||
? textinset->hasCProtectContent(runparams.moving_arg)
|
bool const cprotect = textinset
|
||||||
&& !textinset->text().isMainText()
|
? textinset->hasCProtectContent(runparams.moving_arg)
|
||||||
: false;
|
&& !textinset->text().isMainText()
|
||||||
column += current_font.latexWriteStartChanges(ots, bparams,
|
: false;
|
||||||
runparams, basefont, last_font, false,
|
column += current_font.latexWriteStartChanges(ots, bparams,
|
||||||
cprotect);
|
runparams, basefont, last_font, false,
|
||||||
// Check again for display math in ulem commands as a
|
cprotect);
|
||||||
// font change may also occur just before a math inset.
|
// Check again for display math in ulem commands as a
|
||||||
if (runparams.inDisplayMath && !deleted_display_math
|
// font change may also occur just before a math inset.
|
||||||
&& runparams.inulemcmd) {
|
if (runparams.inDisplayMath && !deleted_display_math
|
||||||
if (os.afterParbreak())
|
&& runparams.inulemcmd) {
|
||||||
os << "\\noindent";
|
if (os.afterParbreak())
|
||||||
else
|
os << "\\noindent";
|
||||||
os << "\\\\\n";
|
else
|
||||||
}
|
os << "\\\\\n";
|
||||||
running_font = current_font;
|
}
|
||||||
open_font = true;
|
running_font = current_font;
|
||||||
docstring fontchange = ots.str();
|
open_font = true;
|
||||||
os << fontchange;
|
docstring fontchange = ots.str();
|
||||||
// check whether the fontchange ends with a \\textcolor
|
os << fontchange;
|
||||||
// modifier and the text starts with a space. If so we
|
// check whether the fontchange ends with a \\textcolor
|
||||||
// need to add } in order to prevent \\textcolor from gobbling
|
// modifier and the text starts with a space. If so we
|
||||||
// the space (bug 4473).
|
// need to add } in order to prevent \\textcolor from gobbling
|
||||||
docstring const last_modifier = rsplit(fontchange, '\\');
|
// the space (bug 4473).
|
||||||
if (prefixIs(last_modifier, from_ascii("textcolor")) && c == ' ')
|
docstring const last_modifier = rsplit(fontchange, '\\');
|
||||||
os << from_ascii("{}");
|
if (prefixIs(last_modifier, from_ascii("textcolor")) && c == ' ')
|
||||||
else if (ots.terminateCommand())
|
os << from_ascii("{}");
|
||||||
os << termcmd;
|
else if (ots.terminateCommand())
|
||||||
if (in_ct_deletion) {
|
os << termcmd;
|
||||||
// We have to close and then reopen \lyxdeleted,
|
if (in_ct_deletion) {
|
||||||
// as strikeout needs to be on lowest level.
|
// We have to close and then reopen \lyxdeleted,
|
||||||
OutputParams rp = runparams;
|
// as strikeout needs to be on lowest level.
|
||||||
column += Changes::latexMarkChange(os, bparams,
|
OutputParams rp = runparams;
|
||||||
Change(Change::UNCHANGED), change, rp);
|
column += Changes::latexMarkChange(os, bparams,
|
||||||
|
Change(Change::UNCHANGED), change, rp);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
running_font = current_font;
|
||||||
|
open_font = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user