Re: [問題] theorem 的 counter
Hi, I pull out the book "TeX by topic" and study chapter 11 again. This is =
what I came up with.
\def\Ex{\futurelet\testchar\MaybeOptArgEx}
\def\MaybeOptArgEx{\ifx[\testchar \let\next\OptArgEx
\else=20
\let\next\NoOptArgEx=20
\fi=20
\next}
\def\NoOptArgEx#1{
\begin{exercise}
#1\par
\end{exercise}}
\def\OptArgEx[#1]#2{
\begin{exercise}
#2\par
\noindent=E8=A7=A3=E7=AD=94{\bf \theexercise:}\par
#1
\end{exercise}}
\section{Fifth try}
This macro provides an option for solution. This means that the solution mu=
st be surrounded by brackets [...]=20
\Ex{This is only a question without solution given.}
\Ex[A solution goes here]{This has an option for adding a solution.}
An image is attached
http://ppt.cc/0mkp
推
08/12 15:40, , 1F
08/12 15:40, 1F
討論串 (同標題文章)
LaTeX 近期熱門文章
PTT數位生活區 即時熱門文章