1.1 This is the first section of this chapter.
Exercises
1.1 First problem.
1.2
1.3
1.4
1.2 This is the second section of this chapter
Exercises
1.5
1.6
1.7
Solutions to selected exercises
1.3
1.7
I also want the hyper-reference of the problems and their solutions, too.
And, I do not want to supply the command every time, like:
\begin{exercise}
How old are you?
\end{exercise}
The following is the MWE.
Code: Select all
\documentclass[12pt, openany]{book}
\usepackage[T1]{fontenc}
\usepackage{color}
\setlength{\parindent}{0in}
\setlength{\parskip}{10pt}
\begin{document}
\chapter{First}
\section{First}
This is the first section of this chapter.
{\bf\em Exercises} \\
1.1 Solve the problem. \\
1.2 What is the sum of 3 and 8? \\
{\textcolor{red}{1.4}} What is your name?
\section{Second}
This is the second section of this chapter.
{\bf\em Exercises} \\
1.5 Solve the problem. \\
1.6 What is the sum of 3 and 8? \\
{\textcolor{red}{1.7}} What is your name?
\section{Third}
\section{Four}
{\bf\em Solutions to selected Exercises} \\
1.3 I solved it! \\
1.6 I don't know.
\end{document}