thomas.stenhaug@gmail.com writes: > Given an org file with the following contents > > --- > #+ATTR_LATEX: :mode math :environment bmatrix > | 1 | 2 | 3 | > > whops > --- > > when exporting to LaTeX using Org version 8.3.6 from > http://orgmode.org/elpa/ render to LaTeX as follows: > > --- > \[ > \begin{bmatrix} > 1 & 2 \\ > \end{bmatrix} > > \] whops > --- > > The offending bit is the vertical whitespace before \], which makes it > incorrect input to pdflatex. > > Using the Org version 8.2.10 that ships with Emacs 25.1.1, the > corresponding LaTeX is as follows > > --- > \[\begin{bmatrix} > 1 & 2 \\ > \end{bmatrix}\] > > whops > --- > > which is valid input to pdflatex. > > The 3 files are in their entirety on https://gist.github.com/karvus/da4523fdef8f644a6aa183028093d0ca. > I can reproduce this and I think the problem is that the table includes the empty line after it and that gets carried into the data that org-export-data passes into org-latex-matrices. I used the following file --8<---------------cut here---------------start------------->8--- * foo #+ATTR_LATEX: :mode math | 1 | 2 | whoops --8<---------------cut here---------------end--------------->8--- and the data has a ":beg 8 :end 44" specification that correspond to the '#' and the 'w' of the whoops. However, it's hard to debug: when I try to edebug org-export-data I get the attached backtrace, presumably because the cl-macrolet in org-export-data confuses edebug: