{% extends "chemdb/doc/base.tex" %}
{% load latex %}

{% block comment %}
% Chemical inventory as per 
%   http://www.drexelsafetyandhealth.com/lab-chem.htm#chpe7
{% endblock %}

{% block preamble %}
% N of M style page numbering
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}
\cfoot{\thepage\ of \pageref{LastPage}}
% Turn off the silly head and foot rules
\renewcommand{\headrule}{\relax}
\renewcommand{\footrule}{\relax}

% Break the table across several pages
% requires 2 latex runs.
\usepackage{longtable}
{% endblock %}

{% block document %}

\begin{center}
{\headfont {{ title }} }\\
\contfont
Generated \today\ by ChemDB.\\
\vskip 10pt
\end{center}

{% if chemical_instances %}
\footnotesize
\begin{longtable}{l l c c c c c c c c}
% Header for the remaining page(s) of the table...
ID & Name & Amount & H & F & R & S & M & C & T \\
\hline
\endhead{% for chemical_instance in chemical_instances %}
{{ chemical_instance.id }} &
  {{ chemical_instance.chemical.abbrev|latex_safe|safe }} &
  {{ chemical_instance.amount }} &
  {{ chemical_instance.chemical.health|default:"" }} &
  {{ chemical_instance.chemical.fire|default:"" }} &
  {{ chemical_instance.chemical.reactivity|default:"" }} &
  {{ chemical_instance.chemical.special.all|latex_specials }} &
  {{ chemical_instance.chemical.mutagen|yesno:"M," }} &
  {{ chemical_instance.chemical.carcinogen|yesno:"C," }} &
  {{ chemical_instance.chemical.teratogen|yesno:"T," }} \\
{% endfor %}\end{longtable}
{% else %}
No chemicals are available.
{% endif %}

{% endblock %}
