We are preparing an audiobook transcript for a complex book that has many tables and figures. We have created a macro called \print{} for text that only appears in the printed book and another one \audio{} that only appears in the audiobook. That all works.
We have done a lot of \renewcommand things to turn off lots of special formatting.
I am looking for a solution that will allow us to specify alternative text for figures and tables and have them suppressed and have the alternative text appear. It is okay if the alternative text appears in the precise point where we defined the float, but it would be better if it defined a new command that we could then put where we wished.
Any thoughts on how to do this? I tried \renewenvironment but couldn't figure out how to turn off printing within the environment. Turning it into a comment environment didn't work.
EDIT
For example, here is a simple document:
\documentclass{article}
\newcommand{\audio}[1]{}
%% INSERT SOMETHING HERE TO MAKE THE {figure} disappear.
\begin{document}
The first paragraph.
\audio{This is the alternative text for the figure below.}
\begin{figure}
This is a figure.
\caption{This is the caption.}
\end{figure}
The second paragraph.
\end{document}
What can I insert at the comment to make the {figure} not print?

commentenvironment didn't work." What exactly did you try, and which error and/or warning messages (if any) did you get? – Mico Mar 19 '22 at 11:15endfloatworks - it puts all the floats at the end with a[figure 8 about here]at the definition point. Maybe a good starting point... – Rmano Mar 19 '22 at 12:52