I am trying to make adjustments to a large document that uses TeX-style macros, like this:
{\defun SomeFunctionName arg1 arg2}
The \defun
macro is defined as \newcommand{\defun}{\tt}
.
Can I adjust this definition to retrieve the SomeFunctionName arg1 arg2
part as an argument, to allow for a more complex definition? Fox example, if defun
was a proper LaTeX macro, I could put a box around the text, or put something before and after, etc.
Minimal example:
\documentclass{article}
\newcommand{\defun}{\tt}
\begin{document}
\section{\defun SomeFunctionName arg1 arg2}
Call {\defun SomeFunctionName} to foo the bar.
\end{document}
How could I (for example) add some text before and after every invocation of defun
? What is the general approach to handle the contents of {\defun ...}
as an argument, short of editing all occurences?
To clarify: this is a large, two decades old document. I didn't write it.