diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-03-25 19:16:28 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-03-25 19:16:28 +0000 |
| commit | 10f4d6055c80f45b538cfc6657994b31e4abf525 (patch) | |
| tree | 250c50a337c5ccd18f6bc0d516c123086d479f73 /bk_text.c | |
| parent | 187d4791fd0873b4058b381aa3d3a591b846463e (diff) | |
| download | halibut-10f4d6055c80f45b538cfc6657994b31e4abf525.zip halibut-10f4d6055c80f45b538cfc6657994b31e4abf525.tar.gz halibut-10f4d6055c80f45b538cfc6657994b31e4abf525.tar.bz2 halibut-10f4d6055c80f45b538cfc6657994b31e4abf525.tar.xz | |
Obsoleted the `\preamble' command. Preamble text is now taken to be
any ordinary displayable paragraph(s) appearing before the first
chapter heading, meaning in particular that you can put lists, code
paragraphs etc in preambles. Of course, `\preamble' is still
supported for backwards compatibility, but it's now a zero-effect
paragraph marker.
[originally from svn r3981]
Diffstat (limited to 'bk_text.c')
| -rw-r--r-- | bk_text.c | 31 |
1 files changed, 17 insertions, 14 deletions
@@ -184,6 +184,7 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, char *prefixextra; int nesting, nestindent; int indentb, indenta; + int done_copyright; IGNORE(keywords); /* we don't happen to need this */ IGNORE(idx); /* or this */ @@ -208,20 +209,9 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, 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) { @@ -251,7 +241,6 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, case para_Biblio: /* only touch BiblioCited */ case para_VersionID: case para_Copyright: - case para_Preamble: case para_NoCite: case para_Title: break; @@ -262,8 +251,22 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, 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: |