diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-16 00:19:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-16 00:19:13 +0000 |
commit | bab45528d65eaafe68a705dbb2a57075c7b7cbd8 (patch) | |
tree | 10b4ae2b5195c8dede153ab89359ec00f55f325f /Build/source/utils/asymptote/doc/FAQ/m-post.pl | |
parent | 8643d90372e9c31e0f461c15c596b60a545bd7d3 (diff) |
asymptote 1.72 sources (not integrated into build yet)
git-svn-id: svn://tug.org/texlive/trunk@13110 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/doc/FAQ/m-post.pl')
-rw-r--r-- | Build/source/utils/asymptote/doc/FAQ/m-post.pl | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-post.pl b/Build/source/utils/asymptote/doc/FAQ/m-post.pl new file mode 100644 index 00000000000..e41c8d84fe4 --- /dev/null +++ b/Build/source/utils/asymptote/doc/FAQ/m-post.pl @@ -0,0 +1,189 @@ +## POST output +# Copyright (C) 1993-1995 Ian Jackson. + +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# (Note: I do not consider works produced using these BFNN processing +# tools to be derivative works of the tools, so they are NOT covered +# by the GPL. However, I would appreciate it if you credited me if +# appropriate in any documents you format using BFNN.) + +sub post_init { + open(POST,">$prefix.post"); +} + +sub post_startmajorheading { + print POST '='x79,"\n\n"; + $post_status= 'h'; + &post_text($_[0] ? "Section $_[0]. " : ''); +} + +sub post_startminorheading { + print POST '-'x77,"\n\n"; + $post_status= 'h'; +} + +sub post_italic { &post_text('*'); } +sub post_enditalic { $post_para .= '*'; } + +sub post_email { &post_text('<'); } sub post_endemail { &post_text('>'); } + +sub post_ftpon { } sub post_endftpon { } +sub post_ftpin { } sub post_endftpin { } +sub post_docref { } sub post_enddocref { } +sub post_courier { } sub post_endcourier { } +sub post_newsgroup { } sub post_endnewsgroup { } +sub post_ftpsilent { $post_ignore++; } +sub post_endftpsilent { $post_ignore--; } + +sub post_text { + return if $post_ignore; + if ($post_status eq '') { + $post_status= 'p'; + } + $post_para .= $_[0]; +} + +sub post_tab { + local ($n) = $_[0]-length($post_para); + $post_para .= ' 'x$n if $n>0; +} + +sub post_newline { + return unless $post_status eq 'p'; + &post_writepara; +} + +sub post_writepara { + local ($thisline, $thisword, $rest); + for (;;) { + last unless $post_para =~ m/\S/; + $thisline= $post_indentstring; + for (;;) { + last unless $post_para =~ m/^(\s*\S+)/; + unless (length($1) + length($thisline) < 75 || + length($thisline) == length($post_indentstring)) { + last; + } + $thisline .= $1; + $post_para= $'; + } + $post_para =~ s/^\s*//; + print POST $thisline,"\n"; + $post_indentstring= $post_nextindent; + last unless length($post_para); + } + $post_status= ''; $post_para= ''; +} + +sub post_endpara { + return unless $post_status eq 'p'; + &post_writepara; + print POST "\n"; +} + +sub post_endheading { + $post_para =~ s/\s*$//; + print POST "$post_para\n\n"; + $post_status= ''; + $post_para= ''; +} + +sub post_endmajorheading { &post_endheading(@_); } +sub post_endminorheading { &post_endheading(@_); } + +sub post_startverbatim { + $post_vstatus= $post_status; + &post_writepara; +} + +sub post_verbatim { + print POST $_[0],"\n"; +} + +sub post_endverbatim { + $post_status= $post_vstatus; +} + +sub post_finish { + close(POST); +} + +sub post_startindex { $post_status= ''; } +sub post_endindex { $post_status= 'p'; } + +sub post_endindexitem { + printf POST " %-11s %-.66s\n",$post_left,$post_para; + $post_status= 'p'; + $post_para= ''; +} + +sub post_startindexitem { + $post_left= $_[1]; +} + +sub post_startindexmainitem { + $post_left= $_[1]; + print POST "\n" if $post_status eq 'p'; +} + +sub post_startindent { + $post_istatus= $post_status; + &post_writepara; + $post_indentstring= " $post_indentstring"; + $post_nextindent= " $post_nextindent"; +} + +sub post_endindent { + $post_indentstring =~ s/^ //; + $post_nextindent =~ s/^ //; + $post_status= $post_istatus; +} + +sub post_startpackedlist { $post_plc=0; } +sub post_endpackedlist { &post_newline if !$post_plc; } +sub post_packeditem { + &post_newline if !$post_plc; + &post_tab($post_plc*40+5); + $post_plc= !$post_plc; +} + +sub post_startlist { + &post_endpara; + $post_indentstring= " $post_indentstring"; + $post_nextindent= " $post_nextindent"; +} + +sub post_endlist { + &post_endpara; + $post_indentstring =~ s/^ //; + $post_nextindent =~ s/^ //; +} + +sub post_item { + &post_newline; + $post_indentstring =~ s/ $/* /; +} + +sub post_pageref { + &post_text("Q$_[1] \`"); +} + +sub post_endpageref { + &post_text("'"); +} + +1; |