From: Nick Dokos <nicholas.dokos@hp.com>
To: Angel Popov <angelpopov@yahoo.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Failed to create radio tables
Date: Sat, 10 Jul 2010 15:26:41 -0400 [thread overview]
Message-ID: <653.1278790001@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Angel Popov <angelpopov@yahoo.com> of "Thu\, 08 Jul 2010 22\:55\:01 PDT." <447823.81910.qm@web33204.mail.mud.yahoo.com>
Angel Popov <angelpopov@yahoo.com> wrote:
> Hi,
> I am following example on radio tables but it looks that it does not work.
> I copied
>
> % BEGIN RECEIVE ORGLST to-buy
> % END RECEIVE ORGLST to-buy
> \begin{comment}
> #+ORGLIST: SEND to-buy orgtbl-to-latex
> - a new house
> - a new computer
> + a new keyboard
> + a new mouse
> - a new life
> \end{comment}
>
> and when I C-c C-c on '- a new house' nothing happend
>
Well, you are not following the example exactly (App. A.5.2 of the Org
manual): you are trying to extend it to lists and I'm not sure that you
can do that. So let me go back to the example in the manual and explain
the rationale:
The idea is that specifying tables in Org is easy, but specifying tables
in LaTeX is harder. It would be convenient if you could use Org mode
syntax for tables *in your LaTeX file* and have the LaTeX table
generated automatically from that. That's what radio tables do for you:
in your LaTeX file, you include the table in Org syntax *as a comment* and
then you use orgtbl facilities to automatically generate your LaTeX
table.
So here's my LaTeX file with the example table:
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\begin{document}
Here's a table of stuff:
% BEGIN RECEIVE ORGTBL to-buy
% END RECEIVE ORGTBL to-buy
\begin{comment}
The Org table is inside a LaTeX comment.
#+ORGTBL: SEND to-buy orgtbl-to-latex
| foo | bar |
|-----+-----|
| 1 | 2 |
| 3 | 4 |
\end{comment}
\end{document}
--8<---------------cut here---------------end--------------->8---
When you edit this file, the major mode of the buffer is going to be
LaTeX-mode, not Org-mode. This is where orgtbl-mode comes in: it's a
minor mode, so you can enable it in your LaTeX-mode buffer:
M-x orgtbl-mode <RET>
and then you have the orgtbl facilities available in the buffer where
you are editing your LaTeX file. Now put your cursor somewhere in the
Org table and say C-c C-c - presto, change-o, you get this:
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\begin{document}
Here's a table of stuff:
% BEGIN RECEIVE ORGTBL to-buy
\begin{tabular}{rr}
foo & bar \\
\hline
1 & 2 \\
3 & 4 \\
\end{tabular}
% END RECEIVE ORGTBL to-buy
\begin{comment}
The Org table is inside a LaTeX comment.
#+ORGTBL: SEND to-buy orgtbl-to-latex
| foo | bar |
|-----+-----|
| 1 | 2 |
| 3 | 4 |
\end{comment}
\end{document}
--8<---------------cut here---------------end--------------->8---
Process this with LaTeX and you get a nicely typeset table, without
having to worry much about the finicky LaTeX syntax. Plus, if you
need to change the table, you change the Org table in the comment,
press C-c C-c again and the change is propagated automatically to the
LaTeX table.
In addition, if you enable orgtbl-mode before you even start, then you
have all the nice shortcuts for *editing* the Org table in the first
place. In fact, it's handy to have orgtbl-mode *always* enabled when you
edit LaTeX files. You can do that by using the appropriate hook. For
example, if you use AucTeX, add the following line to your .emacs (after
the place where AucTeX is initialized, so that it has a chance to define
the hook):
(add-hook 'LaTeX-mode-hook 'orgtbl-mode)
AFAIK, you *cannot* do something similar with lists (which is what
you seem to have tried with your modifications to the example), but lists
are much easier to deal with directly in LaTeX.
Hope this makes things clearer,
Nick
next prev parent reply other threads:[~2010-07-10 20:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 5:55 Failed to create radio tables Angel Popov
2010-07-10 13:47 ` Bernt Hansen
2010-07-10 19:26 ` Nick Dokos [this message]
2010-07-10 21:48 ` Nick Dokos
2010-07-10 22:27 ` Nicolas Goaziou
2010-07-10 23:23 ` Nick Dokos
2010-07-11 4:02 ` Nick Dokos
2010-07-11 6:17 ` Nicolas Goaziou
2010-07-12 5:51 ` Carsten Dominik
2010-07-12 9:16 ` Nicolas Goaziou
2010-07-12 12:44 ` Nicolas Goaziou
2010-07-12 17:07 ` Carsten Dominik
2010-07-10 20:42 ` Nicolas Goaziou
2010-07-13 11:42 ` Carsten Dominik
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=653.1278790001@gamaville.dokosmarshall.org \
--to=nicholas.dokos@hp.com \
--cc=angelpopov@yahoo.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 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.