4

Is it possible to avoid excessive use of the symbol $ in pictures containing a lot of formulas/math symbols? I mean to use \put(m,n}{math} instead of \put(m,n}{$math$}.

1

1 Answer 1

7

You may define a new command:

\documentclass{article}

% define new command that includes the $ signs
\def\mput(#1)#2{\put(#1){$#2$}}

\begin{document}
    %example
    \begin{picture}(10,10)
        \put(0,10){$a^1$}
        \mput(0,0){a^2}
    \end{picture}


\end{document}

result:

result 1

If you would like to replace the put command you can do this

\documentclass{article}

%let \putOld be the same definition as \put
\let\putOld\put
%use \putOld to redefine the original put command
\def\put(#1)#2{\putOld(#1){$#2$}}

\begin{document}
    %example
    \begin{picture}(10,10)
        \putOld(0,10){$a^1$}
        \put(0,0){a^2}
    \end{picture}


\end{document}

result:

result 2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .