Auto-detecting the presence or absence of floats might get messed up if the user is in the habit of deleting the aux files compulsively. (You'd be surprised how common this obsession is...) I would therefore like to suggest you take a different approach: provide three documentclass-level options:
noalgorithms, to be specified by the user him/herself. If these options are specified, no list of figures, no list of tables, and no list of algorithms, respectively, is generated.
The following code should illustrate this suggestion in more detail. It sets up both a document class file called
myclass.cls (you're obviously free to choose a more imaginative name!), which sets up the new options and then invokes the
report class, as well as a sample user
.tex file that employs the
myclass document class.
Addendum: On @Werner's suggestion, I've added code for three user-level macros:
\noalgorithms. They may be inserted by the user in the preamble, as an alternative to providing the corresponding options at the
First, the code for the class file (to be saved as
% define three new documentclass-level options
% provide three user commands: \nofigures, \notables, \noalgorithms
% (to be used as an alternative to setting documentclass-level options)
% load any and all other default packages
\maketitle % or, likely, something far more elaborate
Second, a sample user document. Note that if all three of the new documentclass options --
noalgorithms -- are specified, no lists of figures, tables, and algorithms are created.