if (nextpit != paragraphs.end())
++nextpit;
- if (runparams_in.verbatim) {
+ OutputParams runparams = runparams_in;
+ runparams.isLastPar = nextpit == paragraphs.end();
+
+ if (runparams.verbatim) {
int const dist = distance(paragraphs.begin(), pit);
Font const outerfont = outerFont(dist, paragraphs);
}
/*bool need_par = */ pit->latex(bparams, outerfont,
- os, texrow, runparams_in);
+ os, texrow, runparams);
return nextpit;
}
Layout const style = pit->forcePlainLayout() ?
bparams.documentClass().plainLayout() : pit->layout();
- OutputParams runparams = runparams_in;
runparams.moving_arg |= style.needprotect;
bool const maintext = text.isMainText(buf);
docstring const inputenc_arg(from_ascii(newEnc.latexName()));
switch (newEnc.package()) {
case Encoding::none:
+ case Encoding::japanese:
// shouldn't ever reach here, see above
return make_pair(true, 0);
case Encoding::inputenc: {
open_encoding_ = none;
count += 7;
}
- if (runparams.local_font != 0 && oldEnc.package() == Encoding::CJK) {
- // within insets, \inputenc switches need to be
- // embraced within \bgroup ... \egroup; else CJK fails.
+ if (runparams.local_font != 0
+ && oldEnc.package() == Encoding::CJK) {
+ // within insets, \inputenc switches need
+ // to be embraced within \bgroup...\egroup;
+ // else CJK fails.
os << "\\bgroup";
count += 7;
open_encoding_ = inputenc;
}
+ // with the japanese option, inputenc is omitted.
+ if (runparams.use_japanese)
+ return make_pair(true, count);
os << "\\inputencoding{" << inputenc_arg << '}';
return make_pair(true, count + 16);
}