'Returns the string representation of \'self\'.'

def _latex(self, printer):

    if self._headings[1]:
        new_line = []
        for i in range(self._w):
            new_line.append(str(self._headings[1][i]))
        self._headings[1] = new_line
    alignments = []
    if self._headings[0]:
        self._headings[0] = [str(x) for x in self._headings[0]]
        alignments = [self._head_align]
    alignments.extend(self._alignments)
    s = (('\\begin{tabular}{' + '    '.join(alignments)) + '}\n')
    if self._headings[1]:
        d = self._headings[1]
        if self._headings[0]:
            d = ([''] + d)
        first_line = (('    &    '.join(d) + '    \\\\') + '\n')
        s += first_line
        s += ('\\hline' + '\n')
    for (i, line) in enumerate(self._lines):
        d = []
        for (j, x) in enumerate(line):
            if (self._wipe_zeros and (x in (0, '0'))):
                d.append('    ')
                continue
            f = self._column_formats[j]
            if f:
                if isinstance(f, FunctionType):
                    v = f(x, i, j)
                    if (v is None):
                        v = printer._print(x)
                else:
                    v = (f % x)
                d.append(v)
            else:
                v = printer._print(x)
                d.append(('$%s$' % v))
        if self._headings[0]:
            d = ([self._headings[0][i]] + d)
        s += (('    &    '.join(d) + '    \\\\') + '\n')
    s += '\\end{tabular}'
    return s
