CVS difference for arm/progs/arm_html.adb

Differences between 1.40 and version 1.41
Log of other versions for file arm/progs/arm_html.adb

--- arm/progs/arm_html.adb	2007/02/11 07:28:55	1.40
+++ arm/progs/arm_html.adb	2007/02/16 07:27:13	1.41
@@ -158,15 +158,19 @@
     -- 11/10/06 - RLB - Fixed nesting of text formatting *again*. (AARM 13.11
     --			failed WC 3 validation.)
     --  2/ 9/07 - RLB - Changed comments on AI_Reference.
+    --  2/14/07 - RLB - Revised to separate style and indent information
+    --			for paragraphs.
+    --  2/15/07 - RLB - Redid enumeration and bullet indenting to make the
+    --			formats work consistently on Firefox and IE.
 
     LINE_LENGTH : constant := 78;
 	-- Maximum intended line length.
 
-    SWISS_FONT_CODE : constant String := "<FONT FACE=""Arial, Helvetica"">";
+    SWISS_FONT_CODE : constant String := "<font face=""Arial, Helvetica"">";
 
-    SMALL_SWISS_FONT_CODE : constant String := "<FONT FACE=""Arial, Helvetica"" SIZE=-1>";
+    SMALL_SWISS_FONT_CODE : constant String := "<font face=""Arial, Helvetica"" size=-1>";
 
-    TINY_SWISS_FONT_CODE : constant String := "<FONT FACE=""Arial, Helvetica"" SIZE=-2>";
+    TINY_SWISS_FONT_CODE : constant String := "<font face=""Arial, Helvetica"" size=-2>";
 
     LEADING_PERCENT : constant := 70;
 	-- Leading is 70% of normal height.
@@ -186,446 +190,28 @@
     type Tag_Kind is (DIV, UL, DL);
 
     type Format_Info_Type is record
-	Tag  : Tag_Kind;
-	Size : Integer; -- In relative "units" (based on the normal size). A unit is 125%/80% of normal.
-	Font : ARM_Output.Font_Family_Type;
+	Defined: Boolean := False;
+	Tag    : Tag_Kind;
+	Size   : Integer; -- In relative "units" (based on the normal size). A unit is 125%/80% of normal.
+	Font   : ARM_Output.Font_Family_Type;
 	Indent : Natural; -- In "units". (A unit is = 2EM of the full sized font).
 	Right_Indent : Natural; -- In "units". (A unit is = 2EM of the full sized font).
 	Hang_Outdent : Natural; -- In "units". (A unit is = 2EM of the full sized font).
 		-- This is the amount that the hanging text hangs out. Normal
 		-- text starts at Hang_Outdent + Indent "units".
 	Before : Integer; -- Vertical space before in 0.1 EM.
-	After : Natural; -- Vertical space after in 0.1 EM.
+	After  : Natural; -- Vertical space after in 0.1 EM.
     end record;
 
     -- In the following, "Default" means the Body_Font.
-    Paragraph_Info : constant array (ARM_Output.Paragraph_Type) of
-	Format_Info_Type := (
-	    ARM_Output.Normal =>
-		(Tag  => DIV,
-		 Size => 0, -- 18
-		 Font => ARM_Output.Default,
-		 Indent => 0,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6), -- 120
-	    ARM_Output.Wide =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 0,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 6,
-		 After => 6),
-	    ARM_Output.Index =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 0,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 0),
-	    ARM_Output.Syntax_Summary =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 4),
-	    ARM_Output.Notes =>
-		(Tag  => DIV,
-		 Size => -1, -- 15
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Notes_Header =>
-		(Tag  => DIV,
-		 Size => -1, -- 15
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 0),
-	    ARM_Output.Annotations =>
-		(Tag  => DIV,
-		 Size => -1, -- 15
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Wide_Annotations =>
-		(Tag  => DIV,
-		 Size => -1, -- 15
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 6,
-		 After => 6),
-	    ARM_Output.Examples =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Fixed,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Examples =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Fixed,
-		 Indent => 3,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Indented_Examples =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Fixed,
-		 Indent => 4,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Indented_Examples =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Fixed,
-		 Indent => 6,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Swiss_Examples =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Swiss,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Swiss_Examples =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Swiss,
-		 Indent => 3,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Swiss_Indented_Examples =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Swiss,
-		 Indent => 4,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Swiss_Indented_Examples =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Swiss,
-		 Indent => 6,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Syntax_Indented =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 4), -- 80
-	    ARM_Output.Small_Syntax_Indented =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Indented =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Indented =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 5,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Inner_Indented =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 4,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Inner_Indented =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 6,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Code_Indented =>
-		(Tag  => DIV,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Code_Indented =>
-		(Tag  => DIV,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 4,
-		 Right_Indent => 0,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Hanging =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 0, -- Total = 3.
-		 Right_Indent => 0,
-		 Hang_Outdent => 3,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Indented_Hanging =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 2, -- Total = 3.
-		 Right_Indent => 0,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Hanging =>
-		(Tag  => DL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 2, -- Total = 5.
-		 Right_Indent => 0,
-		 Hang_Outdent => 3,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Small_Indented_Hanging =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 4, -- Total = 5.
-		 Right_Indent => 0,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 6),
-	    ARM_Output.Hanging_in_Bulleted =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 1, -- Total = 3.
-		 Right_Indent => 1,
-		 Hang_Outdent => 2,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Hanging_in_Bulleted =>
-		(Tag  => DL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 3, -- Total = 5.
-		 Right_Indent => 1,
-		 Hang_Outdent => 2,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Nested_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Nested_X2_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Bulleted =>
-		(Tag  => UL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Nested_Bulleted =>
-		(Tag  => UL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 4,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Nested_X2_Bulleted =>
-		(Tag  => UL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 5,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Indented_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 4,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Indented_Nested_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 5,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Syntax_Indented_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Code_Indented_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Code_Indented_Nested_Bulleted =>
-		(Tag  => UL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 4,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Notes_Bulleted =>
-		(Tag  => UL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Notes_Nested_Bulleted =>
-		(Tag  => UL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 1,
-		 Hang_Outdent => 0,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Enumerated =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 0,
-		 Right_Indent => 1,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Enumerated =>
-		(Tag  => DL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 2,
-		 Right_Indent => 1,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Nested_Enumerated =>
-		(Tag  => DL,
-		 Size => 0,
-		 Font => ARM_Output.Default,
-		 Indent => 1,
-		 Right_Indent => 1,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 5),
-	    ARM_Output.Small_Nested_Enumerated =>
-		(Tag  => DL,
-		 Size => -1,
-		 Font => ARM_Output.Default,
-		 Indent => 3,
-		 Right_Indent => 1,
-		 Hang_Outdent => 1,
-		 Before => 0,
-		 After => 5));
+    Paragraph_Info : array
+	(ARM_Output.Paragraph_Style_Type, ARM_Output.Paragraph_Indent_Type) of
+	   Format_Info_Type;
+	-- Defined below in the body of the package.
+
     -- Are the various styles used??
-    Paragraph_Used : array (ARM_Output.Paragraph_Type) of Boolean;
+    Paragraph_Used : array (ARM_Output.Paragraph_Style_Type,
+			    ARM_Output.Paragraph_Indent_Type) of Boolean;
     Revision_Used : array (ARM_Contents.Change_Version_Type) of Boolean;
     Paranum_Used : Boolean;
 
@@ -714,9 +300,9 @@
     begin
         if Output_Object.Use_Buttons then
 	    if Is_Top and then Output_Object.HTML_Kind > HTML_3 then
-	        Ada.Text_IO.Put (Output_Object.Output_File, "<DIV Style=""margin-top: 0.6em; margin-bottom: 0.0em"">");
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<div style=""margin-top: 0.6em; margin-bottom: 0.0em"">");
 	    elsif (not Is_Top) and then Output_Object.HTML_Kind > HTML_3 then
-	        Ada.Text_IO.Put (Output_Object.Output_File, "<DIV Style=""margin-top: 0.0em; margin-bottom: 0.6em"">");
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<div style=""margin-top: 0.0em; margin-bottom: 0.6em"">");
 	    else
 	        Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
 	    end if;
@@ -809,7 +395,7 @@
 	        end;
 	    end if;
 	    if Output_Object.HTML_Kind > HTML_3 then
-	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</DIV>");
+	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</div>");
 	    else
 	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</P>");
 	    end if;
@@ -910,11 +496,18 @@
     end Make_Navigation_Bar;
 
 
+    type Special_Style_Kinds is (None,
+				 Hanging_Term,
+				 Hanging_Body,
+				 Bulleted_Item,
+				 Bulleted_No_Prefix);
+
     procedure Make_Style (Output_Object : in out HTML_Output_Type;
 			  Name : in String;
-			  Format : in ARM_Output.Paragraph_Type;
-			  Special_Hanging_Term : in Boolean := False;
-			  Special_Hanging_Body : in Boolean := False) is
+			  Style : in ARM_Output.Paragraph_Style_Type;
+			  Indent : in ARM_Output.Paragraph_Indent_Type;
+			  Kind : Special_Style_Kinds := None;
+			  Enumerated_Adjustment : in Boolean := False) is
 	-- Internal routine.
         -- Generate the style needed.
 
@@ -923,7 +516,7 @@
 	    Normal : Boolean;
         begin
 	    if Output_Object.HTML_Kind = HTML_4_Only then
-	        case Paragraph_Info(Format).Font is
+	        case Paragraph_Info(Style, Indent).Font is
 		    when ARM_Output.Default =>
 			Normal := ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Roman);
 		    when ARM_Output.Roman =>
@@ -932,7 +525,7 @@
 			Normal := False;
 		end case;
 		if Normal then
-		    case Paragraph_Info(Format).Size is
+		    case Paragraph_Info(Style, Indent).Size is
 		        when 0 => return Value * 20;
 		        when 1 => return Value * 16; -- 20/1.25.
 		        when 2 => return Value * 13; -- 20/1.56.
@@ -942,7 +535,7 @@
 		        when others => return Value; -- Out of range.
 		    end case;
 		else -- Start at 90% (otherwise they are huge!)
-		    case Paragraph_Info(Format).Size is
+		    case Paragraph_Info(Style, Indent).Size is
 		        when 0 => return Value * 22; -- 20/0.90
 		        when 1 => return Value * 18; -- 20/1.13.
 		        when 2 => return Value * 14; -- 20/1.40.
@@ -952,9 +545,9 @@
 		        when others => return Value; -- Out of range.
 		    end case;
 	        end if;
-	    elsif ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed) then
+	    elsif ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed) then
 	        -- Special case, see below.
-	        case Paragraph_Info(Format).Size is
+	        case Paragraph_Info(Style, Indent).Size is
 		    when 0 => return Value * 20;
 		    when 1 => return Value * 16; -- 20/1.25.
 		    when 2 => return Value * 13; -- 20/1.56.
@@ -969,10 +562,10 @@
         end Units_to_EMs;
 
     begin
-	if not Paragraph_Used (Format) then
+	if not Paragraph_Used (Style, Indent) then
 	    return; -- Not used, so don't generate.
 	end if;
-	if Special_Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
+	if Kind = Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
 	    -- Special case for better hanging.
             Ada.Text_IO.Put (Output_Object.Output_File, "    DIV.");
             Ada.Text_IO.Put (Output_Object.Output_File, Name & "-Term {");
@@ -987,11 +580,15 @@
 		    -- This does not work on Firefox: the text is too high by
 		    -- about half a line and thus doesn't line up properly.
 	    end if;
-	elsif Special_Hanging_Body and then Output_Object.HTML_Kind = HTML_4_Only then
+	elsif Kind = Hanging_Body and then Output_Object.HTML_Kind = HTML_4_Only then
             Ada.Text_IO.Put (Output_Object.Output_File, "    DIV.");
             Ada.Text_IO.Put (Output_Object.Output_File, Name & "-Body {");
+	elsif (Kind = Bulleted_Item or else Kind = Bulleted_No_Prefix) and then
+		   Output_Object.HTML_Kind = HTML_4_Only then
+            Ada.Text_IO.Put (Output_Object.Output_File, "    DIV.");
+            Ada.Text_IO.Put (Output_Object.Output_File, Name & " {");
 	else
-            case Paragraph_Info(Format).Tag is
+            case Paragraph_Info(Style, Indent).Tag is
 	        when DIV =>
 	            Ada.Text_IO.Put (Output_Object.Output_File, "    DIV.");
 	        when UL =>
@@ -1001,7 +598,7 @@
             end case;
             Ada.Text_IO.Put (Output_Object.Output_File, Name & " {");
 	end if;
-        case Paragraph_Info(Format).Font is
+        case Paragraph_Info(Style, Indent).Font is
 	    when ARM_Output.Default =>
 		if ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Roman) then
 		    Ada.Text_IO.Put (Output_Object.Output_File, "font-family: ""Times New Roman"", Times, serif");
@@ -1013,48 +610,47 @@
 	    when ARM_Output.Fixed => Ada.Text_IO.Put (Output_Object.Output_File, "font-family: ""Courier New"", monospace");
         end case;
         if Output_Object.HTML_Kind = HTML_4_Only then
+	    -- The font size is set by the outer item.
 	    declare
 	        Normal : Boolean;
             begin
-	        if Output_Object.HTML_Kind = HTML_4_Only then
-	            case Paragraph_Info(Format).Font is
-		        when ARM_Output.Default =>
-			    Normal := ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Roman);
-		        when ARM_Output.Roman =>
-			    Normal := True;
-		        when ARM_Output.Fixed | ARM_Output.Swiss => -- Start at 90% (otherwise they are huge!)
-			    Normal := False;
+	        case Paragraph_Info(Style, Indent).Font is
+		    when ARM_Output.Default =>
+		        Normal := ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Roman);
+		    when ARM_Output.Roman =>
+		        Normal := True;
+		    when ARM_Output.Fixed | ARM_Output.Swiss => -- Start at 90% (otherwise they are huge!)
+		        Normal := False;
+	        end case;
+	        if Normal then
+		    case Paragraph_Info(Style, Indent).Size is
+		        when 0 => null; -- Default.
+		        when 1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 125%");
+		        when 2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 156%");
+		        when -1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 80%");
+		        when -2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 64%");
+		        when -3 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 50%");
+		        when others => null; -- Out of range.
 		    end case;
-		    if Normal then
-		        case Paragraph_Info(Format).Size is
-		            when 0 => null; -- Default.
-		            when 1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 125%");
-		            when 2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 156%");
-		            when -1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 80%");
-		            when -2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 64%");
-		            when -3 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 50%");
-		            when others => null; -- Out of range.
-		        end case;
-		    else -- Start at 90% (otherwise they are huge!)
-		        -- Note: This size adjustment is for sections of text, not for in-line text.
-		        case Paragraph_Info(Format).Size is
-		            when 0 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 90%");
-		            when 1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 113%");
-		            when 2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 140%");
-		            when -1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 72%");
-		            when -2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 58%");
-		            when -3 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 45%");
-		            when others => null; -- Out of range.
-		        end case;
-	            end if;
-		end if;
-	    end;
+	        else -- Start at 90% (otherwise they are huge!)
+		    -- Note: This size adjustment is for sections of text, not for in-line text.
+		    case Paragraph_Info(Style, Indent).Size is
+		        when 0 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 90%");
+		        when 1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 113%");
+		        when 2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 140%");
+		        when -1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 72%");
+		        when -2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 58%");
+		        when -3 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 45%");
+		        when others => null; -- Out of range.
+		    end case;
+	        end if;
+            end;
 	    -- Set the leading, because otherwise the lines are too close on IE.
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; line-height: 122%");
-        elsif ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed) then
+        elsif ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed) then
 	    -- Special case because the font otherwise gets too small and
 	    -- loses bold-facing.
-	    case Paragraph_Info(Format).Size is
+	    case Paragraph_Info(Style, Indent).Size is
 	        when 0 => null; -- Default.
 	        when 1 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 125%");
 	        when 2 => Ada.Text_IO.Put (Output_Object.Output_File, "; font-size: 156%");
@@ -1065,56 +661,76 @@
 	    end case;
         -- else the size will be set explicitly for HTML_4_Compatible.
         end if;
-	if Special_Hanging_Body then
+	if Kind = Hanging_Body then
 	    if Output_Object.Number_Paragraphs then
 	        Ada.Text_IO.Put (Output_Object.Output_File, "; margin-left: ");
 	        Put_Ems (Output_Object.Output_File,
-			 Units_to_EMs(Paragraph_Info(Format).Indent +
-				      Paragraph_Info(Format).Hang_Outdent) +
+			 Units_to_EMs(Paragraph_Info(Style, Indent).Indent +
+				      Paragraph_Info(Style, Indent).Hang_Outdent) +
 			 INDENT_EMS_FOR_PARANUMS);
 	    else
-                if Paragraph_Info(Format).Indent + Paragraph_Info(Format).Hang_Outdent /= 0 then
+                if Paragraph_Info(Style, Indent).Indent + Paragraph_Info(Style, Indent).Hang_Outdent /= 0 then
 	            Ada.Text_IO.Put (Output_Object.Output_File, "; margin-left: ");
 	            Put_Ems (Output_Object.Output_File,
-			     Units_to_EMs(Paragraph_Info(Format).Indent +
-				          Paragraph_Info(Format).Hang_Outdent));
+			     Units_to_EMs(Paragraph_Info(Style, Indent).Indent +
+				          Paragraph_Info(Style, Indent).Hang_Outdent));
                 end if;
 	    end if;
