@@ -3640,7 +3640,8 @@ CONTENTS is the contents of the object."
36403640; ; `org-latex-table' is the entry point for table transcoding. It
36413641; ; takes care of tables with a "verbatim" mode. Otherwise, it
36423642; ; delegates the job to either `org-latex--table.el-table' ,
3643- ; ; `org-latex--org-table' or `org-latex--math-table' functions,
3643+ ; ; `org-latex--org-table' , `org-latex--math-table' or
3644+ ; ; `org-latex--org-tabbing' functions,
36443645; ; depending of the type of the table and the mode requested.
36453646; ;
36463647; ; `org-latex--align-string' is a subroutine used to build alignment
@@ -3664,8 +3665,10 @@ contextual information."
36643665 `(table nil ,@(org-element-contents table))))))
36653666 ; ; Case 2: Matrix.
36663667 ((or (string= type " math" ) (string= type " inline-math" ))
3667- (org-latex--math-table table info))
3668- ; ; Case 3: Standard table.
3668+ (org-latex--math-table table info))
3669+ ; ; Case 3: Tabbing
3670+ ((string= type " tabbing" ) (org-table--org-tabbing table contents info))
3671+ ; ; Case 4: Standard table.
36693672 (t (concat (org-latex--org-table table contents info)
36703673 ; ; When there are footnote references within the
36713674 ; ; table, insert their definition just after it.
@@ -3702,6 +3705,34 @@ centered."
37023705 info)
37033706 (apply 'concat (nreverse align)))))
37043707
3708+ (defun org-latex--align-string-tabbing (table info )
3709+ " Return an appropriate LaTeX alignment string, for the
3710+ latex tabbing environment.
3711+ TABLE is the considered table. INFO is a plist used as
3712+ a communication channel."
3713+ (or (org-export-read-attribute :attr_latex table :align )
3714+ (let ((align " " )
3715+ (count 0 )
3716+ (separator " " ))
3717+ ; ; Count the number of cells in the first row.
3718+ (setq count (length
3719+ (org-element-map
3720+ (org-element-map table 'table-row
3721+ (lambda (row )
3722+ (and (eq (org-element-property :type row) 'standard ) row))
3723+ info 'first-match )
3724+ 'table-cell
3725+ (lambda (cell ) cell))))
3726+ ; ; Calculate the column width, using a proportion of the documets
3727+ ; ; textwidth.
3728+ (setq separator (format
3729+ " \\ hspace{%s\\ textwidth} \\= "
3730+ (- (/ 1.0 count) 0.01 )))
3731+ (setq align (concat
3732+ (apply 'concat (make-list count separator))
3733+ " \\ kill" )))
3734+ ))
3735+
37053736(defun org-latex--decorate-table (table attributes caption above? info )
37063737 " Decorate TABLE string with caption and float environment.
37073738
@@ -3804,6 +3835,23 @@ This function assumes TABLE has `org' as its `:type' property and
38043835 table-env)))
38053836 (org-latex--decorate-table output attr caption above? info))))))
38063837
3838+
3839+ (defun org-table--org-tabbing (table contenst info )
3840+ " Return appropriate LaTeX code for an Org table, using the
3841+ latex tabbing syntax.
3842+ TABLE is the table type element to transcode. CONTENTS is its
3843+ contents, as a string. INFO is a plist used as a communication
3844+ channel.
3845+ This function assumes TABLE has `org' as its `:type' property and
3846+ `tabbing' as its `:mode' attribute."
3847+ (let ((output (format " \\ begin{%s }\n %s \n %s \\ end{%s }"
3848+ " tabbing"
3849+ (org-latex--align-string-tabbing table info )
3850+ contenst
3851+ " tabbing" )))
3852+ output)
3853+ )
3854+
38073855(defun org-latex--table .el-table (table info)
38083856 " Return appropriate LaTeX code for a table.el table.
38093857
@@ -3887,6 +3935,9 @@ This function assumes TABLE has `org' as its `:type' property and
38873935 " Transcode a TABLE-CELL element from Org to LaTeX.
38883936CONTENTS is the cell contents. INFO is a plist used as
38893937a communication channel."
3938+ (let (
3939+ (type (org-export-read-attribute :attr_latex (org-export-get-parent-table table-cell ) :mode ))
3940+ )
38903941 (concat
38913942 (let ((scientific-format (plist-get info :latex-table-scientific-notation )))
38923943 (if (and contents
@@ -3898,7 +3949,10 @@ a communication channel."
38983949 (match-string 1 contents)
38993950 (match-string 2 contents))
39003951 contents))
3901- (when (org-export-get-next-element table-cell info) " & " )))
3952+ (when (org-export-get-next-element table-cell info)
3953+ (if (string= type " tabbing" )
3954+ " \\ > " " & " )
3955+ ))))
39023956
39033957
39043958; ;;; Table Row
0 commit comments