Re: newcommand problem

看板LaTeX (論文排版)作者時間12年前 (2013/08/03 02:01), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
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

08/03 11:42, , 1F
好聰明的方法,我再試試看,感謝!
08/03 11:42, 1F
文章代碼(AID): #1H-_FcVs (LaTeX)
討論串 (同標題文章)
文章代碼(AID): #1H-_FcVs (LaTeX)