-#ifndef NO_PEXTRA
- if (params.pextraType() == PEXTRA_INDENT) {
- if (!params.pextraWidth().empty()) {
- os << "\\begin{LyXParagraphIndent}{"
- << params.pextraWidth() << "}\n";
- } else {
- //float ib = atof(pextra_widthp.c_str())/100;
- // string can't handle floats at present (971109)
- // so I'll do a conversion by hand knowing that
- // the limits are 0.0 to 1.0. ARRae.
- os << "\\begin{LyXParagraphIndent}{";
- switch (params.pextraWidthp().length()) {
- case 3:
- os << "1.00";
- break;
- case 2:
- os << "0."
- << params.pextraWidthp();
- break;
- case 1:
- os << "0.0"
- << params.pextraWidthp();
- }
- os << "\\columnwidth}\n";
- }
- texrow.newline();
- eindent_open = true;
- }
- if ((params.pextraType() == PEXTRA_MINIPAGE) && !minipage_open) {
- if (params.pextraHfill() && previous() &&
- (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 (params.pextraAlignment()) {
- case MINIPAGE_ALIGN_TOP:
- os << "[t]";
- break;
- case MINIPAGE_ALIGN_MIDDLE:
- os << "[m]";
- break;
- case MINIPAGE_ALIGN_BOTTOM:
- os << "[b]";
- break;
- }
- if (!params.pextraWidth().empty()) {
- os << '{' << params.pextraWidth() << "}\n";
- } else {
- //float ib = atof(par->pextra_width.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 (params.pextraWidthp().length()) {
- case 3:
- os << "1.00";
- break;
- case 2:
- os << "0."
- << params.pextraWidthp();
- break;
- case 1:
- os << "0.0"
- << 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 = params.depth();
- }
-#endif
-#ifdef WITH_WARNINGS
-#warning Define FANCY_FOOTNOTE_CODE to re-enable Allan footnote code
- //I disabled it because it breaks when lists span on several
- //pages (JMarc)
-#endif
- if (style.isEnvironment()){
- if (style.latextype == LATEX_LIST_ENVIRONMENT) {
-#ifdef FANCY_FOOTNOTE_CODE
- if (foot_count < 0) {
- // flag that footnote[mark][text] should be
- // used for any footnotes from now on
- foot_count = 0;
- foot_this_level = true;
- }
-#endif
- os << "\\begin{" << style.latexname() << "}{"
- << params.labelWidthString() << "}\n";
- } else if (style.labeltype == LABEL_BIBLIO) {
- // ale970405
- os << "\\begin{" << style.latexname() << "}{"
- << bibitemWidest(buf)
- << "}\n";
- } else if (style.latextype == LATEX_ITEM_ENVIRONMENT) {
-#ifdef FANCY_FOOTNOTE_CODE
- if (foot_count < 0) {
- // flag that footnote[mark][text] should be
- // used for any footnotes from now on
- foot_count = 0;
- foot_this_level = true;
- }
-#endif
- os << "\\begin{" << style.latexname() << '}'
- << style.latexparam() << '\n';
- } else
- os << "\\begin{" << style.latexname() << '}'
- << style.latexparam() << '\n';
- texrow.newline();
- }
- LyXParagraph * par = this;
- do {
- par = par->TeXOnePar(buf, bparams,
- os, texrow, false
-#ifndef NEW_INSETS
- ,
- foot, foot_texrow, foot_count
-#endif
- );
-#ifndef NO_PEXTRA
- 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;
- }
-#endif
- 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
- );
- }
-#ifndef NO_PEXTRA
- 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();
- }
-#endif
- } while (par
- && par->layout == layout
- && par->params.depth() == params.depth()
-#ifndef NO_PEXTRA
- && par->params.pextraType() == params.pextraType()
-#endif
-#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;
- }