]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fixes in tex production (gdoc)
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 28 Jul 2001 19:02:10 +0000 (19:02 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 28 Jul 2001 19:02:10 +0000 (19:02 +0000)
doc/scripts/gdoc
doc/tex/Makefile.am

index 261c00706d8357054e6905d1ba134f29b3ea2ec8..3816f741d15defb94498ed7281cf3d6c85fb02ae 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved        ##
+##                    hacked to allow -tex option --nmav         ##
 ##                                                               ##
 ## This software falls under the GNU Public License. Please read ##
 ##              the COPYING file for more information            ##
@@ -75,7 +76,8 @@
 
 # match expressions used to find embedded type information
 $type_constant = "\\\%(\\w+)";
-$type_func = "(\\w+\\(\\))";
+#$type_func = "(\\w+\\(\\))";
+$type_func = "(\\(w||\\\\)+\\(\\))";
 $type_param = "\\\@(\\w+)";
 $type_struct = "\\\&(\\w+)";
 $type_env = "(\\\$\\w+)";
@@ -91,10 +93,10 @@ $type_env = "(\\\$\\w+)";
                     $type_param, "<tt><b>\$1</b></tt>" );
 $blankline_html = "<p>";
 
-%highlights_tex = ( $type_constant, "{\\it \$1}",
-                    $type_func, "{\\bf \$1}",
-                    $type_struct, "{\\it \$1}",
-                    $type_param, "{\\bf \$1}" );
+%highlights_tex = ( $type_constant, "{\\\\it \$1}",
+                    $type_func, "{\\\\bf \$1}",
+                    $type_struct, "{\\\\it \$1}",
+                    $type_param, "{\\\\bf \$1}" );
 $blankline_tex = "\\par";
 
 # sgml, docbook format
@@ -273,14 +275,31 @@ sub output_tex {
     my %args = %{$_[0]};
     my ($parameter, $section);
     my $count;
-    print "\n\n\\subsection{". $args{'function'} . "}\n";
+    my $func = $args{'function'};
+    my $param;
+    my $param2;
+    my $sec;
+    my $check;
+    my $type;
 
-    print "{\\it ".$args{'functiontype'}."}\n";
-    print "{\\bf ".$args{'function'}."}\n";
+    $func =~ s/_/\\_/g;
+
+    print "\n\n\\subsection{". $func . "}\n";
+
+    $type = $args{'functiontype'};
+    $type =~ s/_/\\_/g;
+
+    print "{\\it ".$type."}\n";
+    print "{\\bf ".$func."}\n";
     print "(\n";
     $count = 0;
     foreach $parameter (@{$args{'parameterlist'}}) {
-       print "{\\it ".$args{'parametertypes'}{$parameter}."} {\\bf ".$parameter."}\n";
+        $param = $args{'parametertypes'}{$parameter};
+        $param2 = $parameter;
+       $param =~ s/_/\\_/g;
+        $param2 =~ s/_/\\_/g;
+
+       print "{\\it ".$param."} {\\bf ".$param2."}\n";
        if ($count != $#{$args{'parameterlist'}}) {
            $count++;
            print ", ";
@@ -288,18 +307,35 @@ sub output_tex {
     }
     print ")\n";
 
-    print "\n\\large{Arguments}\n";
+    print "\n{\\large{Arguments}}\n";
+
     print "\\begin{itemize}\n";
+    $check=0;
     foreach $parameter (@{$args{'parameterlist'}}) {
-       print "\\item {\\it ".$args{'parametertypes'}{$parameter}."} {\\bf ".$parameter."}\n";
+        $param = $args{'parametertypes'}{$parameter};
+        $param =~ s/_/\\_/g;
+        $param2 = $parameter;
+       $param2 =~ s/_/\\_/g;
+
+       $check = 1;
+       print "\\item {\\it ".$param."} {\\bf ".$param2."}\n";
        print "\n";
-       output_highlight($args{'parameters'}{$parameter});
+
+       output_highlight($param{$parameter});
+    }
+    if ($check==0) {
+       print "\\item void\n";
     }
     print "\\end{itemize}\n";
+
     foreach $section (@{$args{'sectionlist'}}) {
-       print "\\large{$section}\n";
+       print "{\\large{$section}}\n";
        print "\\begin{rmfamily}\n";
-       output_highlight($args{'sections'}{$section});
+
+       $sec = $args{'sections'}{$section};
+       $sec =~ s/_/\\_/g;
+       $sec =~ s/&/\\&/g;
+       output_highlight($sec);
        print "\\end{rmfamily}\n";
     }
     print "\n";
index 612b6e76fc24e0d6b1a466a02542649bf8cd8e65..f87107fb5d8a8076714fc8f982d6c86741eefec9 100644 (file)
@@ -8,8 +8,8 @@ gnutls-api.tex:
        @../scripts/gdoc -tex ../../lib/*.c >> gnutls-api.tex
 
 gnutls.ps: gnutls.tex gnutls-api.tex
-       latex gnutls.tex
-       dvips gnutls.dvi -o gnutls.ps
+       -latex gnutls.tex
+       -dvips gnutls.dvi -o gnutls.ps
 
 gnutls.html: gnutls.tex gnutls-api.tex
-       latex2html gnutls.tex -no_subdir 1 -split 0
+       -latex2html gnutls.tex -no_subdir 1 -split 0