emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] LaTeX multicolumn count wrong in table export


From: Nick Dokos
Subject: Re: [Orgmode] LaTeX multicolumn count wrong in table export
Date: Sat, 29 Aug 2009 00:01:22 -0400

Nick Dokos <address@hidden> wrote:

> Karl Stump <address@hidden> wrote:
> 
> > When exporting a table with a horizontal line the column count is wrong.    
> >                                                                             
> > Output from pdflatex run:                                                   
> >                                                                             
> > ! Extra alignment tab has been changed to \cr.                              
> > <template> \endtemplate                                                     
> >                                                                             
> > l.32 ....\multicolumn{4}{r}{Continued on next page}                         
> >                                                   \                         
> >                                                                             
> > ** table export test                                                        
> >                                                                             
> > #+CAPTION: This is a long table with lines around and between cells         
> > #+LATEX_HEADER: \usepackage[landscape]{geometry}                            
> > #+LATEX_HEADER: \geometry{left=0.12in,right=0.12in,top=0.25in,bottom=0.25in}
> > #+ATTR_LaTeX: longtable align=||lll||                                       
> >                                                                             
> >     | / | <30>     | <10>     | <10>     |                                  
> >     |   | Heading1 | Heading2 | Heading3 |                                  
> >     |---+----------+----------+----------|                                  
> >     |   | alpha    | beta     | gamma    |                                  
> >     |   |          |          |          |                                  
> > 
> > start: 0000-00-00 end: 0000-00-00
> > 
> 
> 
> I believe it's because of the dummy "calculation-mark" column,
> which is not exported. However, the variable org-table-last-alignment
> (a list, whose length becomes the value of the \multicolumn argument)
> ends up having the value (nil nil nil nil), i.e. it counts the dummy
> column as well. What the proper place to adjust the value is, I don't
> know, but it should be easy for Carsten to fix it. For the time being,
> you can either get rid of the dummy row and column (e.g. if you don't
> need the widths) or fix it by hand in the LaTeX file.
> 

I think the following patch fixes the above problem and is correct in
its essentials:

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index c21c9ce..d41c231 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1449,7 +1449,7 @@ The conversion is made depending of STRING-BEFORE and 
STRING-AFTER."
 \\endhead
 \\hline\\multicolumn{%d}{r}{Continued on next page}\\
 \\endfoot
-\\endlastfoot" (length org-table-last-alignment))
+\\endlastfoot" (- (length org-table-last-alignment) (if 
org-table-clean-did-remove-column 1 0)))
                                           nil)))
                      (if (not longtblp) (concat "\n\\end{tabular}"))
                      (if longtblp "\n" (if org-export-latex-tables-centered


HTH,
Nick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]