I have this LaTeX
code:
\begin{enumerate}[a]
\affiliation{...}
\affiliation{...}
\affiliation{...}
...
\affiliation{...}
\end{enumerate}
and, using a script written in Emacs Lisp, I want to obtain:
\affiliation[a]{...}
\affiliation[b]{...}
...
\affiliation[n]{...}
I started from the following code thinking I could change it 'quite easily' in order to resolve my problem, but I failed.
Here it is my code:
(perform-replace "\\\\affiliation{"
`((lambda (data count)
(concat "\\\\affiliation{"(number-to-string (+ 1 count))"}"))) nil t nil 1 nil a z)
How can I modify number-to-string
to obtain lowercase letters instead of numbers?
A note: \begin{enumerate}[a]
could be absent, so first occurence of \affiliation{...}
is replaced using the following code:
(perform-replace "\\\\begin{enumerate}\\[a\\]\n\n\\\\affiliation{" "\n\n\\\\affiliation[a]{" t t nil 1 nil a z)