emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus.pank@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Exporting booktabs as tables
Date: Thu, 23 Jun 2011 15:01:39 +0200	[thread overview]
Message-ID: <87y60swvkc.fsf@gmail.com> (raw)

Hi,

I use booktabs from library of babel for LaTeX export. 

I want to export an booktab-org-table as an actual latex-table (i.e. not
tabular only).

An example follows. The question is how to make #+call be recognized
and treated as a 'first-class' table. (I could do it in LaTeX manner,
but I am trying to become more 'Org-Centric').

#+begin_src org
#+LATEX_HEADER: \usepackage{booktabs}
* COMMENT Tables 
#+CAPTION: This is not a table! 
#+LABEL: tbl:table
#+ATTR_LaTeX: table 
#+tblname: budget
| Post   | Beløb [\textsc{dkk}] |
|--------+----------------------|
| post 1 |                 2250 |
| post 2 |                 1500 |
| post 3 |                  375 |
| post 4 |                  525 |
|--------+----------------------|
| Total  |                 4650 |
#+TBLFM: @5$2=vsum(@1..@-1)
* Export 
#+call: booktabs(table=budget, align="@{}lr@{}") :results latex :exports results 

#+CAPTION: This is a table
| Post   | Beløb [\textsc{dkk}] |
|--------+----------------------|
| post 1 |                 2250 |
| post 2 |                 1500 |
| post 3 |                  375 |
| post 4 |                  525 |
|--------+----------------------|
| Total  |                 4650 |
#+end_src

Which results in the following. Notice that the first is a tabular. I
want it to be wrapped in a table-environment. 
#+begin_src latex
% [snip]
\begin{tabular}{@{}lr@{}}
  \toprule
  Post & Beløb [\textsc{dkk}] \\
  \midrule
  post 1 & 2250 \\
  post 2 & 1500 \\
  post 3 & 375 \\
  post 4 & 525 \\
  \hline
  Total & 4650 \\
  \bottomrule
\end{tabular}

\begin{table}[htb]
  \caption{This is a table} 
  \begin{center}
    \begin{tabular}{lr}
      Post    &  Beløb [\textsc{dkk}]  \\
      \hline
      post 1  &                  2250  \\
      post 2  &                  1500  \\
      post 3  &                   375  \\
      post 4  &                   525  \\
      \hline
      Total   &                  4650  \\
    \end{tabular}
  \end{center}
\end{table}
#+end_src

Thanks,
Rasmus

-- 
Sent from my Emacs

                 reply	other threads:[~2011-06-23 13:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y60swvkc.fsf@gmail.com \
    --to=rasmus.pank@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).