OutputParams rp = runparams_in;
rp.moving_arg = true;
+ rp.inFloat = OutputParams::SUBFLOAT;
os << getCaption(rp);
os << '{';
// The main argument is the contents of the float. This is not a moving argument.
rp.moving_arg = false;
- rp.inFloat = OutputParams::SUBFLOAT;
InsetText::latex(os, rp);
os << "}";
if (runparams_in.postpone_fragile_stuff)
runparams_in.post_macro += command;
else {
- if (runparams.moving_arg)
+ // protect label in moving argument (#9404),
+ // but not in subfloat caption (#11950)
+ if (runparams.moving_arg
+ && runparams.inFloat != OutputParams::SUBFLOAT)
os << "\\protect";
os << command;
}