From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aldric Giacomoni Subject: Re: Feature request: creating separate tables on same rows Date: Thu, 5 Jun 2014 19:33:52 -0400 Message-ID: References: <87oay7z4bb.fsf@gmail.com> <5390C4E0.9090700@gmail.com> <5390CE56.4020909@gmail.com> <871tv3qcqq.fsf@gmail.com> <874mzz2by2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d4852aa3a8204fb1f2e8f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WshAk-0002Px-I8 for emacs-orgmode@gnu.org; Thu, 05 Jun 2014 19:34:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WshAj-00089h-8l for emacs-orgmode@gnu.org; Thu, 05 Jun 2014 19:34:14 -0400 Received: from mail-ob0-x234.google.com ([2607:f8b0:4003:c01::234]:61921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WshAj-00088d-1Q for emacs-orgmode@gnu.org; Thu, 05 Jun 2014 19:34:13 -0400 Received: by mail-ob0-f180.google.com with SMTP id va2so1901453obc.39 for ; Thu, 05 Jun 2014 16:34:12 -0700 (PDT) In-Reply-To: <874mzz2by2.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Jorge A. Alfaro-Murillo" Cc: emacs-orgmode@gnu.org --047d7b5d4852aa3a8204fb1f2e8f Content-Type: text/plain; charset=UTF-8 Understood, thank you very much for explaining it :) On Thu, Jun 5, 2014 at 7:06 PM, Jorge A. Alfaro-Murillo < jorge.a.alfaro@gmail.com> wrote: > Thorsten Jolitz writes: > > > In Org-mode that would be (at least) very strange, but Org-mode uses > > backends for the final docs, so you might want to look at e.g. LaTeX > > multi-column styles and if Org-mode supports them somehow. But even if > > so, it might get complicated and using AucTex directly might be the > > better choice in such cases. > > I agree, in such cases I use AucTeX directly. You can use orgtbl-mode in > your tex file to build the main data of the table in LaTeX in Org form, > check: (info "(org) A LaTeX example"). Then add your multi-columns with: > > #+BEGIN_LaTeX > \multirow{''num_rows''}{''width''}{''contents''} > #+END_LaTeX > > If you want multi-rows: > #+BEGIN_LaTeX > \usepackage{multirow} > \multirow{''num_rows''}{''width''}{''contents''} > #+END_LaTeX > > A complete example, from a recent paper I was working on: > > #+BEGIN_LaTeX > \documentclass{article} > \usepackage{multirow} > \usepackage{booktabs} > \begin{document} > > \begin{table} > \centering > \begin{tabular}{cccccc} > \toprule > \multirow{2}{*}{Age-group} & \multirow{2}{*}{$L-a$} & > \multirow{2}{*}{$p_{d}$} & \multirow{2}{*}{$p_{h}$} & > \multicolumn{2}{c}{Likelihood} \\ > \cmidrule(lr){5-6} > & & & & Mean & 95\% CI \\ > \midrule > 0-5 & 83.73 & 0.00004 & 0.0141 & 0.38009 & > $[0.24024,\,0.53638]$\\ > 5-17 & 74.78 & 0.00001 & 0.0006 & 0.19399 & > $[0.10497,\,0.31382]$\\ > 18-49 & 52.52 & 0.00009 & 0.0042 & 0.12682 & > $[0.07216,\,0.20166]$\\ > 50-64 & 30.10 & 0.00134 & 0.0193 & 0.12682 & > $[0.07216,\,0.20166]$\\ > 65+ & 14.19 & 0.01170 & 0.0421 & 0.17229 & > $[0.09871,\,0.26994]$\\ > \bottomrule > \end{tabular} > \caption{Age-dependent health effect parameters.} > \end{table} > > \end{document} > #+END_LaTeX > > Everything between \midrule and \bottomrule is easier written with > orgtbl-mode. > > Best, > > Jorge. > > > --047d7b5d4852aa3a8204fb1f2e8f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Understood, thank you very much for explaining it :)
=


On Thu, Jun 5= , 2014 at 7:06 PM, Jorge A. Alfaro-Murillo <jorge.a.alfaro@gmail.co= m> wrote:
Thorsten Jolitz <tjolitz@gmail.com> writes:

> In Org-mode that would be (at least) very strange, but Org-mode uses > backends for the final docs, so you might want to look at e.g. LaTeX > multi-column styles and if Org-mode supports them somehow. But even if=
> so, it might get complicated and using AucTex directly might be the > better choice in such cases.

I agree, in such cases I use AucTeX directly. You can use orgtbl-mode= in
your tex file to build the main data of the table in LaTeX in Org form,
check: (info "(org) A LaTeX example"). Then add your multi-column= s with:

#+BEGIN_LaTeX
=C2=A0 \multirow{''num_rows''}{''width''}{&= #39;'contents''}
#+END_LaTeX

If you want multi-rows:
#+BEGIN_LaTeX
=C2=A0 \usepackage{multirow}
=C2=A0 \multirow{''num_rows''}{''width''}{&= #39;'contents''}
#+END_LaTeX

A complete example, from a recent paper I was working on:

#+BEGIN_LaTeX
\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}

\begin{table}
=C2=A0 \centering
=C2=A0 \begin{tabular}{cccccc}
=C2=A0 =C2=A0 \toprule
=C2=A0 =C2=A0 \multirow{2}{*}{Age-group} & \multirow{2}{*}{$L-a$} &=
=C2=A0 =C2=A0 \multirow{2}{*}{$p_{d}$} =C2=A0& \multirow{2}{*}{$p_{h}$}= &
=C2=A0 =C2=A0 \multicolumn{2}{c}{Likelihood} \\
=C2=A0 =C2=A0 \cmidrule(lr){5-6}
=C2=A0 =C2=A0 & & & & Mean & 95\% CI \\
=C2=A0 =C2=A0 \midrule
=C2=A0 =C2=A0 0-5 =C2=A0 =C2=A0 =C2=A0 & 83.73 & 0.00004 & 0.01= 41 =C2=A0& 0.38009 & $[0.24024,\,0.53638]$\\
=C2=A0 =C2=A0 5-17 =C2=A0 =C2=A0 =C2=A0& 74.78 & 0.00001 & 0.00= 06 =C2=A0& 0.19399 & $[0.10497,\,0.31382]$\\
=C2=A0 =C2=A0 18-49 =C2=A0 =C2=A0 & 52.52 & 0.00009 & 0.0042 = =C2=A0& 0.12682 & $[0.07216,\,0.20166]$\\
=C2=A0 =C2=A0 50-64 =C2=A0 =C2=A0 & 30.10 & 0.00134 & 0.0193 = =C2=A0& 0.12682 & $[0.07216,\,0.20166]$\\
=C2=A0 =C2=A0 65+ =C2=A0 =C2=A0 =C2=A0 & 14.19 & 0.01170 & 0.04= 21 =C2=A0& 0.17229 & $[0.09871,\,0.26994]$\\
=C2=A0 =C2=A0 \bottomrule
=C2=A0 \end{tabular}
=C2=A0 \caption{Age-dependent health effect parameters.}
\end{table}

\end{document}
#+END_LaTeX

Everything between \midrule and \bottomrule is easier written with
orgtbl-mode.

Best,

Jorge.



--047d7b5d4852aa3a8204fb1f2e8f--