void TeXEnvironment(Buffer const & buf, Text const & text,
- OutputParams const & runparams,
+ OutputParams const & runparams_in,
pit_type & pit, otexstream & os)
{
ParagraphList const & paragraphs = text.paragraphs();
depth_type const current_depth = ipar->params().depth();
Length const & current_left_indent = ipar->params().leftIndent();
+ OutputParams runparams = runparams_in;
+ runparams.no_cprotect = current_layout.nocprotect;
+
// This is for debugging purpose at the end.
pit_type const par_begin = pit;
for (; pit < runparams.par_end; ++pit) {
{
switch (style.latextype) {
case LATEX_COMMAND:
- if (par.needsCProtection(runparams.moving_arg)) {
+ if (!runparams.no_cprotect && par.needsCProtection(runparams.moving_arg)) {
if (contains(runparams.active_chars, '^'))
// cprotect relies on ^ being on catcode 7
os << "\\begingroup\\catcode`\\^=7";
// the code is different (JMarc)
if (style.isCommand()) {
os << "}";
- if (par.needsCProtection(runparams.moving_arg)
+ if (!runparams.no_cprotect && par.needsCProtection(runparams.moving_arg)
&& contains(runparams.active_chars, '^'))
os << "\\endgroup";
if (merged_par)
os << runparams.post_macro;
runparams.post_macro.clear();
}
- if (par.needsCProtection(runparams.moving_arg)
+ if (!runparams.no_cprotect && par.needsCProtection(runparams.moving_arg)
&& contains(runparams.active_chars, '^'))
os << "\\endgroup";
if (runparams.encoding != prev_encoding) {
os << runparams.post_macro;
runparams.post_macro.clear();
}
- if (par.needsCProtection(runparams.moving_arg)
+ if (!runparams.no_cprotect && par.needsCProtection(runparams.moving_arg)
&& contains(runparams.active_chars, '^'))
os << "\\endgroup";
if (runparams.encoding != prev_encoding) {