def latex_declarations(with_solution):
    """Returns the list of declarations to be set in the preamble
       of the LaTeX output.

    """
    data = ['\\usepackage{graphicx}', '\\usepackage{fancyvrb}',
        '\\usepackage{enumerate}', '\\usepackage{color}',
        '\\definecolor{lightgray}{rgb}{1, 1, 1}',
        '\\newcommand{\\light}[1]{\\textcolor{lightgray}{#1}}',
        '\\definecolor{hidden}{rgb}{1, 1, 1}',
        '\\newcommand{\\hidden}[1]{\\textcolor{hidden}{#1}}',
        '\\newif\\ifsolutions']
    if with_solution:
        data.append('\\solutionstrue')
    else:
        data.append('\\solutionsfalse')
    return '\n'.join(data)
