I'm now use LaTex to write a mathematics problem solving book. It has some problems in the end of the chapter, and the last chapter is used to demonstrate the solution. But I don't know how to auto number the solutions for problems through the chapter, like Chapter 4, problem 4.1 (containing the solution)
I use gsm-l packages, a derived package of ams.
Here is the MWE
\documentclass{gsm-l}
\usepackage[papersize={160mm,240mm},inner=20mm, outer=15mm, vmargin=15mm]{geometry}
\geometry{includeheadfoot}
\usepackage{amssymb, amsmath}
\setcounter{tocdepth}{2}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\newtheorem{problem}{Problem}
\numberwithin{problem}{chapter}
\begin{document}
\chapter{Introduction}
\begin{problem}
This is problem 1.1
\end{problem}
\chapter{Key to the exercises}
I want to know how to auto list the problem number and the solution is behind it,
like :
\noindent \textbf{Problem 1.1}
The following is solution.
\end{document}
Please help me. Thanks.
bookclass instead ofarticle, and number exercises per chapter with\newtheorem{ex}{Exercise}[chapter]. – Mike Renfro Jul 06 '15 at 02:15\setcounter{tocdepth}{2}
\Newassociation{sol}{Solution}{ans} \newtheorem{problem}{Problem} \numberwithin{problem}{chapter}
\renewenvironment{Solution}[1] {\begin{trivlist}\item\relax \textbf{Solution to #1}} {\end{trivlist}}`
`
– Gonzalo Medina Jul 06 '15 at 03:08\Closesolutionfile{ans} \chapter{Key to the exercises} I want to know how to auto list the problem number and the solution is behind it, like : \input{ans1} \end{document}`
– Gonzalo Medina Jul 06 '15 at 03:08