So imagine you have a certain code which looks like this:
ABC, some text , LaLaLa
\tooltip*{A}{\includegraphics[scale=2]{images/A}}\tooltip*{B}{\includegraphics[scale=2]{images/B}}\tooltip*{C}{\includegraphics[scale=2]{images/C}}
Now note that the contents of the first {argument} of \tooltip
re-appears in the {argument} of \includegraphics
.
Now, in this case I manually input the A and B and C of the \includegraphics
, to match with the A and B and C of \tooltip
. But what if we would like to find a way for Tex to do this automatically?
Or even better, what if you would like to find a way to create an environment in which the end-user only has to type:
ABC
to automatically reproduce the first code?
I guess this could be done using regex, so how could you do it in a LaTeX way?
==DEFINITIONS==
What is meant by Tooltip here, can be found explained in this answer.
\tooltip
lines?A,B,C,D
use a comma-separated list (l3clist) and just use a map function to give you tooltip and image...ABCD