}
-} // namespace anon
+} // namespace
void pushLanguageName(string const & lang_name, bool localswitch)
}
+string const & openLanguageName()
+{
+ OutputState * state = getOutputState();
+
+ return openLanguageName(state);
+}
+
+
namespace {
void addArgInsets(Paragraph const & par, string const & prefix,
}
}
-} // anon namespace
+} // namespace
void latexArgInsets(Paragraph const & par, otexstream & os,
// output the proper paragraph start according to latextype.
void parStartCommand(Paragraph const & par, otexstream & os,
- OutputParams const & runparams, Layout const & style)
+ OutputParams const & runparams, Layout const & style)
{
switch (style.latextype) {
case LATEX_COMMAND:
}
}
-} // namespace anon
+} // namespace
// FIXME: this should be anonymous
void TeXOnePar(Buffer const & buf,
}
// With CJK, the CJK tag has to be closed first (see below)
if (runparams.encoding->package() != Encoding::CJK
- && par_lang != openLanguageName(state)
+ && (par_lang != openLanguageName(state) || localswitch)
&& !par_lang.empty()) {
string bc = use_polyglossia ?
getPolyglossiaBegin(lang_begin_command, par_lang, par_language->polyglossiaOpts())
os << from_utf8(everypar);
par.latex(bparams, outerfont, os, runparams, start_pos, end_pos);
- // Make sure that \\par is done with the font of the last
- // character if this has another size as the default.
- // This is necessary because LaTeX (and LyX on the screen)
- // calculates the space between the baselines according
- // to this font. (Matthias)
- //
- // We must not change the font for the last paragraph
- // of non-multipar insets, tabular cells or commands,
- // since this produces unwanted whitespace.
-
Font const font = par.empty()
? par.getLayoutFont(bparams, outerfont)
: par.getFont(bparams, par.size() - 1, outerfont);
bool const is_command = style.isCommand();
- if (style.resfont.size() != font.fontInfo().size()
- && (nextpar || maintext
- || (text.inset().paragraphs().size() > 1
- && text.inset().lyxCode() != CELL_CODE))
- && !is_command) {
- os << '{';
- os << "\\" << from_ascii(font.latexSize()) << " \\par}";
- } else if (is_command) {
+ if (is_command) {
os << '}';
if (!style.postcommandargs().empty())
latexArgInsets(par, os, runparams, style.postcommandargs(), "post:");
break;
}
}
-
- // fall through possible
+ // possible
+ // fall through
default:
// we don't need it for the last paragraph!!!
if (nextpar)
TeXOnePar(buf, text, pit, os, runparams, everypar);
continue;
}
-
+
TeXEnvironmentData const data =
prepareEnvironment(buf, text, par, os, runparams);
// pit can be changed in TeXEnvironment.
Encoding const & oldEnc = *runparams.encoding;
bool moving_arg = runparams.moving_arg;
// If we switch from/to CJK, we need to switch anyway, despite custom inputenc
- bool const from_to_cjk =
+ bool const from_to_cjk =
(oldEnc.package() == Encoding::CJK && newEnc.package() != Encoding::CJK)
|| (oldEnc.package() != Encoding::CJK && newEnc.package() == Encoding::CJK);
if (!force && !from_to_cjk