I have atm1.tex which used to compile ok. It hasn't changed since last time I compiled it, but its base classes have changed:
! LaTeX Error: Command \text already defined.
Or name \end... illegal, see p.192 of the manual.
How can I find where \text was already defined?
atm1.tex contains:
\documentclass[a4paper]{atm}
...
\begin{checklist} % Makes a table where we can add \text, \result, or \action lines
\text{This line contains text}
...
atm.cls contains:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{atm}[acceptance test manual template]
\LoadClass{simdoc}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{simdoc}}
\ProcessOptions\relax
\RequirePackage{textcomp} % Allows use of degree symbol
\RequirePackage[clock]{ifsym} % Brings in \StopWatchStart
...
\newcommand{\text}[1]{& #1 & &\}
...
and simdoc.cls contains:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{simdoc}[Sim International document template]
\LoadClass{report}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
\RequirePackage[margin=3cm]{geometry}
\RequirePackage{longtable,array}
\RequirePackage{titlesec}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{colortbl}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
\RequirePackage{etoolbox}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{textcomp, booktabs}
\RequirePackage{url}
\RequirePackage{xparse}
\RequirePackage{caption}
\RequirePackage{xcolor}
\RequirePackage{soul}
\RequirePackage [most]{tcolorbox}
\tcbuselibrary{skins}
\usepackage[toc,page]{appendix}
...
Clearly \text is defined in atm1.cls, and that's the only one I expected would exist. I suspect someone added a new \RequirePackage to simdoc.cls which introduces a new definition for \text. I could rename \text to something else, but I have hundreds of documents which inherit from this class (all broken) and thousands of uses of \text, so I'd rather not change all of them.
I tried changing \newcommand{\text} to \providecommand{\text}. It compiles, but it doesn't seem to use atm.cls's definition of \text (instead of a \text{Hello} taking up a line in the table, it overlaps the next line of the table).
I also tried: \let\text\undefined\newcommand{\text}.... This works, but is it safe? I'm scared about unintended consequences.
If the above idea is not safe, then my question is "how do I know which \RequirePackage defined \text?". Knowing this will help me search for alternatives.

\textis defined inamsmath, I'd strongly recommend not to redefine it. – May 17 '21 at 06:55\textwas defined inamsmathby memory, or did you figure this out so quickly with a command or search? – Stewart May 17 '21 at 06:57\span, hardly anyone knows what it is used for, so it would be obvious to redefine it to be\operatorname{span}if you're writing about linear algebra. If you do that tables, matrices, align, etc no longer works.\texthas been inamstextwhich is loaded byamsmathfor many many years. The only way this has been able to compile is ifamsmathhas never been used. – daleif May 17 '21 at 07:06\newenvironment{checklist}which defines a table. Then these commands are meant for use within that table. The table is pretty fundamental for the hundreds of documents which use this class. If I want to add a signature column to the table or prefix a reference number, I just have to change the class instead of the hundreds of documents. That's exactly what a class is for isn't it? – Stewart May 17 '21 at 07:29\textwas already defined? and the other (not so explicitly stated) (b) What to do with those hundreds of documents which inherit from this class (all broken) and thousands of uses of \text ? ░░░ The second one could be done with a global file(s) replace using an utility likesedon Linux. The first one was posted here, ...but probably thisgrepcommand could be the best way out ! – Partha D. May 17 '21 at 07:31