emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Force center alignment in LaTeX table export?


From: Nicolas Goaziou
Subject: Re: [O] Force center alignment in LaTeX table export?
Date: Mon, 27 Mar 2017 13:53:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Phil Regier <address@hidden> writes:

> See inline below and attached.  If exporting to PDF the first table gets a
> prefix of "ced!10" and the second is the pale red highlight I was wanting.
>
> Here are the important lines in the LaTeX buffer export:
>
> \(\left[\begin{array}{>{\cocumncococ{ced!10}}c|ccc|ccc}
>
> vs.
>
> \(\left[\begin{array}{a|ccc|ccc}
>
> This latter only works because in my header I have
>
> \newcolumntype{a}{>{\columncolor{red!10}}c}
>
>
>
>
> I'm not sure I'm reading the original issue, the patch, or the surrounding
> code right, but is it possible the [lr]->c substitution was intended for
> the case where no :align was provided by the author and org generated the
> alignment automatically?  If so, would it be appropriate to just move the
> substitution to the ";; Extract column groups and alignment ..." block in
> org-latex--align-string, which is to say the case (if I'm reading
> correctly) where the author has not provided an override?
>
> ox-latex.el-3154-(defun org-latex--align-string (table info)
> ox-latex.el-3155-  "Return an appropriate LaTeX alignment string.
> ox-latex.el-3156-TABLE is the considered table.  INFO is a plist used as
> ox-latex.el-3157-a communication channel."
> ox-latex.el:3158:  (or (org-export-read-attribute :attr_latex table :align)
> ox-latex.el-3159-      (let (align)
> ox-latex.el-3160-    ;; Extract column groups and alignment from first
> (non-rule)
>
>
>
> Org file to demonstrate problem and workaround:
>
> #+latex_header: \usepackage{xcolor}
> #+latex_header: \usepackage{colortbl}
>
> * Non-Working Example
> #+ATTR_LaTeX: :mode inline-math :environment array
> #+attr_latex: :math-prefix \left[ :math-suffix \right]
> #+attr_latex: :align >{\columncolor{red!10}}c|ccc|ccc
> |         |   | * | * |   |   |
> | *       |   |   | * |   |   |
> | \hline* |   |   |   | * |   |
> |         |   |   |   | * | * |
>
>
> * Working Example
>   Just define a column type that doesn't use the characters 'l' or 'r'
>
> #+latex_header: \newcolumntype{a}{>{\columncolor{red!10}}c}
>
> #+ATTR_LaTeX: :mode inline-math :environment array
> #+attr_latex: :math-prefix \left[ :math-suffix \right]
> #+attr_latex: :align a|ccc|ccc
> |         |   | * | * |   |   |
> | *       |   |   | * |   |   |
> | \hline* |   |   |   | * |   |
> |         |   |   |   | * | * |

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



reply via email to

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