I am having some user defined commands defined and used in my latex document. I need a way to check whether any of the commands is used. I want to make decisions based on the argument used in the command. Can I do this by defining a user defined environment? Please let me know what should be done here.
Example code:
\documentclass[12pt]{article}
\usepackage{ulem}
\usepackage{color}
\newcommand{\deleteline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{red}{\sout{#2}}}
\title{Latex Document}
\author{Eddy}
\begin{document}
\maketitle
As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.}
I want to find out programmatically if \deleteline command is used in the content. I also want to find out what's the first argument used.
Edit: I am going to add a detailed use case of my current requirement.
My input code is as follows. Please note that \begin{analyze}{eddy} is the new environment that is to be defined yet.
\documentclass[12pt]{article}
\usepackage{ulem}
\usepackage{color}
\newcommand{\deleteline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{red}{\sout{#2}}}
\newcommand{\addline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{green}{#2}}
\title{Latex Document}
\author{Eddy}
\begin{document}
\maketitle
\begin{analyze}
As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}
\end{analyze}
\end{document}
If no argument is passed to the new environment,
\begin{analyze}
As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}
\end{analyze}
Output: All changes done by all users are taken into consideration

If 'eddy' is given as an input,
\begin{analyze}{eddy}
As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}
\end{analyze}
Output: Only changes by done by Eddy is considered. Other users changes are ignored.

\begin{analyze}{Margret}
As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}
\end{analyze}
Output: Only changes done by Margret is considered. All other changes are ignored.





\documentclass{...}and ending with\end{document}. – Paul Gaborit Feb 20 '13 at 06:58ctrl+f... – Thanos Feb 20 '13 at 07:23\@firstoftwo. You will find you are not. However, you are. As well, good typesetter splits his document into several files if it's long. – yo' Feb 20 '13 at 07:41/pattern, and in good editors, byC-s stringorC-u C-s regex. :P – mbork Feb 20 '13 at 22:34\deletelineand\addlinethat you need to track, I think you'd be better off defining a command that takes key-vluae\adddeteline[action=delete,name=Eddie]{<content>}. Right now I can't really write anything more, but (provided someone else doesn't already beat me to it) I might be able to put something together like this later tonight. – A.Ellett Feb 20 '13 at 22:47changespackage already does this in a very convenient fashion. – percusse Feb 21 '13 at 13:44