% -----------------------------------------------
% Package imports
% -----------------------------------------------
\documentclass[12pt, a4paper]{article}% 'twoside' for printing
\usepackage[utf8]{inputenc}% Allow input to be UTF-8
\usepackage[margin = 2cm]{geometry}% May be used to set margins

% -----------------------------------------------
% Document start
% -----------------------------------------------

\begin{document}
\{{text_size}}

\section*{Program: {{ program.name }}}

This program was made using \verb|streprogen|,
the Python strength program generator.
The latest version can be found at \\
\verb|https://pypi.python.org/pypi/streprogen/|.


\section*{Program parameters}
\begin{tabular}{l|l}
	\textbf{Parameter} & \textbf{Value} \\ \hline
	\verb|duration|             & {{program.duration}} \\
	\verb|reps_per_exercise|    & {{program.reps_per_exercise}} \\
	\verb|intensity|            & {{program.intensity}} \\
	\verb|units|                & {{program.units}}
\end{tabular}


\section*{Exercise information}
\begin{tabular}{llllll}
    \textbf{Exercise} & \textbf{Start} & \textbf{End} & \textbf{Reps min}
    & \textbf{Reps max} & \textbf{Weekly increase} \\ \hline
	{% for day in program.days %}
      \textbf{ {{day.name}} } & & & & & \\ \hline
    {% for dynamic_ex in day.dynamic_exercises %}
        \hspace{0.5em}{{dynamic_ex.name}} & {{dynamic_ex.start_weight}} {{program.units}} &
         {{dynamic_ex.final_weight}} {{program.units}} & {{dynamic_ex
         .min_reps}} & {{dynamic_ex.max_reps}} &
          {{dynamic_ex.weekly_growth(program.duration)}}\%\\
    {% endfor %}
    {% for static_ex in day.static_exercises %}
       \hspace{0.5em}{{static_ex.name}} & \multicolumn{ 5 }{l}{ {{static_ex.sets_reps(1)}} } \\
      {% endfor %}
{% endfor %}
\end{tabular}


\clearpage
\section*{Program}
{% if program._rendered == False %}
Not rendered. Call program.render() to render it.
{% else %}
{% for week in range(1, program.duration + 1) %}
 \subsection*{\hspace{0.25em} Week {{week}} }
{% for day in program.days %}
  \subsection*{\hspace{0.5em} {{day.name}} }


  \begin{tabular}{l|{% for i in range(table_width - 1) %}l{% endfor %}}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ {{table_width - 1}} }{l}{ \textbf{Sets / reps} } \\ \hline
  {% for dynamic_ex in day.dynamic_exercises %}
      {% for i, chunk in enumerate(chunker(program._rendered[week][day][dynamic_ex]['strings'], table_width - 1)) %}

            {% if i == 0 %}
            \hspace{0.75em} {{dynamic_ex.name}}
            {% else %}
            \hspace{0.75em}
            {% endif %}
            {% for scheme in chunk %}
            & {{scheme}}
            {% endfor %}
            \\

      {% endfor %}
  {% endfor %}

  {% for static_ex in day.static_exercises %}
   \hspace{0.75em} {{static_ex.name}} &  \multicolumn{ {{table_width - 1}} }{l}{ {{static_ex.sets_reps(week)}} } \\
  {% endfor %}
  \end{tabular}

{% endfor %}

{% if clear_pages == True and week != program.duration%}\clearpage{% endif %}
{% endfor %}
{% endif %}

\end{document}