home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 45
/
Amiga_Dream_45.iso
/
Amiga
/
Magazine
/
Dossier-LaTeX
/
TeXClean.lha
/
TeXClean.doc
< prev
Wrap
Text File
|
1993-03-28
|
5KB
|
159 lines
TeXClean: Delete all files generated by TeX.
(Does not delete ".tex" files.)
Author: Daniel J. Barrett
E-mail: barrett@cs.umass.edu
Status: Public Domain. Do whatever you want with this program.
Testing: Any program that deletes files must be thoroughly tested.
I have been running this program regularly for over a year,
with no problems whatsoever.
Source code is included so you can tailor this program to your
own needs.
ABOUT THE PROGRAM
TeXClean is a simple little program for deleting files generated
by TeX or LaTeX. Such files have names that end with dvi, aux, log, bbl,
and so on. It also deletes commonly-named temporary files like mfput.log
and texput.log.
SOME VOCABULARY BEFORE WE START
Given a filename like "myfile.tex", I am going to be talking about
two parts of the filename:
The "root name": the part before the dot (e.g., "myfile").
The "extension": the part after (and including) the dot
(e.g., ".tex").
USING TEXCLEAN
TeX and LaTeX generate all kinds of files: dvi files, aux files,
etc. It is a pain to delete these by hand when you are done with them,
especially since you do NOT want to delete the ".tex" file. TeXClean deletes
those files -- and ONLY those files -- generated by TeX/LaTeX from your
".tex" file.
Usage is:
1> texclean file1 file2 file3 ...
You may list as many filenames as you like. A filename may be:
o The name of a ".tex" file:
1> texclean myfile.tex
o The root name of a ".tex" file:
1> texclean myfile
o The name of ANY file generated by TeX:
1> texclean myfile.aux
No matter which of these forms you use, the results are IDENTICAL. TeXClean
deletes ALL the TeX-generated files associated with the root name (in this
case, "myfile").
** NOTE: IT IS IMPOSSIBLE TO DELETE THE ".tex" FILE USING TEXCLEAN **
SO, WHICH FILES GET DELETED?
Simply type:
1> texclean
or
1> texclean ?
to get a usage message, and a list of all file extensions which TeXClean
considers "deletable" files. DO THIS NOW do you know which files will
be deleted.
==========
At this point, I've said everything you "need" to know about using
TeXClean. The following information may be useful to people who are using
alternate shells; you can skip it unless you want to learn a few tricks.
USING TEXCLEAN WITH A SHELL THAT UNDERSTANDS WILDCARDS
As I said above, TeXClean essentially ignores any suffixes that
you give on the command line and deletes files associated with the root
name. This is useful if you have a shell that allows wildcards. (TeXClean
itself does not support Amiga wildcards/pattern matching.)
You can type (for example):
1> texclean #?.dvi
and this will delete all TeX-generated files (NOT JUST THE dvi FILES!)
associated with the root names of the dvi files. For example, suppose
your directory contained:
file1.tex file2.tex file3.tex
file1.aux file2.aux file3.aux
file1.log file2.log file3.log
file1.dvi file2.dvi file3.dvi
If you type (assuming your shell supports standard Amiga wildcards):
1> texclean #?.dvi
it will delete all these files except file1.tex, file2.tex, and file3.tex.
As a further example, ALL of the following commands will have the
same effect as the one in the example above:
1> texclean #?.log
1> texclean #?.tex
1> texclean file1 file2 file3
1> texclean file1 file2.log file3.dvi
1> texclean file1.tex file?.dvi
Now, you might think that this program behavior is strange. For
instance, if the user types:
1> texclean #?.dvi
shouldn't TeXClean just delete the dvi files? Well, if you want that
behavior, just use the standard Delete command!!!
1> delete #?.dvi
TeXClean does it differently because Delete already gives you that
capability. The purpose of TeXClean is to delete *all* TeX-generated
files in one quick command.
WHAT TO DO IF YOUR SHELL DOES NOT UNDERSTAND WILDCARDS
You can achieve similar results to those in the previous section
using the "List" command with the QUICK and NOHEAD options, combined with
the backtick. (You must be running AmigaDOS 2.0 or higher for this.)
For example:
1> texclean `list quick nohead #?.dvi`
I'm not going to take the time to explain this; see your AmigaDOS and Shell
documentation for more information on what this command is doing.
USING TEXCLEAN WITH WSHELL 2.0
I use the following handy macro in S:Config-FComp for filename
completion of texclean commands:
COMMAND texclean PAT "#?.dvi" FMT "%f%r0%l %r1%l %r2%l %r3%l %r4%l %r5%l"
This matches files ending with ".dvi" and strips off the suffix, and
matches up to 5 different files at once.