Re: newcommand problem
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
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
LaTeX 近期熱門文章
PTT數位生活區 即時熱門文章