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

Herb Schulz herbs at wideopenwest.com
Thu Jan 13 18:00:42 CET 2005


On 1/13/05 10:21 AM, "mark oilcan" <markoilcan at yahoo.com> wrote:

> ...
> #! /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 . $_
> }
> print wrap("\n","",$line);
> }
> else {
> print "Usage: $0 [-c wrapcol] file.\n";
> }
> ...

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.

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 macostex-archives mailing list