Changeset 609ba11 in git


Ignore:
Timestamp:
Jul 9, 1999, 4:12:59 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
34fbd934a748fec8c0dcc9325052eddde20bd10e
Parents:
63374c2a45ce7f0660de1047f95a58b4d23d5055
Message:
* use smallexample for examples


git-svn-id: file:///usr/local/Singular/svn/trunk@3254 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
doc
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • doc/STYLEGUIDE

    r63374c r609ba11  
    145145====================================
    146146
     147* generally use @samllexample for (code) examples
     148
    147149* Die Kommandozeilen in einem Beispiel, das nicht von doc2tex
    148150  gerechnet wird, beginnen NICHT MEHR mit zwei Leerzeichen:
    149 @example
     151@smallexample
    150152ring r;
    151153ideal i=x,y;
    152 @end example
     154@end smallexample
    153155
    154156* Beispiele, die von doc2tex gerechnet werden, muessen weiterhin mit
     
    163165  untersten Zeile des Kommentars stehen (sonst wird in spaeter die
    164166  Singular-Ausgabe zwischen den Kommentar und das Kommando geschoben):
    165 @example
     167@smallexample
    166168@c example
    167169  ring r;
     
    169171  option(prot);  // during the Groebner basis computation.
    170172@c example
    171 @end example
     173@end smallexample
    172174
    173175+ Bei Beispielen, die nicht wirklich von doc2tex gerechnet, muss nach dem
    174176  @expansion ein Leerzeichen kommen, und geschweifte Klammern muessen
    175177  gequoted werden mit @:
    176 @example
     178@smallexample
    177179int i=3;
    178180    // Kommentare ueber mehere Zeilen duerfen natuerlich
     
    180182@{@} // quote von geschweiften Klammern
    181183@expansion{} 3
    182 @end example
     184@end smallexample
    183185
    184186+ Beim Schreiben von Singular-Beispielen (insbesondere von
     
    248250
    249251------------------------------------------------------------
    250 $Id: STYLEGUIDE,v 1.10 1999-07-01 12:47:59 obachman Exp $
     252$Id: STYLEGUIDE,v 1.11 1999-07-09 14:12:46 obachman Exp $
  • doc/doc2tex.pl

    r63374c r609ba11  
    11#!/usr/local/bin/perl
    2 # $Id: doc2tex.pl,v 1.4 1999-07-07 16:38:34 obachman Exp $
     2# $Id: doc2tex.pl,v 1.5 1999-07-09 14:12:47 obachman Exp $
    33###################################################################
    44#  Computer Algebra System SINGULAR
     
    292292        # break after $ex_length characters
    293293        $to_do = $_;
    294         while (length($to_do) > $ex_length)
     294        while (length($to_do) > $ex_length && $to_do =~ /\w/)
    295295        {
    296296          $done .= substr($to_do, 0, $ex_length)."\\\n   ";
     
    570570        {
    571571          print LDOC "\@strong{Example:}\n";
    572           print LDOC "\@example\n\@c example\n";
     572          print LDOC "\@smallexample\n\@c example\n";
    573573          print LDOC $example;
    574           print LDOC "\n\@c example\n\@end example\n";
     574          print LDOC "\n\@c example\n\@end smallexample\n";
    575575        }
    576576        OutRef(\*LDOC, $ref) if $ref;
     
    639639sub FormatInfoText
    640640{
    641   s/^\s*//; # remove whitespaces from beginning and end
    642   s/\s*$//;
    643   s/ +/ /g;  # replace double whitespeces by one
    644   &protect_texi; # protect texinfo special chars
    645   s/\n/\n\@*/g; # replace newline by forced newline
     641  my $length = shift;
     642  $length = 0 unless $length;
     643  # insert @* infront of all lines whose previous line is shorter than
     644  # 60 characters
     645  $_ = ' ' x $length . $_;
     646  if (/^(.*)\n/)
     647  {
     648    $_ .= "\n";
     649    my $pline;
     650    my $line;
     651    my $ptext = $_;
     652    my $text = '';
     653    while ($ptext =~ /(.*)\n/g)
     654    {
     655      $line = $1;
     656      $text .= '@*'
     657        if ($line =~ /\w/ && $pline =~ /\w/ &&
     658            ((length($pline) < 60) || $line =~ /^\s*\w\(.*?\)/));
     659      $line =~ s/\s*$//;
     660      $text .= "$line\n";
     661      $pline = $line;
     662    }
     663    $_ = $text;
     664  }
     665  s/\t/ /g;
     666  s/\n +/\n/g;
     667  s/\s*$//g;
     668  s/ +/ /g;  # replace double whitespaces by one
     669  s/\@\*\s*/\@\*/g;
     670  s/(\@[^\*])/\@$1/g; # escape @ signs, except @*
     671  s/{/\@{/g;
     672  s/}/\@}/g;
    646673}
    647674
     
    678705    if ($l_fun)
    679706    {
    680       print $FH "\@strong{$item}\n\@menu\n";
     707      print $FH "\@strong{$item:}\n\@menu\n";
    681708    }
    682709    else
    683710    {
    684       print $FH "\@item \@strong{$item}\n\@table \@asis\n";
     711      print $FH "\@item \@strong{$item:}\n\@table \@asis\n";
    685712    }
    686713    while ($text =~ /(.*\n)/g)
     
    725752  {
    726753    # just print the text
    727     &FormatInfoText;
     754    FormatInfoText(length($item) + 1);
    728755    # if functions are in text, then make it in code
    729756    s/(\w+\(.*?\))/\@code{$1}/g
     
    741768  s/^[;\s]*//;
    742769  s/\n/ /g;
    743   &FormatInfoText;
     770  FormatInfoText();
    744771 
    745772  if ($l_fun)
     
    790817  # erase EXAMPLE, echo and pause statements
    791818  $example =~ s/"EXAMPLE.*"[^;]*;//g;
    792   $example =~ s/echo[^;\n]*;//g;
    793   $example =~ s/pause\(.*?\)[^;]*;//g;
     819  $example .= "\n";
     820  my ($mexample, $line);
     821  while ($example =~ m/(.*)\n/g)
     822  {
     823    $line = $1;
     824    $line =~ s|echo[^;]*;||g if $line !~ m|(.*)//(.*)echo[^;]*;|;
     825    $line =~ s|pause\(.*?\)[^;]*;||g if $line !~ m|(.*)//(.*)pause\(.*?\)[^;]*;|;
     826    $mexample .= "$line\n";
     827  }
     828  $example = $mexample;
    794829 
    795830  # prepend LIB command
Note: See TracChangeset for help on using the changeset viewer.