+	elsif Enumerated_Adjustment then
+	    -- Adjust the left margin to indent the prefix slightly (1/4 of a unit):
+	    declare
+		Org_Margin : Natural :=
+		    Units_to_EMs(Paragraph_Info(Style, Indent).Indent);
+		Prefix_Indent : Natural :=
+		   Units_to_EMs(1) / 4;
+	    begin
+	        Ada.Text_IO.Put (Output_Object.Output_File, "; margin-left: ");
+	        if Output_Object.Number_Paragraphs then
+	            Put_Ems (Output_Object.Output_File, Org_Margin + Prefix_Indent +
+			     INDENT_EMS_FOR_PARANUMS);
+	        else
+	            Put_Ems (Output_Object.Output_File, Org_Margin + Prefix_Indent);
+	        end if;
+	    end;
 	else
 	    if Output_Object.Number_Paragraphs then
 	        Ada.Text_IO.Put (Output_Object.Output_File, "; margin-left: ");
-	        Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Format).Indent) +
+	        Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Style, Indent).Indent) +
 			 INDENT_EMS_FOR_PARANUMS);
 	    else
-                if Paragraph_Info(Format).Indent /= 0 then
+                if Paragraph_Info(Style, Indent).Indent /= 0 then
 	            Ada.Text_IO.Put (Output_Object.Output_File, "; margin-left: ");
-	            Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Format).Indent));
+	            Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Style, Indent).Indent));
                 end if;
 	    end if;
 	end if;
-	if Special_Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
+	if Kind = Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
 	    -- We let the body provide the necessary right margin. If we don't
 	    -- do this, the following item can end up with an inappropriate indent.
 	    null;
 	    --Ada.Text_IO.Put (Output_Object.Output_File, "; margin-bottom: 0em");
-        elsif Paragraph_Info(Format).Right_Indent /= 0 then
+        elsif Paragraph_Info(Style, Indent).Right_Indent /= 0 then
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; margin-right: ");
-	    Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Format).Right_Indent));
+	    Put_Ems (Output_Object.Output_File, Units_to_EMs(Paragraph_Info(Style, Indent).Right_Indent));
         end if;
-        if Paragraph_Info(Format).Before /= 0 then
+        if Paragraph_Info(Style, Indent).Before /= 0 then
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; margin-top: ");
-	    Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Before);
-        elsif Paragraph_Info(Format).Tag /= DIV then
+	    Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Before);
+        elsif Paragraph_Info(Style, Indent).Tag /= DIV then
 	    -- The default is non-zero.
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; margin-top: 0em");
         end if;
-	if Special_Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
+	if Kind = Hanging_Term and then Output_Object.HTML_Kind = HTML_4_Only then
 	    -- We let the body provide the necessary space below. If we don't
 	    -- do this, the next line can end up with an inappropriate indent.
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; margin-bottom: 0em");
-	elsif Paragraph_Info(Format).After /= 0 then
+	elsif Paragraph_Info(Style, Indent).After /= 0 then
 	    Ada.Text_IO.Put (Output_Object.Output_File, "; margin-bottom: ");
-	    Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).After);
+	    Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).After);
+        end if;
+	if Kind = Bulleted_Item and then Output_Object.HTML_Kind = HTML_4_Only then
+	    -- Set the list item and "disc" format:
+	    Ada.Text_IO.Put (Output_Object.Output_File, "; display: list-item; list-style-type: disc");
         end if;
         -- Done, close it.
         Ada.Text_IO.Put_Line (Output_Object.Output_File, "}");
@@ -1123,24 +739,32 @@
 
     procedure Make_Hung_Text_Style
 		     (Output_Object : in out HTML_Output_Type;
-		      Name : in String;
-		      Format : in ARM_Output.Paragraph_Type) is
+		      Name   : in String;
+		      Style  : in ARM_Output.Paragraph_Style_Type;
+		      Indent : in ARM_Output.Paragraph_Indent_Type) is
 	-- Internal routine.
         -- Generate the style needed.
     begin
 	if Output_Object.HTML_Kind = HTML_4_Only then
-	    Make_Style (Output_Object, Name, Format,
-		        Special_Hanging_Term => True);
+	    if ARM_Output."=" (Style, ARM_Output.Enumerated) or else
+	       ARM_Output."=" (Style, ARM_Output.Small_Enumerated) then
+		Make_Style (Output_Object, Name, Style, Indent,
+		            Kind => Hanging_Term,
+			    Enumerated_Adjustment => True);
+	    else
+		Make_Style (Output_Object, Name, Style, Indent,
+		            Kind => Hanging_Term);
+	    end if;
 	else -- HTML_4_Compatible
             Ada.Text_IO.Put (Output_Object.Output_File, "    DD." & Name & " {");
             Ada.Text_IO.Put (Output_Object.Output_File, "margin-left: ");
-            case Paragraph_Info(Format).Size is
-	        when 0 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 20);
-	        when 1 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 16); -- 20/1.25.
-	        when 2 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 13); -- 20/1.56.
-	        when -1 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 25); -- 20/0.80.
-	        when -2 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 31); -- 20/0.64.
-	        when -3 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Format).Hang_Outdent * 40); -- 20/0.50.
+            case Paragraph_Info(Style, Indent).Size is
+	        when 0 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 20);
+	        when 1 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 16); -- 20/1.25.
+	        when 2 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 13); -- 20/1.56.
+	        when -1 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 25); -- 20/0.80.
+	        when -2 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 31); -- 20/0.64.
+	        when -3 => Put_Ems (Output_Object.Output_File, Paragraph_Info(Style, Indent).Hang_Outdent * 40); -- 20/0.50.
 	        when others => null; -- Out of range.
             end case;
             -- Done, close it.
@@ -1149,6 +773,176 @@
     end Make_Hung_Text_Style;
 
 
+    function Paragraph_Name
+		     (Style  : in ARM_Output.Paragraph_Style_Type;
+		      Indent : in ARM_Output.Paragraph_Indent_Type) return String is
+	-- Internal routine.
+	-- Create the name for the Style and Indent.
+	-- These had better be unique, and all possibilities (including impossible
+	-- ones) had better have names.
+	use type ARM_Output.Paragraph_Indent_Type;
+    begin
+	case Style is
+	    when ARM_Output.Normal =>
+                if Indent = 0 then
+		    return "Normal";
+		else
+		    -- This was: Indent 1: "SyntaxIndented"; Indent 2:
+		    -- "CodeIndented"; Indent 3: "Indented"; Indent 4: "InnerIndented".
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent);
+		end if;
+	    when ARM_Output.Wide_Above =>
+                if Indent = 0 then
+		    return "WideAbove";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "WideAbove";
+		end if;
+	    when ARM_Output.Small =>
+                if Indent = 0 then
+		    return "Small";
+                elsif Indent = 1 then
+		    return "Notes";
+                elsif Indent = 2 then
+		    return "Annotations";
+		else
+		    -- This was: Indent 3: "SmallSyntaxIndented"; Indent 4:
+		    -- "SmallCodeIndented"; Indent 5: "SmallIndented"; Indent 6: "SmallInnerIndented".
+		    return "SmallIndented" & Character'Val(Character'Pos('0') + Indent);
+		end if;
+	    when ARM_Output.Small_Wide_Above =>
+                if Indent = 0 then
+		    return "SmallWideAbove";
+                elsif Indent = 2 then
+		    return "AnnotationsWideAbove";
+		else
+		    return "SmallIndented" & Character'Val(Character'Pos('0') + Indent) & "WideAbove";
+		end if;
+	    when ARM_Output.Header =>
+                if Indent = 0 then
+		    return "Header";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "Header";
+		end if;
+	    when ARM_Output.Small_Header =>
+                if Indent = 0 then
+		    return "SmallHeader";
+                elsif Indent = 1 then
+		    return "NotesHeader";
+		else
+		    return "SmallIndented" & Character'Val(Character'Pos('0') + Indent) & "Header";
+		end if;
+	    when ARM_Output.Index =>
+                if Indent = 0 then
+		    return "Index";
+	    	else -- Should be not used.
+		    return "IndexIndented" & Character'Val(Character'Pos('0') + Indent);
+		end if;
+	    when ARM_Output.Syntax_Summary =>
+                if Indent = 1 then
+		    return "SyntaxSummary";
+	    	else -- Should be not used.
+		    return "SynSumInd" & Character'Val(Character'Pos('0') + Indent);
+		end if;
+	    when ARM_Output.Examples =>
+                if Indent = 1 then
+		    return "Examples";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "Examples";
+		end if;
+	    when ARM_Output.Small_Examples =>
+                if Indent = 3 then
+		    return "SmallExamples";
+		else
+		    return "SmallIndented" & Character'Val(Character'Pos('0') + Indent) & "Examples";
+		end if;
+	    when ARM_Output.Swiss_Examples =>
+                if Indent = 1 then
+		    return "SwissExamples";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SwissExamples";
+		end if;
+	    when ARM_Output.Small_Swiss_Examples =>
+                if Indent = 3 then
+		    return "SmallSwissExamples";
+		else
+		    return "SmallIndented" & Character'Val(Character'Pos('0') + Indent) & "SwissExamples";
+		end if;
+	    when ARM_Output.Bulleted =>
+                if Indent = 1 then
+		    return "Bulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "Bulleted";
+		end if;
+	    when ARM_Output.Small_Bulleted =>
+                if Indent = 3 then
+		    return "SmallBulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallBulleted";
+		end if;
+	    when ARM_Output.Nested_Bulleted =>
+                if Indent = 1 then
+		    return "NestedBulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "NestedBulleted";
+		end if;
+	    when ARM_Output.Small_Nested_Bulleted =>
+                if Indent = 3 then
+		    return "SmallNestedBulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallNestedBulleted";
+		end if;
+	    when ARM_Output.Enumerated =>
+                if Indent = 1 then
+		    return "Enumerated";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "Enumerated";
+		end if;
+	    when ARM_Output.Small_Enumerated =>
+                if Indent = 3 then
+		    return "SmallEnumerated";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallEnumerated";
+		end if;
+	    when ARM_Output.Wide_Hanging =>
+                if Indent = 3 then
+		    return "WideHanging";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "WideHanging";
+		end if;
+	    when ARM_Output.Small_Wide_Hanging =>
+                if Indent = 5 then
+		    return "SmallWideHanging";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallWideHanging";
+		end if;
+	    when ARM_Output.Narrow_Hanging =>
+                if Indent = 3 then
+		    return "NarrowHanging";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "NarrowHanging";
+		end if;
+	    when ARM_Output.Small_Narrow_Hanging =>
+                if Indent = 5 then
+		    return "SmallNarrowHanging";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallNarrowHanging";
+		end if;
+	    when ARM_Output.Hanging_in_Bulleted =>
+                if Indent = 3 then
+		    return "Hanging_in_Bulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "Hanging_in_Bulleted";
+		end if;
+	    when ARM_Output.Small_Hanging_in_Bulleted =>
+                if Indent = 5 then
+		    return "SmallHanging_in_Bulleted";
+		else
+		    return "Indented" & Character'Val(Character'Pos('0') + Indent) & "SmallHanging_in_Bulleted";
+		end if;
+	end case;
+    end Paragraph_Name;
+
+
     procedure Make_Paragraph_Styles
 		     (Output_Object : in out HTML_Output_Type) is
 	-- Internal routine.
