% This is an example of typesetting a book.
% The book is:
% 吳聰敏:《總體經濟學》, 2000年9月出版.
% 翰蘆圖書公司發行。
%
% Currently, I do not have time to add comments.
% But everything is explained in cwTeX manual, 2nd ed,
% except titletoc.sty, which is part of titlesec.sty.
% You have to read the document of titlesec package.
%
% Note that you have to run latex 3 times in order to
% get the table of contents.
%
% Since the first 2 chapters of the book refer to later
% chapters, you would get some warning messages, and there
% would be some "?" signs in the book. Hopefully, that would
% not affect the usefulness of the examples.
%
% Index is produced by maindex.ctx.  If you want to konw
% how to produce maindex.ctx, please
% read cwTeX manual, 2nd ed.
%
%
% If you have any question, please give me a note.
%
%
% Tsong-Min Wu
% 2000.9.14


% master file for Macro course
%
\input{ma-macro}
\renewcommand{\figurename}{\r11 圖\hspace*{-.5mm}}
\renewcommand{\tablename}{\r11 表\hspace*{-.5mm}}
\renewcommand{\contentsname}{\f20 目錄}
\renewcommand{\indexname}{\f20 索引}


% \hoffset=1cm \voffset=6cm  % for 2-up -- tmwu
\hoffset=2cm \voffset=3cm  % for 1-up

\ctxfdef{\chapter}[\f12]{\f20}
\ctxfdef{\section}[\m11.5]{\bb14}
\ctxfdef{\subsection}[\m11]{\bb12}
\ctxfdef{\subsubsection}[\m11]{\k12}
\ctxfdef{\paragraph}[\m11]{\k12}
\ctxfdef{\footnote}{\m10}
\ctxfdef{\caption}{\r11.5}

\newenvironment{summary}
{\setcounter{secnumdepth}{0}
  \fancyfoot[RO]{{\m11 摘要}\rule{5mm}{0pt}$\cdot$~\thepage~$\cdot$}
  \fboxsep=0pt
  \bigskip\bigskip\noindent
  \colorbox{hlight}{\rule{.1\textwidth}{0mm}\rule{0mm}{2mm}}%
  \makebox[.15\textwidth][c]{\bb14 摘 ~~ 要}%
  \colorbox{hlight}{\rule{.75\textwidth}{0mm}\rule{0mm}{2mm}}
  \par\bigskip}
{\setcounter{secnumdepth}{2}}

\newenvironment{ex}
{\setcounter{secnumdepth}{0}
 \fancyfoot[RO]{{\m11 習題}\rule{5mm}{0pt}$\cdot$~\thepage~$\cdot$}
 \Opensolutionfile{ans}[ans\thechapter]
  \fboxsep=0pt
  \bigskip\bigskip\noindent
  \colorbox{hlight}{\rule{.1\textwidth}{0mm}\rule{0mm}{2mm}}%
  \makebox[.15\textwidth][c]{\bb14 習 ~~ 題}%
  \colorbox{hlight}{\rule{.75\textwidth}{0mm}\rule{0mm}{2mm}}
  \par\leftmargini=6mm\leftmarginii=8mm}
 {\Closesolutionfile{ans}
 \setcounter{secnumdepth}{2}}

\m12
\fancypagestyle{plain}{%
  \fancyhf{}
  \renewcommand{\footrulewidth}{0pt}}

\includeonly{intro,gdp,growth,maindex}
% \includeonly{intro,gdp,growth,crusoe,mdemand,
%        save,pih,eq,interest,inflation,financial,
%        invest,labor,govt,tax,bond,
%        welfare,current,exchange,maindex}


\begin{document}
\onecolumn

% \setcounter{page}{0}  %% for 2-up printing
% \mbox{}\newpage       %% for 2-up
\include{intro}
\include{gdp}
\include{growth}
% \include{crusoe}
% \include{mdemand}
% \include{save}
% \include{pih}
% \include{eq}
% \include{interest}
% \include{inflation}
% \include{financial}
% \include{invest}
% \include{labor}
% \include{govt}
% \include{tax}
% \include{bond}
% \include{welfare}
% \include{current}
% \include{exchange}

%
% % Solutions are in two-column format
% %
\clearpage
%
% \chapter format for preface/index and so on.
%
\titleformat{\chapter}[hang]{\vspace*{-2cm}\chfont}
  {\parbox{.12\textwidth}{\hfill%
   \textcolor{dark}{\thechapter}}}%
  {.09\textwidth}{\EMtitle}

\addcontentsline{toc}{chapter}{\f11 習題解答}
\geometry{paperheight=23cm,paperwidth=16.5cm,textwidth=13cm,
   textheight=18.5cm,left=2cm,twosideshift=-.25cm,
   top=.3cm,footskip=1.75cm,marginparwidth=2cm,twoside}

\twocolumn

% The following will change Figure 2.3 (in chapter 2)
% to Figure 3.
%
\renewcommand{\thetable}{\arabic{table}}
\renewcommand{\thefigure}{\arabic{figure}}

\fancyfoot[LE]{$\cdot$~\thepage~$\cdot$\rule{5mm}{0pt} {\f11 習題解答}}
\fancyfoot[RO]{{\f11 習題解答}\rule{5mm}{0pt}$\cdot$~\thepage~$\cdot$}
\chapter*{習題解答}
\section*{第1章} \input{ans1}
\section*{第2章} \input{ans2}
% \section*{第3章} \input{ans3}
% \section*{第4章} \input{ans4}
% \section*{第5章} \input{ans5}
% \section*{第6章} \input{ans6}
% \section*{第7章} \input{ans7}
% \section*{第8章} \input{ans8}
% \section*{第9章} \input{ans9}
% \section*{第10章} \input{ans10}
% \section*{第11章} \input{ans11}
% \section*{第12章} \input{ans12}
% \section*{第13章} \input{ans13}
% \section*{第14章} \input{ans14}
% \section*{第15章} \input{ans15}
% \section*{第16章} \input{ans16}
% \section*{第17章} \input{ans17}
% \section*{第18章} \input{ans18}

\newpage
\include{maindex}

% \printindex
\end{document}
