+ if (p->type == para_Bullet ||
+ p->type == para_NumberedList ||
+ p->type == para_Description) {
+ extra_indent = firstline_indent = indent_list;
+ } else {
+ extra_indent = firstline_indent = 0;
+ }
+
+ /*
+ * Find the auxiliary text for this paragraph.
+ */
+ aux = aux2 = NULL;
+ aux_indent = 0;
+
+ switch (p->type) {
+ case para_Chapter:
+ case para_Appendix:
+ case para_Heading:
+ case para_Subsect:
+ /*
+ * For some heading styles (FIXME: be able to
+ * configure which), the auxiliary text contains
+ * the chapter number and is arranged to be
+ * right-aligned a few points left of the primary
+ * margin. For other styles, the auxiliary text is
+ * the full chapter _name_ and takes up space
+ * within the (wrapped) chapter title, meaning that
+ * we must move the first line indent over to make
+ * space for it.
+ */
+ if (p->type == para_Heading || p->type == para_Subsect) {
+ int len;
+
+ aux = p->kwtext2;
+ len = paper_width_simple(pdata, p->kwtext2);
+ aux_indent = -len - sect_num_left_space;
+ } else {
+ aux = p->kwtext;
+ aux2 = mknew(word);
+ aux2->next = NULL;
+ aux2->alt = NULL;
+ aux2->type = word_Normal;
+ aux2->text = ustrdup(L": ");
+ aux2->breaks = FALSE;
+ aux2->aux = 0;
+ aux_indent = 0;
+
+ firstline_indent += paper_width_simple(pdata, aux);
+ firstline_indent += paper_width_simple(pdata, aux2);
+ }
+ break;
+
+ case para_Bullet:
+ /*
+ * Auxiliary text consisting of a bullet. (FIXME:
+ * configurable bullet.)
+ */
+ aux = mknew(word);
+ aux->next = NULL;
+ aux->alt = NULL;
+ aux->type = word_Normal;
+ aux->text = ustrdup(L"\x2022");
+ aux->breaks = FALSE;
+ aux->aux = 0;
+ aux_indent = indent + indent_list_bullet;
+ break;
+
+ case para_NumberedList:
+ /*
+ * Auxiliary text consisting of the number followed
+ * by a (FIXME: configurable) full stop.
+ */
+ aux = p->kwtext;
+ aux2 = mknew(word);
+ aux2->next = NULL;
+ aux2->alt = NULL;
+ aux2->type = word_Normal;
+ aux2->text = ustrdup(L".");
+ aux2->breaks = FALSE;
+ aux2->aux = 0;
+ aux_indent = indent + indent_list_bullet;
+ break;
+
+ case para_BiblioCited:
+ /*
+ * Auxiliary text consisting of the bibliography
+ * reference text, and a trailing space.
+ */
+ aux = p->kwtext;
+ aux2 = mknew(word);
+ aux2->next = NULL;
+ aux2->alt = NULL;
+ aux2->type = word_Normal;
+ aux2->text = ustrdup(L" ");
+ aux2->breaks = FALSE;
+ aux2->aux = 0;
+ aux_indent = indent;
+ firstline_indent += paper_width_simple(pdata, aux);
+ firstline_indent += paper_width_simple(pdata, aux2);
+ break;
+ }