@@ -1223,98 +1017,40 @@
         --Ada.Text_IO.Put_Line (Output_Object.Output_File, "    A:visited {color: rgb(128,0,128)}");
 
 	-- Paragraph styles:
-        Make_Style (Output_Object, "Normal", ARM_Output.Normal);
-        Make_Style (Output_Object, "Wide", ARM_Output.Wide);
-        Make_Style (Output_Object, "Annotations", ARM_Output.Annotations);
-        Make_Style (Output_Object, "WideAnnotations", ARM_Output.Wide_Annotations);
-        Make_Style (Output_Object, "Index", ARM_Output.Index);
-        Make_Style (Output_Object, "SyntaxSummary", ARM_Output.Syntax_Summary);
-        Make_Style (Output_Object, "Notes", ARM_Output.Notes);
-        Make_Style (Output_Object, "NotesHeader", ARM_Output.Notes_Header);
-        Make_Style (Output_Object, "SyntaxIndented", ARM_Output.Syntax_Indented);
-        Make_Style (Output_Object, "SmallSyntaxIndented", ARM_Output.Small_Syntax_Indented);
-        Make_Style (Output_Object, "Indented", ARM_Output.Indented);
-        Make_Style (Output_Object, "SmallIndented", ARM_Output.Small_Indented);
-        Make_Style (Output_Object, "CodeIndented", ARM_Output.Code_Indented);
-        Make_Style (Output_Object, "SmallCodeIndented", ARM_Output.Small_Code_Indented);
-        Make_Style (Output_Object, "InnerIndented", ARM_Output.Inner_Indented);
-        Make_Style (Output_Object, "SmallInnerIndented", ARM_Output.Small_Inner_Indented);
-        Make_Style (Output_Object, "Examples", ARM_Output.Examples);
-        Make_Style (Output_Object, "SmallExamples", ARM_Output.Small_Examples);
-        Make_Style (Output_Object, "IndentedExamples", ARM_Output.Indented_Examples);
-        Make_Style (Output_Object, "SmallIndentedExamples", ARM_Output.Small_Indented_Examples);
-        Make_Style (Output_Object, "SwissExamples", ARM_Output.Swiss_Examples);
-        Make_Style (Output_Object, "SmallSwissExamples", ARM_Output.Small_Swiss_Examples);
-        Make_Style (Output_Object, "SwissIndentedExamples", ARM_Output.Swiss_Indented_Examples);
-        Make_Style (Output_Object, "SmallSwissIndentedExamples", ARM_Output.Small_Swiss_Indented_Examples);
-
-        Make_Style (Output_Object, "Bulleted", ARM_Output.Bulleted);
-        Make_Style (Output_Object, "SmallBulleted", ARM_Output.Small_Bulleted);
-        Make_Style (Output_Object, "NestedBulleted", ARM_Output.Nested_Bulleted);
-        Make_Style (Output_Object, "SmallNestedBulleted", ARM_Output.Small_Nested_Bulleted);
-        Make_Style (Output_Object, "NestedX2Bulleted", ARM_Output.Nested_X2_Bulleted);
-        Make_Style (Output_Object, "SmallNestedX2Bulleted", ARM_Output.Small_Nested_X2_Bulleted);
-        Make_Style (Output_Object, "IndentedBulleted", ARM_Output.Indented_Bulleted);
-        Make_Style (Output_Object, "IndentedNestedBulleted", ARM_Output.Indented_Nested_Bulleted);
-        Make_Style (Output_Object, "CodeIndentedBulleted", ARM_Output.Code_Indented_Bulleted);
-        Make_Style (Output_Object, "CodeIndentedNestedBulleted", ARM_Output.Code_Indented_Nested_Bulleted);
-        Make_Style (Output_Object, "SyntaxIndentedBulleted", ARM_Output.Syntax_Indented_Bulleted);
-        Make_Style (Output_Object, "NotesBulleted", ARM_Output.Notes_Bulleted);
-        Make_Style (Output_Object, "NotesNestedBulleted", ARM_Output.Notes_Nested_Bulleted);
-
-	if Paragraph_Used (ARM_Output.Hanging) then
-            Make_Style (Output_Object, "Hanging", ARM_Output.Hanging, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "Hanging", ARM_Output.Hanging);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Indented_Hanging) then
-            Make_Style (Output_Object, "IndentedHanging", ARM_Output.Indented_Hanging, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "IndentedHanging", ARM_Output.Indented_Hanging);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Hanging_in_Bulleted) then
-            Make_Style (Output_Object, "HangingInBulleted", ARM_Output.Hanging_in_Bulleted, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "HangingInBulleted", ARM_Output.Hanging_in_Bulleted);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Small_Hanging) then
-            Make_Style (Output_Object, "SmallHanging", ARM_Output.Small_Hanging, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "SmallHanging", ARM_Output.Small_Hanging);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Small_Indented_Hanging) then
-            Make_Style (Output_Object, "SmallIndentedHanging", ARM_Output.Small_Indented_Hanging, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "SmallIndentedHanging", ARM_Output.Small_Indented_Hanging);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Small_Hanging_in_Bulleted) then
-            Make_Style (Output_Object, "SmallHangingInBulleted", ARM_Output.Small_Hanging_in_Bulleted, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "SmallHangingInBulleted", ARM_Output.Small_Hanging_in_Bulleted);
-	-- else not used.
-	end if;
-
-	if Paragraph_Used (ARM_Output.Enumerated) then
-            Make_Style (Output_Object, "Enumerated", ARM_Output.Enumerated, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "Enumerated", ARM_Output.Enumerated);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Small_Enumerated) then
-            Make_Style (Output_Object, "SmallEnumerated", ARM_Output.Small_Enumerated, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "SmallEnumerated", ARM_Output.Small_Enumerated);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Nested_Enumerated) then
-            Make_Style (Output_Object, "NestedEnumerated", ARM_Output.Nested_Enumerated, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "NestedEnumerated", ARM_Output.Nested_Enumerated);
-	-- else not used.
-	end if;
-	if Paragraph_Used (ARM_Output.Small_Nested_Enumerated) then
-            Make_Style (Output_Object, "SmallNestedEnumerated", ARM_Output.Small_Nested_Enumerated, Special_Hanging_Body => True);
-            Make_Hung_Text_Style (Output_Object, "SmallNestedEnumerated", ARM_Output.Small_Nested_Enumerated);
-	-- else not used.
-	end if;
+	for S in ARM_Output.Unprefixed_Style_Subtype loop
+	    for I in ARM_Output.Paragraph_Indent_Type loop
+	        Make_Style (Output_Object, Paragraph_Name (S, I), S, I);
+	    end loop;
+	end loop;
+
+	for S in ARM_Output.Bullet_Prefixed_Style_Subtype loop
+	    -- These styles do not allow Indent 0.
+	    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+		if Output_Object.HTML_Kind = HTML_4_Only then
+		    Make_Style (Output_Object, Paragraph_Name (S, I) & "-NoPrefix", S, I,
+			        Kind => Bulleted_No_Prefix);
+		    Make_Style (Output_Object, Paragraph_Name (S, I), S, I,
+			        Kind => Bulleted_Item);
+		else
+	            Make_Style (Output_Object, Paragraph_Name (S, I), S, I);
+		end if;
+	    end loop;
+	end loop;
+
+	for S in ARM_Output.Text_Prefixed_Style_Subtype loop
+	    -- These styles do not allow Indent 0.
+	    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+		if Paragraph_Used (S, I) then
+	            Make_Style (Output_Object, Paragraph_Name (S, I), S, I, Kind => Hanging_Body);
+	            Make_Hung_Text_Style (Output_Object, Paragraph_Name (S, I), S, I);
+		-- else not used.
+		end if;
+	    end loop;
+	end loop;
+
     end Make_Paragraph_Styles;
 
+
     MAGIC_STYLE_MARKER : constant String := "&%$# STYLES GO HERE #$%&";
 
 
@@ -1363,14 +1099,14 @@
 	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "    SPAN.roman {font-family: ""Times New Roman"", Times, serif}");
 
 	    -- Paragraph styles:
-	    --Paragraph_Used := (others => True); -- Force showing all, we don't know what is used.
+	    --Paragraph_Used := (others => (others => True)); -- Force showing all, we don't know what is used.
 	    --Revision_Used := (others => True);
 	    --Paranum_Used := True;
 	    --Make_Paragraph_Styles (Output_Object);
 	    -- Dummy line to be replaced after the file is created.
 	    Ada.Text_IO.Put_Line (Output_Object.Output_File, MAGIC_STYLE_MARKER);
 
-	    Paragraph_Used := (others => False);
+	    Paragraph_Used := (others => (others => False));
 	    Revision_Used := (others => False);
 	    Paranum_Used := False;
 
@@ -1380,13 +1116,14 @@
 	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "    <STYLE type=""text/css"">");
 
 	    -- Paragraph styles:
-	    --Paragraph_Used := (others => True); -- Force showing all, we don't know what is used.
+	    --Paragraph_Used := (others => (others => True)); -- Force showing all, we don't know what is used.
 	    --Revision_Used := (others => True);
 	    --Paranum_Used := True;
 	    --Make_Paragraph_Styles (Output_Object);
 	    -- Dummy line to be replaced after the file is created.
 	    Ada.Text_IO.Put_Line (Output_Object.Output_File, MAGIC_STYLE_MARKER);
-	    Paragraph_Used := (others => False);
+
+	    Paragraph_Used := (others => (others => False));
 	    Revision_Used := (others => False);
 	    Paranum_Used := False;
 
@@ -1710,8 +1447,9 @@
 	    if Output_Object.HTML_Kind = HTML_3 then
 	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "<UL><UL><TABLE Width=""70%"">"); -- Table with no border or caption, takes up 70% of the screen.
 	    else
