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

Herb Schulz herbs at wideopenwest.com
Fri Jan 14 11:05:43 EST 2005


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

> 
> --- Herb Schulz <herbs at wideopenwest.com> wrote:
> 
>> 
>> Howdy,
>> 
>> This would be quite handy. It seems to output to stdout though; the
>> new
>> file.tex.bak is indeed the original file.tex but the new file.tex is
>> empty
>> and the (wrapped?) contents seems to scroll by on the screen.
>> 
> 
> 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 for the fix! I'll try it out soon. I still think I'll play with it a
bit and try to make a Droplet version for GUI use.

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