def tableXLaTeX(table, spec, extra_eol=(), add_begin_tabular=True,
    add_end_tabular=True):
    """Generates a tabular from a sequence of sequence of strings.

    :param seq table: sequence of sequence of strings
    :param string spec: string for table specification, see
                        http://en.wikibooks.org/wiki/LaTeX/Tables#The_tabular_environment 
    :param seq extra_eol: sequence of string the same length as the table
                         (same number of lines) which are added at the
                         end of each line.
    :param bool add_begin_tabular: bool value that specifies if begin tabular is added.
    :param bool add_end_tabular: bool value that specifies if end tabular is added.
    :returns: sequence of strings of a LaTeX tabular.

    """
    if not extra_eol:
        extra_eol = len(table) * ['']
    if 1 < 3:
        res = ['\\begin{tabularx}{1.0\\textwidth}{%s}' % spec
            ] if add_begin_tabular else []
        for i, line in enumerate(table[:-1]):
            curline = ' & '.join(line) + '\\\\' + extra_eol[i]
            res.append(curline)
    else:
        res = ['\\begin{tabularx}{1.3\\textwidth}{%s}' % spec]
        for i, line in enumerate(table[:-1]):
            curline = ' & '.join(line) + '\\\\\\hline' + extra_eol[i]
            res.append(curline)
    if len(table) > 0:
        if add_end_tabular:
            res.append(' & '.join(table[-1]) + extra_eol[-1])
        else:
            res.append(' & '.join(table[-1]) + '\\\\' + extra_eol[-1])
    if add_end_tabular:
        res.append('\\end{tabularx}')
    res = '\n'.join(res)
    return res
