[OS X TeX] Wrapping and formatting paragraphs in Texshop (and other misc.)

Herb Schulz herbs at wideopenwest.com
Fri Jan 14 22:15:20 EST 2005


On 1/14/05 9:58 AM, "mark oilcan" <markoilcan at yahoo.com> wrote:

> 
> Oops. Sorry, I had removed a couple of critical parts when I was using
> the  script to test a couple of things. Here's the correct version
> which works as advertised. Thanks for the feedback.
> 
> Mark A
> 
> #! /usr/bin/perl -i.bak
> 
> # Edit a file so that long lines are wrapped. By default the wrapping
> # occurs at column (ie character) 74, but can be set to N by using the
> # -c N command line argument.
> 
> use Getopt::Std;
> use Text::Wrap;
> 
> if ( getopts('c:') ) {
> $col = $opt_c;
> $col = 74 unless ($col);
> $Text::Wrap::columns = $col;
> 
> while(<>) {
>   $line = $line . $_
> }
> open(OUTFL, ">$ARGV");
> print OUTFL wrap("\n","",$line);
> }
> else {
> print "Usage: $0 [-c wrapcol] file.\n";
> }
> 

Howdy,

Thanks again. Yes, it does work as advertised! Perl can certainly be obscure
and is always magic!!!

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list