$NetBSD: patch-aa,v 1.1 2005/09/05 20:38:03 rillig Exp $

- Inside environments, leading and trailing newlines are removed
  (useful for <pre>).
- <h4> is translated to \paragraph.
- <h5> is translated to \subparagraph.
- <hr> is translated to a proper horizontal line.
  \hline only works in tables.

--- Latex.pm.orig	Mon Sep 25 05:35:05 2000
+++ Latex.pm	Mon Sep  5 22:29:27 2005
@@ -828,8 +828,11 @@ sub other_handler{
 # Latex output form: \begin{tex} Bar \end{tex}
 sub environment_handler{
     my($html_element,$environment) = @_;
-    return '\begin{' . $environment . '}' . "\n" . 
-	texify($html_element) . "\n" . '\end{' .  $environment . '}' . "\n";
+    my ($element);
+
+    ($element = texify($html_element)) =~ s,^\n*(.*?)\n*$,$1,s;
+
+    return "\n\\begin{$environment}\n${element}\n\\end{$environment}\n";
 }
 
 # HTML input form: <FOO> Bar (implicit end)
@@ -1386,16 +1389,16 @@ HTML::Latex under the section "CONFIGURA
         <tex>subsubsection*</tex>
     </tag>
     <tag name="h4" type="command">
-        <tex>textbf</tex>
+        <tex>paragraph</tex>
     </tag>
     <tag name="h5" type="command">
-        <tex>textbf</tex>
+        <tex>subparagraph</tex>
     </tag>
     <tag name="h6" type="command">
         <tex>textbf</tex>
     </tag>
     <tag name="hr" type="single">
-        <tex>\hline</tex>
+        <tex>\par \vskip 1em \vskip -0.4pt \hrule width \linewidth height 0.4pt depth 0.0pt \vskip 1em \par</tex>
     </tag>
     <tag name="i" type="command">
         <tex>emph</tex>