-	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DIV Class=""CodeIndented""><TABLE Width=""70%"">"); -- Table with no border or caption, takes up 70% of the screen.
-		Paragraph_Used(ARM_Output.Code_Indented) := True;
+	        Ada.Text_IO.Put_Line (Output_Object.Output_File,
+		    "<div class=""" & Paragraph_Name (ARM_Output.Normal, 2) & """><table width=""70%"">"); -- Table with no border or caption, takes up 70% of the screen.
+		Paragraph_Used(ARM_Output.Normal, 2) := True;
 	    end if;
 	    -- And start the first row:
 	    Ada.Text_IO.Put (Output_Object.Output_File, "<TR><TD align=""left"">");
@@ -1759,7 +1497,7 @@
 		    if Output_Object.HTML_Kind = HTML_3 then
 	                Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TABLE></UL></UL>");
 		    else
-	                Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TABLE></DIV>");
+	                Ada.Text_IO.Put_Line (Output_Object.Output_File, "</table></div>");
 		    end if;
 		    exit;
 		end if;
@@ -1790,12 +1528,13 @@
 
 
     procedure Put_Compatibility_Font_Info (Output_Object : in out HTML_Output_Type;
-					   Format : in ARM_Output.Paragraph_Type) is
+					   Style  : in ARM_Output.Paragraph_Style_Type;
+					   Indent : in ARM_Output.Paragraph_Indent_Type) is
 	-- Internal:
         -- Output the font information for HTML 4.0 compatibility mode.
     begin
         if Output_Object.HTML_Kind = HTML_4_Compatible then
-	    case Paragraph_Info(Format).Font is
+	    case Paragraph_Info(Style, Indent).Font is
 	        when ARM_Output.Default =>
 		    if ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Swiss) then
 		        Ada.Text_IO.Put (Output_Object.Output_File, SWISS_FONT_CODE);
@@ -1811,25 +1550,25 @@
 		    Ada.Text_IO.Put (Output_Object.Output_File, "<TT>");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 4;
 	    end case;
-	    if ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed) then
+	    if ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed) then
 	        null; -- No font change here.
 	    else
-	        case Paragraph_Info(Format).Size is
+	        case Paragraph_Info(Style, Indent).Size is
 		    when 0 => null;
 		    when 1 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=""+1"">");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=""+1"">");
 		        Output_Object.Char_Count := Output_Object.Char_Count + 16;
 		    when 2 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=""+2"">");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=""+2"">");
 		        Output_Object.Char_Count := Output_Object.Char_Count + 16;
 		    when -1 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=""-1"">");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=""-1"">");
 		        Output_Object.Char_Count := Output_Object.Char_Count + 16;
 		    when -2 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=""-2"">");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=""-2"">");
 		        Output_Object.Char_Count := Output_Object.Char_Count + 16;
 		    when -3 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=""-3"">");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=""-3"">");
 		        Output_Object.Char_Count := Output_Object.Char_Count + 16;
 		    when others => null; -- Not supported.
 	        end case;
@@ -1839,49 +1578,51 @@
 
 
     procedure Put_End_Compatibility_Font_Info (Output_Object : in out HTML_Output_Type;
-					       Format : in ARM_Output.Paragraph_Type) is
+					       Style  : in ARM_Output.Paragraph_Style_Type;
+					       Indent : in ARM_Output.Paragraph_Indent_Type) is
 	-- Internal:
         -- Output the font information for HTML 4.0 compatibility mode.
     begin
         if Output_Object.HTML_Kind = HTML_4_Compatible then
-	    if ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed) then
+	    if ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed) then
 	        null; -- No font change here.
 	    else
-	        case Paragraph_Info(Format).Size is
+	        case Paragraph_Info(Style, Indent).Size is
 		    when 0 => null;
 		    when 1 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    when 2 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    when -1 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    when -2 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    when -3 =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    when others => null; -- Not supported.
 	        end case;
 	    end if;
-	    case Paragraph_Info(Format).Font is
+	    case Paragraph_Info(Style, Indent).Font is
 	        when ARM_Output.Default =>
 		    if ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Swiss) then
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 		    -- else nothing for Roman.
 		    end if;
 		when ARM_Output.Roman =>
 		    null;
 	        when ARM_Output.Swiss =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
 	        when ARM_Output.Fixed =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</TT>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</tt>");
 	    end case;
         end if;
     end Put_End_Compatibility_Font_Info;
 
 
     procedure Start_Paragraph (Output_Object : in out HTML_Output_Type;
-			       Format : in ARM_Output.Paragraph_Type;
-			       Number : in String;
+			       Style     : in ARM_Output.Paragraph_Style_Type;
+			       Indent    : in ARM_Output.Paragraph_Indent_Type;
+			       Number    : in String;
 			       No_Prefix : in Boolean := False;
 			       Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS;
 			       No_Breaks : in Boolean := False;
@@ -1890,12 +1631,12 @@
 				   := ARM_Output.Normal;
 			       Justification : in ARM_Output.Justification_Type
 				   := ARM_Output.Default) is
-	-- Start a new paragraph. The format of the paragraph is as specified.
-	-- The (AA)RM paragraph number (which might include update and version
-	-- numbers as well: [12.1/1]) is Number. If the format is a type with
-	-- a prefix (bullets, hangining items), the prefix is omitted if
-	-- No_Prefix is true. Tab_Stops defines the tab stops for the
-	-- paragraph. If No_Breaks is True, we will try to avoid page breaks
+	-- Start a new paragraph. The style and indent of the paragraph is as
+	-- specified. The (AA)RM paragraph number (which might include update
+	-- and version numbers as well: [12.1/1]) is Number. If the format is
+	-- a type with a prefix (bullets, hangining items), the prefix is
+	-- omitted if No_Prefix is true. Tab_Stops defines the tab stops for
+	-- the paragraph. If No_Breaks is True, we will try to avoid page breaks
 	-- in the paragraph. If Keep_with_Next is true, we will try to avoid
 	-- separating this paragraph and the next one. (These may have no
 	-- effect in formats that don't have page breaks). Space_After
@@ -1912,53 +1653,53 @@
 	    -- style data and use a DIV.
 	begin
 	    if Use_DIV then
-	        Ada.Text_IO.Put (Output_Object.Output_File, "<DIV");
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<div");
 	        Output_Object.Char_Count := 4;
 	    else
-	        case Paragraph_Info(Format).Tag is
+	        case Paragraph_Info(Style, Indent).Tag is
 		    when DIV =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<DIV");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<div");
 		        Output_Object.Char_Count := 4;
 		    when UL =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<UL");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<ul");
 		        Output_Object.Char_Count := 3;
 		    when DL =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<DL");
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<dl");
 		        Output_Object.Char_Count := 3;
 	        end case;
 	    end if;
-	    Ada.Text_IO.Put (Output_Object.Output_File, " Class=""" & Name & """");
+	    Ada.Text_IO.Put (Output_Object.Output_File, " class=""" & Name & """");
 	    Output_Object.Char_Count := Output_Object.Char_Count + 8 + Name'Length + 1;
 	    case Justification is
 	        when ARM_Output.Default | ARM_Output.Left | ARM_Output.Justified =>
 		    null;
 	        when ARM_Output.Center =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, " Style=""text-align: center""");
+		    Ada.Text_IO.Put (Output_Object.Output_File, " style=""text-align: center""");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 27;
 	        when ARM_Output.Right =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, " Style=""text-align: right""");
+		    Ada.Text_IO.Put (Output_Object.Output_File, " style=""text-align: right""");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 26;
 	    end case;
 	    case Space_After is
 	        when ARM_Output.Normal =>
 		    null;
 	        when ARM_Output.Narrow =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, " Style=""margin-bottom: ");
+		    Ada.Text_IO.Put (Output_Object.Output_File, " style=""margin-bottom: ");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 24;
-		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(Format).After * LEADING_PERCENT) / 100);
+		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(Style, Indent).After * LEADING_PERCENT) / 100);
 		    Ada.Text_IO.Put (Output_Object.Output_File, """");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 6;
 	        when ARM_Output.Wide =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, " Style=""margin-bottom: ");
+		    Ada.Text_IO.Put (Output_Object.Output_File, " style=""margin-bottom: ");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 24;
-		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(Format).After * TRAILING_PERCENT) / 100);
+		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(Style, Indent).After * TRAILING_PERCENT) / 100);
 		    Ada.Text_IO.Put (Output_Object.Output_File, """");
 		    Output_Object.Char_Count := Output_Object.Char_Count + 6;
 	    end case;
 	    Ada.Text_IO.Put (Output_Object.Output_File, ">");
 	    Output_Object.Char_Count := Output_Object.Char_Count + 1;
 	    if Output_Object.HTML_Kind = HTML_4_Compatible and then Include_Compatibility then
-		Put_Compatibility_Font_Info (Output_Object, Format);
+		Put_Compatibility_Font_Info (Output_Object, Style, Indent);
 	    end if;
 	end Put_Style;
 
@@ -1976,6 +1717,11 @@
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
 		"Paragraph number when none used");
 	end if;
+	if not Paragraph_Info(Style, Indent).Defined then
+            Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
+	        "Undefined style " & ARM_Output.Paragraph_Style_Type'Image(Style) &
+		" and indent" & ARM_Output.Paragraph_Indent_Type'Image(Indent));
+	end if;
 
 	Output_Object.Is_In_Paragraph := True;
 	Output_Object.Had_Prefix := not No_Prefix;
@@ -1995,13 +1741,12 @@
 	        Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
 		    "Tabs in 4+ column text");
 	    end if;
-	    case Format is
-	        when ARM_Output.Normal | ARM_Output.Syntax_Indented |
-		     ARM_Output.Code_Indented | ARM_Output.Indented =>
+	    case Style is
+	        when ARM_Output.Normal =>
 		    null;
 		when others =>
 	            Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
-		        "Unsupported format in 4+ column text - " & ARM_Output.Paragraph_Type'Image(Format));
+		        "Unsupported format in 4+ column text - " & ARM_Output.Paragraph_Style_Type'Image(Style));
 	    end case;
 	    if Number /= "" then
 	        Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
@@ -2011,29 +1756,23 @@
 	end if;
 
 	-- Set up tabs:
-	case Format is
-	    when ARM_Output.Normal | ARM_Output.Wide |
-		 ARM_Output.Notes | ARM_Output.Notes_Header |
-		 ARM_Output.Annotations | ARM_Output.Wide_Annotations |
+	case Style is
+	    when ARM_Output.Normal | ARM_Output.Wide_Above |
+		 ARM_Output.Small | ARM_Output.Small_Wide_Above |
+		 ARM_Output.Header | ARM_Output.Small_Header |
 		 ARM_Output.Index | ARM_Output.Syntax_Summary |
 		 ARM_Output.Examples | ARM_Output.Small_Examples |
-		 ARM_Output.Indented_Examples | ARM_Output.Small_Indented_Examples |
-		 ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples |
-		 ARM_Output.Swiss_Indented_Examples | ARM_Output.Small_Swiss_Indented_Examples |
-		 ARM_Output.Syntax_Indented | ARM_Output.Small_Syntax_Indented |
-		 ARM_Output.Indented | ARM_Output.Small_Indented |
-		 ARM_Output.Inner_Indented | ARM_Output.Small_Inner_Indented |
-		 ARM_Output.Code_Indented | ARM_Output.Small_Code_Indented =>
+		 ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples =>
 		Output_Object.Tab_Stops := Tab_Stops;
 		-- No tabs in HTML; we'll emulate them for fixed fonts.
 		-- We'll expand proportional stops here (text characters
 		-- are larger than the variable ones these are set up for).
 		Output_Object.Can_Emulate_Tabs :=
-		    ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed);
+		    ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed);
 		for I in 1 .. Tab_Stops.Number loop
 		    if ARM_Output."=" (Tab_Stops.Stops(I).Kind,
 				       ARM_Output.Left_Proportional) then
-		        if ARM_Output."=" (Paragraph_Info(Format).Font, ARM_Output.Fixed) then
+		        if ARM_Output."=" (Paragraph_Info(Style, Indent).Font, ARM_Output.Fixed) then
 			    Output_Object.Tab_Stops.Stops(I).Stop :=
 				(Tab_Stops.Stops(I).Stop * 13 / 12);
 			else -- Proportional characters are smaller.
@@ -2046,17 +1785,13 @@
 		    end if;
 		end loop;
 
-	    when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted | ARM_Output.Nested_X2_Bulleted |
-		 ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted | ARM_Output.Small_Nested_X2_Bulleted |
-		 ARM_Output.Indented_Bulleted | ARM_Output.Indented_Nested_Bulleted |
-		 ARM_Output.Code_Indented_Bulleted | ARM_Output.Code_Indented_Nested_Bulleted |
-		 ARM_Output.Syntax_Indented_Bulleted |
-		 ARM_Output.Notes_Bulleted | ARM_Output.Notes_Nested_Bulleted |
-		 ARM_Output.Hanging | ARM_Output.Indented_Hanging |
-		 ARM_Output.Small_Hanging | ARM_Output.Small_Indented_Hanging |
-		 ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted |
-		 ARM_Output.Enumerated | ARM_Output.Small_Enumerated |
-		 ARM_Output.Nested_Enumerated | ARM_Output.Small_Nested_Enumerated =>
+	    when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
+		 ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted |
+		 ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		 ARM_Output.Hanging_in_Bulleted |
+		 ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		 ARM_Output.Small_Hanging_in_Bulleted |
+		 ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
 		if Tab_Stops.Number /= 0 then
 	            Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
 		        "Tabs in hanging/bulleted paragraph");
@@ -2067,308 +1802,106 @@
 	if Output_Object.HTML_Kind = HTML_3 then
 	    -- Note: We can't control the space below the paragraphs here, so
 	    -- Space_After is ignored.
-	    case Format is
-	        when ARM_Output.Normal =>
-		    case Justification is
-		        when ARM_Output.Default | ARM_Output.Left | ARM_Output.Justified =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
-			    Output_Object.Char_Count := 3;
-		        when ARM_Output.Center =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=CENTER>");
-			    Output_Object.Char_Count := 16;
-		        when ARM_Output.Right =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=RIGHT>");
-			    Output_Object.Char_Count := 15;
-		    end case;
-	        when ARM_Output.Wide =>
-		    case Justification is
-		        when ARM_Output.Default | ARM_Output.Left | ARM_Output.Justified =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
-			    Output_Object.Char_Count := 3;
-		        when ARM_Output.Center =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=CENTER>");
-			    Output_Object.Char_Count := 16;
-		        when ARM_Output.Right =>
-			    Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=RIGHT>");
-			    Output_Object.Char_Count := 15;
-		    end case;
-		    -- Note: In HTML 4, we might be able to control the space above.
-	        when ARM_Output.Notes=>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 18;
-	        when ARM_Output.Notes_Header =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 18;
-		    -- Note: In HTML 4, we might be able to control the space below.
-	        when ARM_Output.Annotations =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 22;
-	        when ARM_Output.Wide_Annotations =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 22;
-		    -- Note: In HTML 4, we might be able to control the space above.
+	    -- Make any indents:
+	    for I in 1 .. Indent loop
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL>");
+		Output_Object.Char_Count := Output_Object.Char_Count + 4;
+	    end loop;
+	    case Style is
+	        when ARM_Output.Normal | ARM_Output.Wide_Above |
+		     ARM_Output.Header =>
+		    if ARM_Output."=" (Indent, 0) then
+		        case Justification is
+		            when ARM_Output.Default | ARM_Output.Left | ARM_Output.Justified =>
+			        Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
+			        Output_Object.Char_Count := 3;
+		            when ARM_Output.Center =>
+			        Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=CENTER>");
+			        Output_Object.Char_Count := 16;
+		            when ARM_Output.Right =>
+			        Ada.Text_IO.Put (Output_Object.Output_File, "<P ALIGN=RIGHT>");
+			        Output_Object.Char_Count := 15;
+		        end case;
+		    else
+			null; -- Formatting is hard in HTML 3!
+		    end if;
+
+	        when ARM_Output.Small | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header =>
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=-1>");
+		    Output_Object.Char_Count := Output_Object.Char_Count + 14;
+
 	        when ARM_Output.Index =>
 		    -- Note: We don't put this in a smaller font.
-		    Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
-		    Output_Object.Char_Count := 3;
+		    if ARM_Output."=" (Indent, 0) then
+		        Ada.Text_IO.Put (Output_Object.Output_File, "<P>");
+		        Output_Object.Char_Count := 3;
+		    else
+			null; -- Formatting is hard in HTML 3!
+		    end if;
+
 	        when ARM_Output.Syntax_Summary =>
 		    -- Note: We don't put this in a smaller font.
-		    Ada.Text_IO.Put (Output_Object.Output_File, "<UL>");
-		    Output_Object.Char_Count := 4;
+	    	    null;
+
 	        when ARM_Output.Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><TT>");
-		    Output_Object.Char_Count := 8;
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<TT>");
+		    Output_Object.Char_Count := Output_Object.Char_Count + 4;
 	        when ARM_Output.Small_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><TT><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 30;
-	        when ARM_Output.Indented_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><TT>");
-		    Output_Object.Char_Count := 20;
-	        when ARM_Output.Small_Indented_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><UL><TT><FONT SIZE=-1>");
-		    Output_Object.Char_Count := 42;
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<TT><FONT SIZE=-1>");
+		    Output_Object.Char_Count := Output_Object.Char_Count + 18;
 	        when ARM_Output.Swiss_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL>" & SWISS_FONT_CODE);
