看板 LaTeX 關於我們 聯絡資訊
LaTeX=E6=96=BC 2013=E5=B9=B48=E6=9C=883=E6=97=A5=E6=98=9F=E6=9C=9F=E5=85=AD= UTC+8=E4=B8=8A=E5=8D=881=E6=99=8214=E5=88=8637=E7=A7=92=E5=AF=AB=E9=81=93= =EF=BC=9A > Does this help? >=20 >=20 >=20 > http://tex.stackexchange.com/questions/97343/includegraphics-optional-arg= ument-not-resolved-if-macro With that in mind, A macro with 3 variables are possible \usepackage{graphicx} \newcommand{\scalefactor}{1} % define a command \newcommand\insertfig[3]{ \renewcommand\scalefactor{#3}% renew the command \begin{figure}[!hbt] \centering \includegraphics[scale=3D\scalefactor]{#2} \caption{#1} \label{Fig:#2} \end{figure} } \insertfig{test0.5}{logo}{0.5} Figure \ref{Fig:logo} is shown above \insertfig{test1}{logo1}{1} Figure \ref{Fig:logo1} is shown above \insertfig{test2}{logo2}{2} Figure \ref{Fig:logo2} is shown above
kenny2963:好聰明的方法,我再試試看,感謝! 08/03 11:42