}
-} // 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())
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