-		    Output_Object.Char_Count := 8;
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, SWISS_FONT_CODE);
+		    Output_Object.Char_Count := Output_Object.Char_Count + SWISS_FONT_CODE'Length;
 	        when ARM_Output.Small_Swiss_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL>" & SMALL_SWISS_FONT_CODE);
-		    Output_Object.Char_Count := 30;
-	        when ARM_Output.Swiss_Indented_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL>" & SWISS_FONT_CODE);
-		    Output_Object.Char_Count := 20;
-	        when ARM_Output.Small_Swiss_Indented_Examples =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><UL>" & SMALL_SWISS_FONT_CODE);
-		    Output_Object.Char_Count := 42;
-	        when ARM_Output.Syntax_Indented =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL>");
-		    Output_Object.Char_Count := 4;
-	        when ARM_Output.Small_Syntax_Indented =>
-	            Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><FONT SIZE=-1>");
-	            Output_Object.Char_Count := 30;
-	        when ARM_Output.Code_Indented =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL>");
-		    Output_Object.Char_Count := 8;
-	        when ARM_Output.Small_Code_Indented =>
-	            Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><FONT SIZE=-1>");
-	            Output_Object.Char_Count := 30;
-	        when ARM_Output.Indented =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL>");
-		    Output_Object.Char_Count := 12;
-	        when ARM_Output.Small_Indented =>
-	            Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><FONT SIZE=-1>");
-	            Output_Object.Char_Count := 34;
-	        when ARM_Output.Inner_Indented =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL>");
-		    Output_Object.Char_Count := 16;
-	        when ARM_Output.Small_Inner_Indented =>
-	            Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><UL><FONT SIZE=-1>");
-	            Output_Object.Char_Count := 38;
-	        when ARM_Output.Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL>");
-		        Output_Object.Char_Count := 4;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 18;
-		    end if;
-	        when ARM_Output.Nested_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL>");
-		        Output_Object.Char_Count := 8;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 22;
-		    end if;
-	        when ARM_Output.Nested_X2_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL>");
-		        Output_Object.Char_Count := 12;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 26;
-		    end if;
-	        when ARM_Output.Small_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 26;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><LI TYPE=DISC><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 40;
-		    end if;
-	        when ARM_Output.Small_Nested_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 30;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><LI TYPE=DISC><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 44;
-		    end if;
-	        when ARM_Output.Small_Nested_X2_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 34;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><LI TYPE=DISC><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 48;
-		    end if;
-	        when ARM_Output.Indented_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL>");
-		        Output_Object.Char_Count := 16;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 30;
-		    end if;
-	        when ARM_Output.Indented_Nested_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL>");
-		        Output_Object.Char_Count := 20;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 34;
-		    end if;
-	        when ARM_Output.Code_Indented_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL>");
-		        Output_Object.Char_Count := 12;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 26;
-		    end if;
-	        when ARM_Output.Code_Indented_Nested_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL>");
-		        Output_Object.Char_Count := 16;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 30;
-		    end if;
-	        when ARM_Output.Syntax_Indented_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL>");
-		        Output_Object.Char_Count := 8;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><LI TYPE=DISC>");
-		        Output_Object.Char_Count := 22;
-		    end if;
-	        when ARM_Output.Notes_Bulleted =>
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, SMALL_SWISS_FONT_CODE);
+		    Output_Object.Char_Count := Output_Object.Char_Count + SMALL_SWISS_FONT_CODE'Length;
+
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted =>
 		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 18;
+			null;
 		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><LI TYPE=DISC><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 32;
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 14;
 		    end if;
-	        when ARM_Output.Notes_Nested_Bulleted =>
+
+	        when ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
 		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 22;
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=-1>");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 14;
 		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><LI TYPE=DISC><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 36;
-		    end if;
-	        when ARM_Output.Hanging =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DD>");
-		        Output_Object.Char_Count := 8;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DT>");
-		        Output_Object.Char_Count := 8;
-		        Output_Object.Saw_Hang_End := False;
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC><FONT SIZE=-1>");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 28;
 		    end if;
-	        when ARM_Output.Indented_Hanging =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DD>");
-		        Output_Object.Char_Count := 16;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DT>");
-		        Output_Object.Char_Count := 16;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Hanging =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DD><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 30;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DT><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 30;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Indented_Hanging =>
-		    if No_Prefix then
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><DL><DD><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 38;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><UL><DL><DT><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 38;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Hanging_in_Bulleted =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><DL><DD>");
-		        Output_Object.Char_Count := 12;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><DL><DT>");
-		        Output_Object.Char_Count := 12;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Hanging_in_Bulleted =>
-		    if No_Prefix then
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><DL><DD><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 34;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><DL><DT><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 34;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Enumerated =>
+
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+		     ARM_Output.Enumerated =>
 		    if No_Prefix then
 	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DD>");
-		        Output_Object.Char_Count := 8;
+		        Output_Object.Char_Count := Output_Object.Char_Count + 8;
 		        Output_Object.Saw_Hang_End := True;
 		    else -- Has prefix.
 	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DT>");
-		        Output_Object.Char_Count := 8;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Enumerated =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DD><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 30;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><DL><DT><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 30;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Nested_Enumerated =>
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><DL><DD>");
-		        Output_Object.Char_Count := 12;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><DL><DT>");
-		        Output_Object.Char_Count := 12;
+		        Output_Object.Char_Count := Output_Object.Char_Count + 8;
 		        Output_Object.Saw_Hang_End := False;
 		    end if;
-	        when ARM_Output.Small_Nested_Enumerated =>
+
+	        when ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+		     ARM_Output.Small_Enumerated =>
 		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><DL><DD><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 34;
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DD><FONT SIZE=-1>");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 22;
 		        Output_Object.Saw_Hang_End := True;
 		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<UL><UL><UL><DL><DT><FONT SIZE=-1>");
-		        Output_Object.Char_Count := 34;
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DL><DT><FONT SIZE=-1>");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 22;
 		        Output_Object.Saw_Hang_End := False;
 		    end if;
 	    end case;
-	    Output_Object.Paragraph_Format := Format;
+	    Output_Object.Paragraph_Style  := Style;
+	    Output_Object.Paragraph_Indent := Indent;
 	    Output_Object.Font := ARM_Output.Default;
 	    Output_Object.Is_Bold := False;
 	    Output_Object.Is_Italic := False;
@@ -2386,11 +1919,11 @@
 	elsif Output_Object.HTML_Kind = HTML_4_Compatible then
 	    if Number /= "" then -- Has paragraph number.
 		Paranum_Used := True;
-		Ada.Text_IO.Put (Output_Object.Output_File, "<DIV Class=""paranum"">");
-	        Ada.Text_IO.Put (Output_Object.Output_File, "<FONT SIZE=-2>");
+		Ada.Text_IO.Put (Output_Object.Output_File, "<div class=""paranum"">");
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<font size=-2>");
 	        Ada.Text_IO.Put (Output_Object.Output_File, Number);
-	        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
-	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</DIV>");
+	        Ada.Text_IO.Put (Output_Object.Output_File, "</font>");
+	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</div>");
 	        Output_Object.Char_Count := 0;
 	        Output_Object.Disp_Char_Count := 0;
 	        Output_Object.Disp_Large_Char_Count := 0;
@@ -2399,572 +1932,138 @@
 		Output_Object.Conditional_Space := False; -- Don't need it here.
 	    end if;
 
