char *prefixextra;
int nesting, nestindent;
int indentb, indenta;
+ int done_copyright;
IGNORE(keywords); /* we don't happen to need this */
IGNORE(idx); /* or this */
text_heading(fp, NULL, NULL, p->words,
conf.atitle, conf.indent, conf.width);
- /* Do the preamble and copyright */
- for (p = sourceform; p; p = p->next)
- if (p->type == para_Preamble)
- text_para(fp, NULL, NULL, p->words,
- conf.indent_preambles ? conf.indent : 0, 0,
- conf.width + (conf.indent_preambles ? 0 : conf.indent));
- for (p = sourceform; p; p = p->next)
- if (p->type == para_Copyright)
- text_para(fp, NULL, NULL, p->words,
- conf.indent_preambles ? conf.indent : 0, 0,
- conf.width + (conf.indent_preambles ? 0 : conf.indent));
-
nestindent = conf.listindentbefore + conf.listindentafter;
- nesting = 0;
+ nesting = (conf.indent_preambles ? 0 : -conf.indent);
+ done_copyright = FALSE;
/* Do the main document */
for (p = sourceform; p; p = p->next) switch (p->type) {
+ case para_QuotePush:
+ nesting += 2;
+ break;
+ case para_QuotePop:
+ nesting -= 2;
+ assert(nesting >= 0);
+ break;
+
case para_LcontPush:
- nesting++;
+ nesting += nestindent;
break;
case para_LcontPop:
- assert(nesting > 0);
- nesting--;
+ nesting -= nestindent;
+ assert(nesting >= 0);
break;
/*
case para_Biblio: /* only touch BiblioCited */
case para_VersionID:
case para_Copyright:
- case para_Preamble:
case para_NoCite:
case para_Title:
break;
case para_Chapter:
case para_Appendix:
case para_UnnumberedChapter:
+ /*
+ * The copyright should come after the preamble but before
+ * the first chapter title.
+ */
+ if (!done_copyright) {
+ paragraph *p;
+
+ for (p = sourceform; p; p = p->next)
+ if (p->type == para_Copyright)
+ text_para(fp, NULL, NULL, p->words,
+ conf.indent + nesting, 0, conf.width - nesting);
+ done_copyright = TRUE;
+ }
text_heading(fp, p->kwtext, p->kwtext2, p->words,
conf.achapter, conf.indent, conf.width);
+ nesting = 0;
break;
case para_Heading:
break;
case para_Rule:
- text_rule(fp, conf.indent + nestindent*nesting,
- conf.width - nestindent*nesting);
+ text_rule(fp, conf.indent + nesting, conf.width - nesting);
break;
case para_Normal:
body = p->words;
}
text_para(fp, prefix, prefixextra, body,
- conf.indent + nestindent*nesting + indentb, indenta,
- conf.width - nestindent*nesting - indentb - indenta);
+ conf.indent + nesting + indentb, indenta,
+ conf.width - nesting - indentb - indenta);
if (wp) {
wp->next = NULL;
free_word_list(body);
case para_Code:
text_codepara(fp, p->words,
- conf.indent + nestindent*nesting + conf.indent_code,
- conf.width - nestindent*nesting - 2 * conf.indent_code);
+ conf.indent + nesting + conf.indent_code,
+ conf.width - nesting - 2 * conf.indent_code);
break;
}