> when exporting org table to latex/pdf with longtabu environment the > generated latex includes extra \\ if the #+NAME tag is present, > inserting an needed row, the resulting table look ugly in some cases.
Thanks for reporting! Confirmed. > The extra \\ seem to be added at ox-latex.el line 3937 (current git head): > > (concat (and fontsize (concat "{" fontsize)) > (format "\\begin{%s}%s{%s}\n" table-env width alignment) > (and above? > (org-string-nw-p caption) > (concat caption "\\\\\n")) ; <= HERE > contents > (and (not above?) > (org-string-nw-p caption) > (concat caption "\\\\\n")) > (format "\\end{%s}" table-env) > (and fontsize "}")))) > > When I remove the "\\\\" the generated code is correct, but I suspect > this is may be useful in some other cases and this may not be a suitable > fix? Yes, the problem occurs where you pointed. The "\\\\" part is present there from the very first commit in ox-latex. I am not sure why it is there. What happens if you remove "\\\\" part from the code and play around with tables with/without #+caption/#+name? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>