-	    case Format is
-	        when ARM_Output.Normal =>
-		    Put_Style ("Normal");
-	        when ARM_Output.Wide =>
-		    Put_Style ("Wide");
-	        when ARM_Output.Notes=>
-		    Put_Style ("Notes");
-	        when ARM_Output.Notes_Header =>
-		    Put_Style ("NotesHeader");
-	        when ARM_Output.Annotations =>
-		    Put_Style ("Annotations");
-	        when ARM_Output.Wide_Annotations =>
-		    Put_Style ("WideAnnotations");
-	        when ARM_Output.Index =>
-		    Put_Style ("Index");
-	        when ARM_Output.Syntax_Summary =>
-		    Put_Style ("SyntaxSummary");
-	        when ARM_Output.Examples =>
-		    Put_Style ("Examples");
-	        when ARM_Output.Small_Examples =>
-		    Put_Style ("SmallExamples");
-	        when ARM_Output.Indented_Examples =>
-		    Put_Style ("IndentedExamples");
-	        when ARM_Output.Small_Indented_Examples =>
-		    Put_Style ("SmallIndentedExamples");
-	        when ARM_Output.Swiss_Examples =>
-		    Put_Style ("SwissExamples");
-	        when ARM_Output.Small_Swiss_Examples =>
-		    Put_Style ("SmallSwissExamples");
-	        when ARM_Output.Swiss_Indented_Examples =>
-		    Put_Style ("SwissIndentedExamples");
-	        when ARM_Output.Small_Swiss_Indented_Examples =>
-		    Put_Style ("SmallSwissIndentedExamples");
-	        when ARM_Output.Syntax_Indented =>
-		    Put_Style ("SyntaxIndented");
-	        when ARM_Output.Small_Syntax_Indented =>
-		    Put_Style ("SmallSyntaxIndented");
-	        when ARM_Output.Code_Indented =>
-		    Put_Style ("CodeIndented");
-	        when ARM_Output.Small_Code_Indented =>
-		    Put_Style ("SmallCodeIndented");
-	        when ARM_Output.Indented =>
-		    Put_Style ("Indented");
-	        when ARM_Output.Small_Indented =>
-		    Put_Style ("SmallIndented");
-	        when ARM_Output.Inner_Indented =>
-		    Put_Style ("InnerIndented");
-	        when ARM_Output.Small_Inner_Indented =>
-		    Put_Style ("SmallInnerIndented");
-	        when ARM_Output.Bulleted =>
-		    Put_Style ("Bulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Nested_Bulleted =>
-		    Put_Style ("NestedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Nested_X2_Bulleted =>
-		    Put_Style ("NestedX2Bulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Bulleted =>
-		    Put_Style ("SmallBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Nested_Bulleted =>
-		    Put_Style ("SmallNestedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Nested_X2_Bulleted =>
-		    Put_Style ("SmallNestedX2Bulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Indented_Bulleted =>
-		    Put_Style ("IndentedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Indented_Nested_Bulleted =>
-		    Put_Style ("IndentedNestedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Code_Indented_Bulleted =>
-		    Put_Style ("CodeIndentedBulleted", Include_Compatibility => False);
+	    case Style is
+		when ARM_Output.Normal | ARM_Output.Wide_Above |
+		     ARM_Output.Header |
+		     ARM_Output.Small  | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header |
+	             ARM_Output.Index | ARM_Output.Syntax_Summary |
+	             ARM_Output.Examples | ARM_Output.Swiss_Examples |
+	             ARM_Output.Small_Examples | ARM_Output.Small_Swiss_Examples =>
+		    Put_Style (Paragraph_Name (Style, Indent));
+
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
+	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
+		    Put_Style (Paragraph_Name (Style, Indent), Include_Compatibility => False);
 		    if No_Prefix then
 			null;
 		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Code_Indented_Nested_Bulleted =>
-		    Put_Style ("CodeIndentedNestedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Syntax_Indented_Bulleted =>
-		    Put_Style ("SyntaxIndentedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Notes_Bulleted =>
-		    Put_Style ("NotesBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<li type=disc>");
 			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Notes_Nested_Bulleted =>
-		    Put_Style ("NotesNestedBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Hanging =>
-		    Put_Style ("Hanging");
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""Hanging"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 21;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Indented_Hanging =>
-		    Put_Style ("IndentedHanging");
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""IndentedHanging"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 29;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Hanging =>
-		    Put_Style ("SmallHanging", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""SmallHanging"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 26;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Indented_Hanging =>
-		    Put_Style ("SmallIndentedHanging", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""SmallIndentedHanging"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 34;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Hanging_in_Bulleted =>
-		    Put_Style ("HangingInBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""HangingInBulleted"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 31;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Hanging_in_Bulleted =>
-		    Put_Style ("SmallHangingInBulleted", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""SmallHangingInBulleted"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 36;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Enumerated =>
-		    Put_Style ("Enumerated", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""Enumerated"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 24;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Enumerated =>
-		    Put_Style ("SmallEnumerated", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""SmallEnumerated"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 29;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Nested_Enumerated =>
-		    Put_Style ("NestedEnumerated", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""NestedEnumerated"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 24;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
-	        when ARM_Output.Small_Nested_Enumerated =>
-		    Put_Style ("SmallNestedEnumerated", Include_Compatibility => False);
-		    if No_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DD Class =""SmallNestedEnumerated"">");
-			Output_Object.Char_Count := Output_Object.Char_Count + 29;
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<DT>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 4;
-		        Output_Object.Saw_Hang_End := False;
 		    end if;
-		    Put_Compatibility_Font_Info (Output_Object, Format);
+		    Put_Compatibility_Font_Info (Output_Object, Style, Indent);
+
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+		     ARM_Output.Enumerated |
+	             ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+		     ARM_Output.Small_Enumerated =>
+		    declare
+			PName : constant String :=
+				Paragraph_Name (Style, Indent);
+		    begin
+		        Put_Style (PName, Include_Compatibility => False);
+		        if No_Prefix then
+	    	            Ada.Text_IO.Put (Output_Object.Output_File, "<dd class="" & PName & "">");
+			    Output_Object.Char_Count := Output_Object.Char_Count + 13 + PName'Length;
+		            Output_Object.Saw_Hang_End := True;
+		        else -- Has prefix.
+	    	            Ada.Text_IO.Put (Output_Object.Output_File, "<dt>");
+			    Output_Object.Char_Count := Output_Object.Char_Count + 4;
+		            Output_Object.Saw_Hang_End := False;
+		        end if;
+		        Put_Compatibility_Font_Info (Output_Object, Style, Indent);
+		    end;
+
 	    end case;
-	    Output_Object.Paragraph_Format := Format;
+	    Output_Object.Paragraph_Style  := Style;
+	    Output_Object.Paragraph_Indent := Indent;
 	    Output_Object.Font := ARM_Output.Default;
 	    Output_Object.Is_Bold := False;
 	    Output_Object.Is_Italic := False;
 	    Output_Object.Size := 0;
 	    if Number /= "" then -- Has paragraph number.
-		if ((not No_Prefix) and then Paragraph_Info(Format).Indent = 0) or else
-		     ARM_Output."=" (Format, ARM_Output.Normal) or else
-		     ARM_Output."=" (Format, ARM_Output.Wide) then -- No indent.
+		if Paragraph_Info(Style, Indent).Indent = 0 and then
+		   ((not No_Prefix) or else
+		     Style in ARM_Output.Unprefixed_Style_Subtype) then
+		    -- No indent, either a prefix or a style that doesn't
+		    -- have a prefix.
 		    -- We may have to make a space for the paragraph number,
-		    -- as absolute positioned or floating items can overlap others.
-		    for I in 1 .. (Number'Length+2)-(INDENT_EMS_FOR_PARANUMS/5) loop
-			-- We assume that each space is roughly equal to
-			-- 0.5em (that should be conservative).
-			Ada.Text_IO.Put (Output_Object.Output_File, "&nbsp;");
-		        Output_Object.Char_Count := Output_Object.Char_Count + 1;
-		        Output_Object.Disp_Char_Count := Output_Object.Disp_Char_Count + 1;
-			--Output_Object.Disp_Large_Char_Count := <unchanged>;
-		    end loop;
-		-- else is indented, so we don't need to make space.
-		end if;
-	    end if;
-	else -- HTML_4_Only.
-	    if Number /= "" then -- Has paragraph number.
-		Paranum_Used := True;
-	        Ada.Text_IO.Put (Output_Object.Output_File, "<DIV Class=""paranum"">");
-	        Ada.Text_IO.Put (Output_Object.Output_File, Number);
-	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</DIV>");
-	        Output_Object.Char_Count := 0;
-	        Output_Object.Disp_Char_Count := 0;
-	        Output_Object.Disp_Large_Char_Count := 0;
-		Output_Object.Any_Nonspace := False;
-		Output_Object.Last_Was_Space := True; -- Start of line
-		Output_Object.Conditional_Space := False; -- Don't need it here.
-	    end if;
-
-	    case Format is
-	        when ARM_Output.Normal =>
-		    Put_Style ("Normal");
-	        when ARM_Output.Wide =>
-		    Put_Style ("Wide");
-	        when ARM_Output.Notes=>
-		    Put_Style ("Notes");
-	        when ARM_Output.Notes_Header =>
-		    Put_Style ("NotesHeader");
-	        when ARM_Output.Annotations =>
-		    Put_Style ("Annotations");
-	        when ARM_Output.Wide_Annotations =>
-		    Put_Style ("WideAnnotations");
-	        when ARM_Output.Index =>
-		    Put_Style ("Index");
-	        when ARM_Output.Syntax_Summary =>
-		    Put_Style ("SyntaxSummary");
-	        when ARM_Output.Examples =>
-		    Put_Style ("Examples");
-	        when ARM_Output.Small_Examples =>
-		    Put_Style ("SmallExamples");
-	        when ARM_Output.Indented_Examples =>
-		    Put_Style ("IndentedExamples");
-	        when ARM_Output.Small_Indented_Examples =>
-		    Put_Style ("SmallIndentedExamples");
-	        when ARM_Output.Swiss_Examples =>
-		    Put_Style ("SwissExamples");
-	        when ARM_Output.Small_Swiss_Examples =>
-		    Put_Style ("SmallSwissExamples");
-	        when ARM_Output.Swiss_Indented_Examples =>
-		    Put_Style ("SwissIndentedExamples");
-	        when ARM_Output.Small_Swiss_Indented_Examples =>
-		    Put_Style ("SmallSwissIndentedExamples");
-	        when ARM_Output.Syntax_Indented =>
-		    Put_Style ("SyntaxIndented");
-	        when ARM_Output.Small_Syntax_Indented =>
-		    Put_Style ("SmallSyntaxIndented");
-	        when ARM_Output.Code_Indented =>
-		    Put_Style ("CodeIndented");
-	        when ARM_Output.Small_Code_Indented =>
-		    Put_Style ("SmallCodeIndented");
-	        when ARM_Output.Indented =>
-		    Put_Style ("Indented");
-	        when ARM_Output.Small_Indented =>
-		    Put_Style ("SmallIndented");
-	        when ARM_Output.Inner_Indented =>
-		    Put_Style ("InnerIndented");
-	        when ARM_Output.Small_Inner_Indented =>
-		    Put_Style ("SmallInnerIndented");
-	        when ARM_Output.Bulleted =>
-		    Put_Style ("Bulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Nested_Bulleted =>
-		    Put_Style ("NestedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Nested_X2_Bulleted =>
-		    Put_Style ("NestedX2Bulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Small_Bulleted =>
-		    Put_Style ("SmallBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Small_Nested_Bulleted =>
-		    Put_Style ("SmallNestedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Small_Nested_X2_Bulleted =>
-		    Put_Style ("SmallNestedX2Bulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Indented_Bulleted =>
-		    Put_Style ("IndentedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Indented_Nested_Bulleted =>
-		    Put_Style ("IndentedNestedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Code_Indented_Bulleted =>
-		    Put_Style ("CodeIndentedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Code_Indented_Nested_Bulleted =>
-		    Put_Style ("CodeIndentedNestedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Syntax_Indented_Bulleted =>
-		    Put_Style ("SyntaxIndentedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Notes_Bulleted =>
-		    Put_Style ("NotesBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Notes_Nested_Bulleted =>
-		    Put_Style ("NotesNestedBulleted");
-		    if No_Prefix then
-			null;
-		    else
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "<LI TYPE=DISC>");
-			Output_Object.Char_Count := Output_Object.Char_Count + 14;
-		    end if;
-	        when ARM_Output.Hanging =>
-		    if No_Prefix then
-		        Put_Style ("Hanging-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("Hanging-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Indented_Hanging =>
-		    if No_Prefix then
-		        Put_Style ("IndentedHanging-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("IndentedHanging-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Hanging =>
-		    if No_Prefix then
-		        Put_Style ("SmallHanging-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("SmallHanging-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Indented_Hanging =>
-		    if No_Prefix then
-		        Put_Style ("SmallIndentedHanging-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("SmallIndentedHanging-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Hanging_in_Bulleted =>
-		    if No_Prefix then
-		        Put_Style ("HangingInBulleted-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("HangingInBulleted-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Hanging_in_Bulleted =>
-		    if No_Prefix then
-		        Put_Style ("SmallHangingInBulleted-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("SmallHangingInBulleted-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Enumerated =>
-		    if No_Prefix then
-		        Put_Style ("Enumerated-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("Enumerated-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Enumerated =>
-		    if No_Prefix then
-		        Put_Style ("SmallEnumerated-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("SmallEnumerated-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Nested_Enumerated =>
-		    if No_Prefix then
-		        Put_Style ("NestedEnumerated-Body", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := True;
-		    else -- Has prefix.
-		        Put_Style ("NestedEnumerated-Term", Include_Compatibility => False, Use_DIV => True);
-		        Output_Object.Saw_Hang_End := False;
-		    end if;
-	        when ARM_Output.Small_Nested_Enumerated =>
+		    -- as absolute positioned or floating items can overlap
+		    -- others.
+		    for I in 1 .. (Number'Length+2)-(INDENT_EMS_FOR_PARANUMS/5) loop
+			-- We assume that each space is roughly equal to
+			-- 0.5em (that should be conservative).
+			Ada.Text_IO.Put (Output_Object.Output_File, "&nbsp;");
+		        Output_Object.Char_Count := Output_Object.Char_Count + 1;
+		        Output_Object.Disp_Char_Count := Output_Object.Disp_Char_Count + 1;
+			--Output_Object.Disp_Large_Char_Count := <unchanged>;
+		    end loop;
+		-- else is indented, so we don't need to make space.
+		end if;
+	    end if;
+	else -- HTML_4_Only.
+	    if Number /= "" then -- Has paragraph number.
+		Paranum_Used := True;
+	        Ada.Text_IO.Put (Output_Object.Output_File, "<div class=""paranum"">");
+	        Ada.Text_IO.Put (Output_Object.Output_File, Number);
+	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</div>");
+	        Output_Object.Char_Count := 0;
+	        Output_Object.Disp_Char_Count := 0;
+	        Output_Object.Disp_Large_Char_Count := 0;
+		Output_Object.Any_Nonspace := False;
+		Output_Object.Last_Was_Space := True; -- Start of line
+		Output_Object.Conditional_Space := False; -- Don't need it here.
+	    end if;
+
+	    case Style is
+		when ARM_Output.Normal | ARM_Output.Wide_Above |
+		     ARM_Output.Header |
+		     ARM_Output.Small  | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header |
+	             ARM_Output.Index | ARM_Output.Syntax_Summary |
+	             ARM_Output.Examples | ARM_Output.Swiss_Examples |
+	             ARM_Output.Small_Examples | ARM_Output.Small_Swiss_Examples =>
+		    Put_Style (Paragraph_Name (Style, Indent));
+
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
+	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
+		    -- We use formatted DIVs here, as otherwise the indenting
+		    -- varies wildly between Firefox and IE (and does not
+		    -- match similar enumerated lists).
+		    if No_Prefix then
+		        Put_Style (Paragraph_Name (Style, Indent) & "-NoPrefix", Use_DIV => True);
+		    else
+		        Put_Style (Paragraph_Name (Style, Indent), Use_DIV => True);
+		    end if;
+
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+		     ARM_Output.Enumerated |
+	             ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+		     ARM_Output.Small_Enumerated =>
 		    if No_Prefix then
-		        Put_Style ("SmallNestedEnumerated-Body", Include_Compatibility => False, Use_DIV => True);
+		        Put_Style (Paragraph_Name (Style, Indent) & "-Body", Use_DIV => True);
 		        Output_Object.Saw_Hang_End := True;
 		    else -- Has prefix.
-		        Put_Style ("SmallNestedEnumerated-Term", Include_Compatibility => False, Use_DIV => True);
+		        Put_Style (Paragraph_Name (Style, Indent) & "-Term", Use_DIV => True);
 		        Output_Object.Saw_Hang_End := False;
 		    end if;
 	    end case;
-	    Output_Object.Paragraph_Format := Format;
+	    Output_Object.Paragraph_Style  := Style;
+	    Output_Object.Paragraph_Indent := Indent;
 	    Output_Object.Font := ARM_Output.Default;
 	    Output_Object.Is_Bold := False;
 	    Output_Object.Is_Italic := False;
 	    Output_Object.Size := 0;
 	    if Number /= "" then -- Has paragraph number.
-		if ((not No_Prefix) and then Paragraph_Info(Format).Indent = 0) or else
-		     ARM_Output."=" (Format, ARM_Output.Normal) or else
-		     ARM_Output."=" (Format, ARM_Output.Wide) then -- No indent.
+		if Paragraph_Info(Style, Indent).Indent = 0 and then
+		   ((not No_Prefix) or else
+		     Style in ARM_Output.Unprefixed_Style_Subtype) then
+		    -- No indent, either a prefix or a style that doesn't
+		    -- have a prefix.
 		    -- We may have to make a space for the paragraph number,
 		    -- as absolute positioned or floating items can overlap
 		    -- others.
@@ -2983,7 +2082,7 @@
 		end if;
 	    end if;
 	end if;
-	Paragraph_Used(Format) := True;
+	Paragraph_Used(Style, Indent) := True;
 
 	-- Note: No_Breaks and Keep_with_Next have no effect here, because
 	-- HTML doesn't have page breaks.
@@ -2993,21 +2092,22 @@
     procedure End_Paragraph (Output_Object : in out HTML_Output_Type) is
 	-- End a paragraph.
 
-	procedure Put_End_Style (Format : in ARM_Output.Paragraph_Type;
+	procedure Put_End_Style (Style  : in ARM_Output.Paragraph_Style_Type;
+				 Indent : in ARM_Output.Paragraph_Indent_Type;
 				 Include_Compatibility : in Boolean := True) is
 	    -- Output a end style for HTML 4.0; if Include_Compatibility is True,
 	    -- include compatibility font information as well.
 	begin
 	    if Output_Object.HTML_Kind = HTML_4_Compatible and then Include_Compatibility then
-		Put_End_Compatibility_Font_Info (Output_Object, Format);
+		Put_End_Compatibility_Font_Info (Output_Object, Style, Indent);
 	    end if;
-	    case Paragraph_Info(Format).Tag is
+	    case Paragraph_Info(Style, Indent).Tag is
 		when DIV =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</DIV>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</div>");
 		when UL =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</UL>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</ul>");
 		when DL =>
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</DL>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</dl>");
 	    end case;
 	end Put_End_Style;
 
@@ -3043,264 +2143,113 @@
 	end if;
 
 	if Output_Object.HTML_Kind = HTML_3 then
-	    case Output_Object.Paragraph_Format is
-	        when ARM_Output.Normal | ARM_Output.Wide |
+	    case Output_Object.Paragraph_Style is
+	        when ARM_Output.Normal | ARM_Output.Wide_Above | ARM_Output.Header |
 	             ARM_Output.Index =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</P>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+		    if ARM_Output."=" (Output_Object.Paragraph_Indent, 0) then
+		        Ada.Text_IO.Put (Output_Object.Output_File, "</P>");
+		    -- else let the indent nesting handling it.
+		    end if;
 	        when ARM_Output.Syntax_Summary =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Notes | ARM_Output.Notes_Header =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Annotations | ARM_Output.Wide_Annotations =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+	    	    null;
+	        when ARM_Output.Small | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header =>
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+
 	        when ARM_Output.Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TT></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</TT>");
 	        when ARM_Output.Small_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></TT></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Indented_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TT></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Indented_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></TT></UL></UL></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
 	        when ARM_Output.Swiss_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
 	        when ARM_Output.Small_Swiss_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Swiss_Indented_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Swiss_Indented_Examples =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Syntax_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Syntax_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Code_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Code_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Inner_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Inner_Indented =>
-	    	    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Nested_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Nested_X2_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></LI></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Nested_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></LI></UL></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Nested_X2_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></LI></UL></UL></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Indented_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Indented_Nested_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Code_Indented_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Code_Indented_Nested_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL></UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Syntax_Indented_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</LI></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</UL></UL>");
-		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Notes_Bulleted =>
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
+
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted =>
 		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></LI></UL></UL>");
-		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL>");
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</LI>");
+		    -- else nothing to do.
 		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Notes_Nested_Bulleted =>
+	        when ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
 		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></LI></UL></UL></UL>");
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></LI>");
 		    else
-	    	        Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT></UL></UL></UL>");
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</FONT>");
 		    end if;
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Hanging =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</DL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Indented_Hanging =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</DL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Hanging =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Indented_Hanging =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL></UL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Hanging_in_Bulleted =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</DL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Hanging_in_Bulleted =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Enumerated =>
+
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+	             ARM_Output.Enumerated =>
 	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</DL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Enumerated =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Nested_Enumerated =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</DL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
-	        when ARM_Output.Small_Nested_Enumerated =>
-	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL></UL></UL></UL>");
-		    Ada.Text_IO.New_Line (Output_Object.Output_File);
+
+	        when ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+	             ARM_Output.Small_Enumerated =>
+	    	    Ada.Text_IO.Put (Output_Object.Output_File, "</FONT></DL>");
+
 	    end case;
+	    -- Reverse any indents:
+	    for I in reverse 1 .. Output_Object.Paragraph_Indent loop
+	        Ada.Text_IO.Put (Output_Object.Output_File, "</UL>");
+	    end loop;
+	    Ada.Text_IO.New_Line (Output_Object.Output_File, 2);
+
 	elsif Output_Object.HTML_Kind = HTML_4_Only then
-	    case Output_Object.Paragraph_Format is
-	        when ARM_Output.Normal | ARM_Output.Wide |
-	             ARM_Output.Notes | ARM_Output.Notes_Header |
-	             ARM_Output.Annotations | ARM_Output.Wide_Annotations |
-		     ARM_Output.Index | ARM_Output.Syntax_Summary =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Examples | ARM_Output.Small_Examples |
-	             ARM_Output.Indented_Examples | ARM_Output.Small_Indented_Examples |
-	             ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples |
-	             ARM_Output.Swiss_Indented_Examples | ARM_Output.Small_Swiss_Indented_Examples |
-	             ARM_Output.Syntax_Indented | ARM_Output.Small_Syntax_Indented |
-	             ARM_Output.Code_Indented | ARM_Output.Small_Code_Indented |
-	             ARM_Output.Indented | ARM_Output.Small_Indented |
-	             ARM_Output.Inner_Indented | ARM_Output.Small_Inner_Indented =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted | ARM_Output.Nested_X2_Bulleted |
-	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted | ARM_Output.Small_Nested_X2_Bulleted |
-		     ARM_Output.Indented_Bulleted | ARM_Output.Indented_Nested_Bulleted |
-		     ARM_Output.Code_Indented_Bulleted | ARM_Output.Code_Indented_Nested_Bulleted |
-	             ARM_Output.Syntax_Indented_Bulleted |
-	             ARM_Output.Notes_Bulleted | ARM_Output.Notes_Nested_Bulleted =>
-		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</LI>");
-		    -- else null;
-		    end if;
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Hanging | ARM_Output.Indented_Hanging |
-	             ARM_Output.Small_Hanging | ARM_Output.Small_Indented_Hanging |
-		     ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted =>
+	    case Output_Object.Paragraph_Style is
+		when ARM_Output.Normal | ARM_Output.Wide_Above |
+		     ARM_Output.Header |
+		     ARM_Output.Small  | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header |
+	             ARM_Output.Index | ARM_Output.Syntax_Summary |
+	             ARM_Output.Examples | ARM_Output.Swiss_Examples |
+	             ARM_Output.Small_Examples | ARM_Output.Small_Swiss_Examples =>
+		    Put_End_Style (Output_Object.Paragraph_Style,
+				   Output_Object.Paragraph_Indent);
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
+	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
 		    -- We've overridden the style class here.
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</DIV>");
-	        when ARM_Output.Enumerated | ARM_Output.Small_Enumerated |
-	             ARM_Output.Nested_Enumerated | ARM_Output.Small_Nested_Enumerated =>
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</div>");
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+		     ARM_Output.Enumerated |
+	             ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+		     ARM_Output.Small_Enumerated =>
 		    -- We've overridden the style class here.
-		    Ada.Text_IO.Put (Output_Object.Output_File, "</DIV>");
+		    Ada.Text_IO.Put (Output_Object.Output_File, "</div>");
 	    end case;
 	    Ada.Text_IO.New_Line (Output_Object.Output_File);
 	else -- if Output_Object.HTML_Kind = HTML_4_Compatible
-	    case Output_Object.Paragraph_Format is
-	        when ARM_Output.Normal | ARM_Output.Wide |
-	             ARM_Output.Notes | ARM_Output.Notes_Header |
-	             ARM_Output.Annotations | ARM_Output.Wide_Annotations |
-		     ARM_Output.Index | ARM_Output.Syntax_Summary =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Examples | ARM_Output.Small_Examples |
-	             ARM_Output.Indented_Examples | ARM_Output.Small_Indented_Examples |
-	             ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples |
-	             ARM_Output.Swiss_Indented_Examples | ARM_Output.Small_Swiss_Indented_Examples |
-	             ARM_Output.Syntax_Indented | ARM_Output.Small_Syntax_Indented |
-	             ARM_Output.Code_Indented | ARM_Output.Small_Code_Indented |
-	             ARM_Output.Indented | ARM_Output.Small_Indented |
-	             ARM_Output.Inner_Indented | ARM_Output.Small_Inner_Indented =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted | ARM_Output.Nested_X2_Bulleted |
-	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted | ARM_Output.Small_Nested_X2_Bulleted |
-		     ARM_Output.Indented_Bulleted | ARM_Output.Indented_Nested_Bulleted |
-		     ARM_Output.Code_Indented_Bulleted | ARM_Output.Code_Indented_Nested_Bulleted |
-	             ARM_Output.Syntax_Indented_Bulleted |
-	             ARM_Output.Notes_Bulleted | ARM_Output.Notes_Nested_Bulleted =>
-		    Put_End_Compatibility_Font_Info (Output_Object, Output_Object.Paragraph_Format);
+	    case Output_Object.Paragraph_Style is
+		when ARM_Output.Normal | ARM_Output.Wide_Above |
+		     ARM_Output.Header |
+		     ARM_Output.Small  | ARM_Output.Small_Wide_Above |
+		     ARM_Output.Small_Header |
+	             ARM_Output.Index | ARM_Output.Syntax_Summary |
+	             ARM_Output.Examples | ARM_Output.Swiss_Examples |
+	             ARM_Output.Small_Examples | ARM_Output.Small_Swiss_Examples =>
+		    Put_End_Style (Output_Object.Paragraph_Style,
+				   Output_Object.Paragraph_Indent);
+	        when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
+	             ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
+		    Put_End_Compatibility_Font_Info (Output_Object,
+						     Output_Object.Paragraph_Style,
+						     Output_Object.Paragraph_Indent);
 		    if Output_Object.Had_Prefix then
-	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</LI>");
+	    	        Ada.Text_IO.Put (Output_Object.Output_File, "</li>");
 		    -- else null;
 		    end if;
-		    Put_End_Style (Output_Object.Paragraph_Format,
+		    Put_End_Style (Output_Object.Paragraph_Style,
+				   Output_Object.Paragraph_Indent,
 				   Include_Compatibility => False);
-	        when ARM_Output.Hanging | ARM_Output.Indented_Hanging |
-	             ARM_Output.Small_Hanging | ARM_Output.Small_Indented_Hanging |
-		     ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
-	        when ARM_Output.Enumerated | ARM_Output.Small_Enumerated |
-	             ARM_Output.Nested_Enumerated | ARM_Output.Small_Nested_Enumerated =>
-		    Put_End_Style (Output_Object.Paragraph_Format);
+	        when ARM_Output.Wide_Hanging | ARM_Output.Narrow_Hanging |
+		     ARM_Output.Hanging_in_Bulleted |
+		     ARM_Output.Enumerated |
+	             ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
+		     ARM_Output.Small_Hanging_in_Bulleted |
+		     ARM_Output.Small_Enumerated =>
+		    Put_End_Style (Output_Object.Paragraph_Style,
+				   Output_Object.Paragraph_Indent);
 	    end case;
 	    Ada.Text_IO.New_Line (Output_Object.Output_File);
 	end if;
@@ -3471,11 +2420,11 @@
 	function Header_Text return String is
 	begin
 	    if Output_Object.HTML_Kind = HTML_3 then
-		return "<U>" & New_Header_Text & "</U> <S>" & Old_Header_Text & "</S>";
+		return "<U>" & New_Header_Text & "</U><S>" & Old_Header_Text & "</S>";
 	    else
 		Revision_Used(Version) := True;
-		return "<SPAN class=""insert" & Version & """>" & New_Header_Text &
-		  "</SPAN> <SPAN class=""delete" & Version & """>" & Old_Header_Text & "</SPAN>";
+		return "<span class=""insert" & Version & """>" & New_Header_Text &
+		  "</span><span class=""delete" & Version & """>" & Old_Header_Text & "</span>";
 	    end if;
 	end Header_Text;
     begin
@@ -3650,8 +2599,9 @@
 	end if;
 
 	if Output_Object.HTML_Kind /= HTML_3 then
-            Ada.Text_IO.Put (Output_Object.Output_File, "<DIV Class=""SyntaxIndented"">");
-	    Paragraph_Used(ARM_Output.Syntax_Indented) := True;
+            Ada.Text_IO.Put (Output_Object.Output_File, "<div class=""" &
+		Paragraph_Name(ARM_Output.Normal, 1) & """>");
+	    Paragraph_Used(ARM_Output.Normal, 1) := True;
 	end if;
 	if Has_Border then
             Ada.Text_IO.Put (Output_Object.Output_File, "<TABLE frame=""border"" rules=""all"" border=""2"" cellpadding=""4"">");
@@ -3807,7 +2757,7 @@
 	    when ARM_Output.End_Table =>
 		Ada.Text_IO.New_Line (Output_Object.Output_File);
 		if Output_Object.HTML_Kind /= HTML_3 then
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TABLE></DIV>");
+		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</table></div>");
 		else
 		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</TABLE>");
 		end if;
@@ -4305,7 +3255,7 @@
 	-- line does not require the following line to stay with it.
 	-- Raises Not_Valid_Error if the paragraph is not in the index format.
     begin
-	if ARM_Output."/=" (Output_Object.Paragraph_Format, ARM_Output.Index) then
+	if ARM_Output."/=" (Output_Object.Paragraph_Style, ARM_Output.Index) then
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
 		"Not index format");
 	end if;
@@ -4407,7 +3357,7 @@
 	        -- Put in a space.
 	        Output_Text (Output_Object, "&nbsp;");
 	        Output_Object.Disp_Char_Count := Output_Object.Disp_Char_Count + 1;
-	        if ARM_Output."=" (Output_Object.Paragraph_Format, ARM_Output.Syntax_Summary) and then
+	        if ARM_Output."=" (Output_Object.Paragraph_Style, ARM_Output.Syntax_Summary) and then
 		    Output_Object.Column_Count > 1 then
 		    -- Special case (hack!) to make Syntax cross-reference look better:
 	            Output_Text (Output_Object, "&nbsp;&nbsp;");
@@ -4665,8 +3615,8 @@
 
     procedure End_Hang_Item (Output_Object : in out HTML_Output_Type) is
 	-- Marks the end of a hanging item. Call only once per paragraph.
-	-- Raises Not_Valid_Error if the paragraph format is not
-	-- Hanging .. Small_Nested_Enumerated, or if this has already been
+	-- Raises Not_Valid_Error if the paragraph style is not in
+	-- Text_Prefixed_Style_Subtype, or if this has already been
 	-- called for the current paragraph, or if the paragraph was started
 	-- with No_Prefix = True.
     begin
@@ -4678,10 +3628,10 @@
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
 		"Not in paragraph");
 	end if;
-	if Output_Object.Paragraph_Format not in ARM_Output.Hanging ..
-	        ARM_Output.Small_Nested_Enumerated then
+	if Output_Object.Paragraph_Style not in
+	     ARM_Output.Text_Prefixed_Style_Subtype then
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
-		"Not a hanging paragraph - " & ARM_Output.Paragraph_Type'Image(Output_Object.Paragraph_Format));
+		"Not a hanging paragraph - " & ARM_Output.Paragraph_Style_Type'Image(Output_Object.Paragraph_Style));
 	end if;
 	if Output_Object.Saw_Hang_End then
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
@@ -4689,12 +3639,11 @@
 	end if;
 	Output_Object.Saw_Hang_End := True;
 	if Output_Object.HTML_Kind = HTML_3 then
-	    case Output_Object.Paragraph_Format is
+	    case Output_Object.Paragraph_Style is
 	        -- Part of a definition list.
-		when ARM_Output.Small_Hanging |
-		     ARM_Output.Small_Indented_Hanging |
+		when ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Narrow_Hanging |
 		     ARM_Output.Small_Hanging_in_Bulleted |
-		     ARM_Output.Small_Enumerated | ARM_Output.Small_Nested_Enumerated =>
+		     ARM_Output.Small_Enumerated =>
 		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "</FONT><DD><FONT SIZE=-1>");
 		when others =>
 		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD>");
@@ -4729,30 +3678,9 @@
 			   Version => '0',
 			   Added_Version => '0',
 			   Location => ARM_Output.Normal);
-	        case Output_Object.Paragraph_Format is
-		    when ARM_Output.Hanging =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""Hanging-Body"">");
-		    when ARM_Output.Indented_Hanging =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""IndentedHanging-Body"">");
-		    when ARM_Output.Hanging_in_Bulleted =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""HangingInBulleted-Body"">");
-		    when ARM_Output.Small_Hanging=>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""SmallHanging-Body"">");
-		    when ARM_Output.Small_Indented_Hanging =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""SmallIndentedHanging-Body"">");
-		    when ARM_Output.Small_Hanging_in_Bulleted =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""SmallHangingInBulleted-Body"">");
-		    when ARM_Output.Enumerated =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""Enumerated-Body"">");
-		    when ARM_Output.Nested_Enumerated =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""NestedEnumerated-Body"">");
-		    when ARM_Output.Small_Enumerated =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""SmallEnumerated-Body"">");
-		    when ARM_Output.Small_Nested_Enumerated =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV Class=""SmallNestedEnumerated-Body"">");
-		    when others =>
-		        Ada.Text_IO.Put (Output_Object.Output_File, "</DIV><DIV>");
-	        end case;
+		-- This has to be a hanging style, so we ignore other cases:
+	        Ada.Text_IO.Put (Output_Object.Output_File, "</div><div class=""" &
+		    Paragraph_Name (Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent) & "-Body"">");
 	        -- If the prefix is too long, add a <BR>. A "unit" is 2.0 ems;
 	        -- a large character is 0.65 ems; and a small character is 0.4 ems.
 	        -- That should be quite conservative.
@@ -4761,8 +3689,8 @@
 --" Hang_Outdent=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Format).Hang_Outdent));
 	        if (Output_Object.Disp_Large_Char_Count*13) +
 	           ((Output_Object.Disp_Char_Count-Output_Object.Disp_Large_Char_Count)*8) >
-	           Paragraph_Info(Output_Object.Paragraph_Format).Hang_Outdent*40 then
-	            Ada.Text_IO.Put_Line (Output_Object.Output_File, "<BR clear=""left"">");
+	           Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Outdent*40 then
+	            Ada.Text_IO.Put_Line (Output_Object.Output_File, "<br clear=""left"">");
 			-- We use "clear=left" so that the next line always
 			-- starts at the left margin. This shouldn't be necessary,
 			-- but I've seen cases where it was.
@@ -4783,34 +3711,17 @@
 	else -- HTML 4 Compatibility
 	    -- We have to close and reopen the font info here, so that we
 	    -- properly nest these operations to pass the WC3 validator.
-	    Put_End_Compatibility_Font_Info (Output_Object, Output_Object.Paragraph_Format);
-	    case Output_Object.Paragraph_Format is
-		when ARM_Output.Hanging =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""Hanging"">");
-		when ARM_Output.Indented_Hanging =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""IndentedHanging"">");
-		when ARM_Output.Hanging_in_Bulleted =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""HangingInBulleted"">");
-		when ARM_Output.Small_Hanging=>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""SmallHanging"">");
-		when ARM_Output.Small_Indented_Hanging =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""SmallIndentedHanging"">");
-		when ARM_Output.Small_Hanging_in_Bulleted =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""SmallHangingInBulleted"">");
-		when ARM_Output.Enumerated =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""Enumerated"">");
-		when ARM_Output.Nested_Enumerated =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""NestedEnumerated"">");
-		when ARM_Output.Small_Enumerated =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""SmallEnumerated"">");
-		when ARM_Output.Small_Nested_Enumerated =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD Class=""SmallNestedEnumerated"">");
-		when others =>
-		    Ada.Text_IO.Put_Line (Output_Object.Output_File, "<DD>");
-	    end case;
-	    Put_Compatibility_Font_Info (Output_Object, Output_Object.Paragraph_Format);
+	    Put_End_Compatibility_Font_Info (Output_Object,
+			Output_Object.Paragraph_Style,
+			Output_Object.Paragraph_Indent);
+	    -- This has to be a hanging style, so we ignore other cases:
+	    Ada.Text_IO.Put (Output_Object.Output_File, "<dd class=""" &
+		    Paragraph_Name (Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent) & """>");
+	    Put_Compatibility_Font_Info (Output_Object,
+			Output_Object.Paragraph_Style,
+			Output_Object.Paragraph_Indent);
 	end if;
-	Paragraph_Used(Output_Object.Paragraph_Format) := True;
+	Paragraph_Used(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent) := True;
         Output_Object.Char_Count := 0;
 	Output_Object.Disp_Char_Count := 0;
 	Output_Object.Disp_Large_Char_Count := 0;
@@ -5034,8 +3945,8 @@
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "</U>");
 		    else
-		        --Output_Text (Output_Object, "</INS>");
-		        Output_Text (Output_Object, "</SPAN>");
+		        --Output_Text (Output_Object, "</ins>");
+		        Output_Text (Output_Object, "</span>");
 		    end if;
 		    -- Note: We need to follow these with a space so that
 		    -- we don't get words running together for indexing
@@ -5066,18 +3977,18 @@
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "</S>");
 		    else
-		        --Output_Text (Output_Object, "</DEL>");
-		        Output_Text (Output_Object, "</SPAN>");
+		        --Output_Text (Output_Object, "</del>");
+		        Output_Text (Output_Object, "</span>");
 		    end if;
 		when ARM_Output.Both =>
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "</S></U>");
 		    else
-		        --Output_Text (Output_Object, "</DEL></INS>");
-		        --Output_Text (Output_Object, "</SPAN>");
+		        --Output_Text (Output_Object, "</del></ins>");
+		        --Output_Text (Output_Object, "</span>");
 			-- CSS2 doesn't allow multiple decorations in a single definition, so we have
 			-- to nest them. But that might not be right, either (it works on IE).
-		        Output_Text (Output_Object, "</SPAN></SPAN>");
+		        Output_Text (Output_Object, "</span></span>");
 		    end if;
 		    if Output_Object.Last_was_Space then -- See above for reasons for this.
 			null;
@@ -5092,28 +4003,28 @@
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "<U>");
 		    else
-		        --Output_Text (Output_Object, "<INS>");
-		        Output_Text (Output_Object, "<SPAN class=""insert" & Version & """>");
+		        --Output_Text (Output_Object, "<ins>");
+		        Output_Text (Output_Object, "<span class=""insert" & Version & """>");
 			Revision_Used(Version) := True;
 		    end if;
 		when ARM_Output.Deletion =>
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "<S>");
 		    else
-		        --Output_Text (Output_Object, "<DEL>");
-		        Output_Text (Output_Object, "<SPAN class=""delete" & Version & """>");
+		        --Output_Text (Output_Object, "<del>");
+		        Output_Text (Output_Object, "<span class=""delete" & Version & """>");
 			Revision_Used(Version) := True;
 		    end if;
 		when ARM_Output.Both =>
 		    if Output_Object.HTML_Kind = HTML_3 then
 		        Output_Text (Output_Object, "<U><S>");
 		    else
-		        --Output_Text (Output_Object, "<INS><DEL>");
-		        --Output_Text (Output_Object, "<SPAN class=""both" & Version & """>");
+		        --Output_Text (Output_Object, "<ins><del>");
+		        --Output_Text (Output_Object, "<span class=""both" & Version & """>");
 			-- CSS2 doesn't allow multiple decorations in a single definition, so we have
 			-- to nest them. But that might not be right, either (it works on IE).
-		        Output_Text (Output_Object, "<SPAN class=""insert" & Added_Version & """>");
-		        Output_Text (Output_Object, "<SPAN class=""delete" & Version & """>");
+		        Output_Text (Output_Object, "<span class=""insert" & Added_Version & """>");
+		        Output_Text (Output_Object, "<span class=""delete" & Version & """>");
 			Revision_Used(Version) := True;
 		    end if;
 		when ARM_Output.None =>
@@ -5763,7 +4674,7 @@
 		end if;
 		if Output_Object.HTML_Kind = HTML_4_Only then
 		    Output_Text (Output_Object, "<DIV Style=""text-align: left; margin-bottom: ");
-		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal).After * LEADING_PERCENT) / 100);
+		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal, 0).After * LEADING_PERCENT) / 100);
 		    Output_Text (Output_Object, """>");
 		else
 		    Output_Text (Output_Object, "<P>");
@@ -5788,7 +4699,7 @@
 		end if;
 		if Output_Object.HTML_Kind = HTML_4_Only then
 		    Output_Text (Output_Object, "<DIV Style=""text-align: right; margin-bottom: ");
-		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal).After * LEADING_PERCENT) / 100);
+		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal, 0).After * LEADING_PERCENT) / 100);
 		    Output_Text (Output_Object, """>");
 		else
 		    Output_Text (Output_Object, "<RIGHT>");
@@ -5813,7 +4724,7 @@
 		end if;
 		if Output_Object.HTML_Kind = HTML_4_Only then
 		    Output_Text (Output_Object, "<DIV Style=""text-align: center; margin-bottom: ");
-		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal).After * LEADING_PERCENT) / 100);
+		    Put_EMs(Output_Object.Output_File, (Paragraph_Info(ARM_Output.Normal, 0).After * LEADING_PERCENT) / 100);
 		    Output_Text (Output_Object, """>");
 		else
 		    Output_Text (Output_Object, "<CENTER>");
@@ -5833,5 +4744,334 @@
 	        Output_Object.Conditional_Space := False; -- Don't need it here.
 	end case;
     end Picture;
+
+begin
+    -- Define the styles:
+    -- Normal:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Normal, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+    -- Wide_Above:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Wide_Above, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 6,
+		 After => 6);
+    end loop;
+    -- Header:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Header, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 0);
+    end loop;
+    -- Small:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Small, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+    -- Small_Wide_Above:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Small_Wide_Above, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 6,
+		 After => 6);
+    end loop;
+    -- Small Header:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Small_Header, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 0);
+    end loop;
+
+    -- Examples:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Examples, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Fixed,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+    -- Small Examples:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Small_Examples, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Fixed,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+    -- Swiss Examples:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Swiss_Examples, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Swiss,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+    -- Small Swiss Examples:
+    for I in ARM_Output.Paragraph_Indent_Type loop
+	Paragraph_Info(ARM_Output.Small_Swiss_Examples, I) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Swiss,
+		 Indent => Natural(I),
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 6); -- 120
+    end loop;
+
+    -- Bulleted:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Bulleted, I) :=
+		(Defined => True,
+		 Tag  => UL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 1,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 5);
+    end loop;
+    -- Nested Bulleted:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Nested_Bulleted, I) :=
+		(Defined => True,
+		 Tag  => UL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 1,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 5);
+    end loop;
+    -- Small Bulleted:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Bulleted, I) :=
+		(Defined => True,
+		 Tag  => UL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 1,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 5);
+    end loop;
+    -- Small Nested Bulleted:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Nested_Bulleted, I) :=
+		(Defined => True,
+		 Tag  => UL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I),
+		 Right_Indent => 1,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 5);
+    end loop;
+
+    -- Enumerated:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Enumerated, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-1,
+		 Right_Indent => 1,
+		 Hang_Outdent => 1,
+		 Before => 0,
+		 After => 5);
+    end loop;
+    -- Small Enumerated:
+    -- Note: Indent = 0 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Enumerated, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-1,
+		 Right_Indent => 1,
+		 Hang_Outdent => 1,
+		 Before => 0,
+		 After => 5);
+    end loop;
+
+    -- Wide Hanging
+    -- Note: Indent < 3 is not allowed.
+    for I in 3 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Wide_Hanging, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-3,
+		 Right_Indent => 0,
+		 Hang_Outdent => 3,
+		 Before => 0,
+		 After => 6);
+    end loop;
+    -- Small Wide Hanging:
+    -- Note: Indent < 3 is not allowed.
+    for I in 3 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Wide_Hanging, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-3,
+		 Right_Indent => 0,
+		 Hang_Outdent => 3,
+		 Before => 0,
+		 After => 6);
+    end loop;
+    -- Narrow Hanging
+    -- Note: Indent < 1 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Narrow_Hanging, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-1,
+		 Right_Indent => 0,
+		 Hang_Outdent => 1,
+		 Before => 0,
+		 After => 6);
+    end loop;
+    -- Small Narrow Hanging:
+    -- Note: Indent < 1 is not allowed.
+    for I in 1 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Narrow_Hanging, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-1,
+		 Right_Indent => 0,
+		 Hang_Outdent => 1,
+		 Before => 0,
+		 After => 6);
+    end loop;
+    -- Hanging in Bulleted
+    -- Note: Indent < 2 is not allowed.
+    for I in 2 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Hanging_in_Bulleted, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => 0, -- 18
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-2,
+		 Right_Indent => 1,
+		 Hang_Outdent => 2,
+		 Before => 0,
+		 After => 5);
+    end loop;
+    -- Small Hanging in Bulleted
+    -- Note: Indent < 2 is not allowed.
+    for I in 2 .. ARM_Output.Paragraph_Indent_Type'Last loop
+	Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, I) :=
+		(Defined => True,
+		 Tag  => DL,
+		 Size => -1, -- 15
+		 Font => ARM_Output.Default,
+		 Indent => Natural(I)-2,
+		 Right_Indent => 1,
+		 Hang_Outdent => 2,
+		 Before => 0,
+		 After => 5);
+    end loop;
+
+    -- Index. Only define the form that we'll use.
+    Paragraph_Info(ARM_Output.Index, 0) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => 0,
+		 Font => ARM_Output.Default,
+		 Indent => 0,
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 0);
+
+    -- Syntax Summary. Only define the form that we'll use.
+    Paragraph_Info(ARM_Output.Syntax_Summary, 1) :=
+		(Defined => True,
+		 Tag  => DIV,
+		 Size => -1,
+		 Font => ARM_Output.Default,
+		 Indent => 1,
+		 Right_Indent => 0,
+		 Hang_Outdent => 0,
+		 Before => 0,
+		 After => 4);
 
 end ARM_HTML;

Questions? Ask the ACAA Technical Agent