Re: [問題] theorem 的 counter

看板LaTeX (論文排版)作者時間12年前 (2013/08/11 10:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/8 (看更多)
How about this \begin{document} \newtheorem{exercise}{=E4=BD=9C=E6=A5=AD}[section] \newtheorem{answer}{=E8=A7=A3}[exercise] \section{Old method} \begin{exercise} Old question \end{exercise} \begin{answer} Old answer \end{answer} \section{Second try} \renewcommand{\theanswer}{\theexercise} \begin{exercise} Old question \end{exercise} \begin{answer} Old answer \end{answer} Hmmm, two separate environment are not desired. \section{Third try} A single environment with imbedded wordings. \begin{exercise} Question goes here. ..... {\noindent \bf =E4=BD=9C=E6=A5=AD \theexercise =E8=A7=A3 \par} Solution goes here. \end{exercise} \section{Fourth try} Here we define a newenvironment with 2 inputs,=20 one for question and one for the solution. \newenvironment{exwsol}[2] {\begin{exercise} #1\par \noindent=E8=A7=A3=E7=AD=94{\bf \theexercise:}\par #2 } {\end{exercise}} Then give an example displayed below \begin{exwsol} {Question goes here.} {Solution goes here.} \end{exwsol} \end{document} An image is attached. http://ppt.cc/5R-6
文章代碼(AID): #1I1lUY2L (LaTeX)
文章代碼(AID): #1I1lUY2L (LaTeX)