6. Backtracking 1-step booklet LaTeX๏ƒ

6.1. 2 page booklets๏ƒ

The worksheet code can be modified to produce multipage booklets.
The same diagram template can be used, without further modification.

6.1.1. Sample 1-step backtracking booklets by process๏ƒ

addition_q

addition_ans

subtraction_q

subtraction_ans

multiplication_q

multiplication_ans

division_q

division_ans

random_q

random_ans


6.1.2. Worksheet template๏ƒ

The multi page LaTeX 1-step worksheet question template is below.
 1% backtracking worksheet template
 2\documentclass[leqno, 12pt]{article}
 3\usepackage{tikz}  
 4\usetikzlibrary{positioning}
 5\usetikzlibrary {arrows.meta}
 6\usepackage[a4paper, portrait, margin=1cm]{geometry}
 7\usepackage{multicol}
 8\usepackage{fancyhdr}
 9
10\tikzset{backtrack/.style={rectangle,draw=black,fill=white,
11inner sep=2pt,minimum height=32pt, minimum width=20mm}}
12\tikzset{backtrackeq/.style={rectangle,draw=black,fill=white,
13inner sep=2pt,minimum height=12pt, minimum width=20mm}}
14\tikzset{backtrackstep/.style={rectangle,draw=none,fill=white,
15inner sep=2pt,minimum height=12pt, minimum width=20mm}}
16
17\def \HeadingQuestions {\section*{\Large Name: \underline{\hspace{8cm}} \hfill Date: \underline{\hspace{3cm}}} \vspace{-3mm}
18{1-step backtracking: Questions} \vspace{1pt}\hrule}
19
20% raise footer with page number
21\fancypagestyle{myfancypagestyle}{
22  \fancyhf{} % clear all header and footer fields
23  \renewcommand{\headrulewidth}{0pt} % no rule under header
24  \fancyfoot[C] {\thepage} \setlength{\footskip}{6pt} % raise page number 6pt
25}
26\pagestyle{myfancypagestyle}  % apply myfancypagestyle
27
28
29\begin{document}
30    \HeadingQuestions
31    \vspace{-5mm}
32    \begin{multicols}{2}
33        <<cols>>
34    \end{multicols}
35\end{document}
The multi page LaTeX 1-step worksheet answer template is below.
 1% backtracking worksheet template
 2\documentclass[leqno, 12pt]{article}
 3\usepackage{tikz} 
 4\usetikzlibrary{positioning}
 5\usetikzlibrary {arrows.meta}
 6\usepackage[a4paper, portrait, margin=1cm]{geometry}
 7\usepackage{multicol}
 8\pagestyle{empty}
 9
10\tikzset{backtrack/.style={rectangle,draw=black,fill=white,
11inner sep=2pt,minimum height=32pt, minimum width=20mm}}
12\tikzset{backtrackeq/.style={rectangle,draw=black,fill=white,
13inner sep=2pt,minimum height=12pt, minimum width=20mm}}
14\tikzset{backtrackstep/.style={rectangle,draw=none,fill=white,
15inner sep=2pt,minimum height=12pt, minimum width=20mm}}
16
17\def \HeadingAnswers {\section*{\Large Name: \underline{\hspace{8cm}} \hfill Date: \underline{\hspace{3cm}}} \vspace{-3mm}
18{1-step backtracking: Answers} \vspace{1pt}\hrule}
19
20\begin{document}
21    \HeadingAnswers
22    \vspace{-5mm}
23    \begin{multicols}{2}
24        <<col1>>
25    \columnbreak
26        <<col2>>
27    \end{multicols}
28\end{document}

6.1.3. Modifications๏ƒ

\usepackage{fancyhdr} brings in the fancyhdr package to control the position of the page number.
The code below has been added to the preamble in LaTeX to move the page number up6pt.
% raise footer with page number; no header
\fancypagestyle{myfancypagestyle}{
   \fancyhf{}% clear all header and footer fields
   \renewcommand{\headrulewidth}{0pt} % no rule under header
   \fancyfoot[C] {\thepage} \setlength{\footskip}{6pt} % raise page number 6pt
}
\pagestyle{myfancypagestyle}
The diagram placeholder has been simplified from two to just one.
The diagrams will still flow with 5 to a column since there is only just room for 5, not 6.
\begin{multicols}{2}
   <<cols>>
\end{multicols}