From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Phil Regier <phil.regier@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Force center alignment in LaTeX table export?
Date: Mon, 27 Mar 2017 13:53:33 +0200 [thread overview]
Message-ID: <87fuhzj5qa.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAKO4ir-FmCN5aJdet0e6a4xUa_GC4XEJiyrVAwiEhKVwwne3DQ@mail.gmail.com> (Phil Regier's message of "Sun, 26 Mar 2017 12:13:24 -0700")
Hello,
Phil Regier <phil.regier@gmail.com> 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
next prev parent reply other threads:[~2017-03-27 11:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6b2d8e5e114b4ea9accc4d28a9d98662@AM4PR01MB1891.eurprd01.prod.exchangelabs.com>
2017-03-26 12:14 ` Force center alignment in LaTeX table export? Eric S Fraga
2017-03-26 19:13 ` Phil Regier
2017-03-27 11:53 ` Nicolas Goaziou [this message]
[not found] ` <7201c71ccd6440fe9cfd491a95bf3e26@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-27 8:39 ` Eric S Fraga
2017-03-26 6:25 Phil Regier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fuhzj5qa.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=phil.regier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.