- if (minipage_open && par && !style.isEnvironment() &&
- (par->params.pextraType() == PEXTRA_MINIPAGE) &&
- par->params.pextraStartMinipage()) {
- os << "\\end{minipage}\n";
- texrow.newline();
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "}\n";
- texrow.newline();
- }
- minipage_open = false;
- }
- if (par && par->params.depth() > params.depth()) {
- if (textclasslist.Style(bparams.textclass,
- par->layout).isParagraph()
- // Thinko!
- // How to handle this? (Lgb)
- //&& !suffixIs(os, "\n\n")
- ) {
- // There should be at least one '\n' already
- // but we need there to be two for Standard
- // paragraphs that are depth-increment'ed to be
- // output correctly. However, tables can
- // also be paragraphs so don't adjust them.
- // ARRae
- // Thinkee:
- // Will it ever harm to have one '\n' too
- // many? i.e. that we sometimes will have
- // three in a row. (Lgb)
- os << '\n';
- texrow.newline();
- }
- par = par->TeXDeeper(buf, bparams, os, texrow
-#ifndef NEW_INSETS
- ,foot, foot_texrow, foot_count
-#endif
- );
- }
- if (par && par->layout == layout && par->params.depth() == params.depth() &&
- (par->params.pextraType() == PEXTRA_MINIPAGE) && !minipage_open) {
- if (par->params.pextraHfill() && par->previous() &&
- (par->previous()->params.pextraType() == PEXTRA_MINIPAGE)){
- os << "\\hfill{}\n";
- texrow.newline();
- }
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "{\\setlength\\parindent{0pt}\n";
- texrow.newline();
- }
- os << "\\begin{minipage}";
- switch (par->params.pextraAlignment()) {
- case MINIPAGE_ALIGN_TOP:
- os << "[t]";
- break;
- case MINIPAGE_ALIGN_MIDDLE:
- os << "[m]";
- break;
- case MINIPAGE_ALIGN_BOTTOM:
- os << "[b]";
- break;
- }
- if (!par->params.pextraWidth().empty()) {
- os << '{' << par->params.pextraWidth() << "}\n";
- } else {
- //float ib = atof(par->pextra_widthp.c_str())/100;
- // string can't handle floats at present
- // so I'll do a conversion by hand knowing that
- // the limits are 0.0 to 1.0. ARRae.
- os << '{';
- switch (par->params.pextraWidthp().length()) {
- case 3:
- os << "1.00";
- break;
- case 2:
- os << "0." << par->params.pextraWidthp();
- break;
- case 1:
- os << "0.0" << par->params.pextraWidthp();
- }
- os << "\\columnwidth}\n";
- }
- texrow.newline();
- if (par_sep == BufferParams::PARSEP_INDENT) {
- os << "\\setlength\\parindent{\\LyXMinipageIndent}\n";
- texrow.newline();
- }
- minipage_open = true;
- minipage_open_depth = par->params.depth();
- }
- } while (par
- && par->layout == layout
- && par->params.depth() == params.depth()
- && par->params.pextraType() == params.pextraType()
-#ifndef NEW_INSETS
- && par->footnoteflag == footnoteflag
-#endif
- );
-
- if (style.isEnvironment()) {
- os << "\\end{" << style.latexname() << '}';
-#ifndef NEW_INSETS
- // maybe this should go after the minipage closes?
- if (foot_this_level) {
- if (foot_count >= 1) {
- if (foot_count > 1) {
- os << "\\addtocounter{footnote}{-"
- << foot_count - 1
- << '}';
- }
- os << foot;
- texrow += foot_texrow;
- foot.clear();
- foot_texrow.reset();
- foot_count = 0;
- }