emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporting booktabs as tables
@ 2011-06-23 13:01 Rasmus
  0 siblings, 0 replies; only message in thread
From: Rasmus @ 2011-06-23 13:01 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-23 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 13:01 Exporting booktabs as tables Rasmus

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).