emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org and LaTeX tables
@ 2010-01-06 10:29 Sébastien Vauban
  2010-01-06 10:43 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Vauban @ 2010-01-06 10:29 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

* Context

  In the PDF output, I need to have tables somehow highlighted. For example,
  by placing a border around them, or by putting a background color.

  Some months ago, I did that by using =org-special-blocks=, such in the
  following example:

#+BEGIN_shaded
  |   Code |    1st |    2nd |
  |--------+--------+--------|
  | 361-94 | 830.00 | 830.00 |
  | 364-91 |   0.00 | 347.00 |
#+END_shaded

  But =org-special-blocks= turns out to be incompatible with Org-babel, and
  since the latter grows in importance...


* Essays

  All of the following essays fail, in that the tables are copied verbatim in
  the TeX output file. That is, the columns are not replaced by the correct
  code (with ampersand as separator).

** Embedding LaTeX

\begin{shaded}
  |   Code |    1st |    2nd |
  |--------+--------+--------|
  | 361-94 | 830.00 | 830.00 |
  | 364-91 |   0.00 | 347.00 |
\end{shaded}


** Quoting LaTeX code

#+LaTeX: \begin{shaded}
  |   Code |    1st |    2nd |
  |--------+--------+--------|
  | 361-94 | 830.00 | 830.00 |
  | 364-91 |   0.00 | 347.00 |
#+LaTeX: \end{shaded}


** Quoting LaTeX code à la Org-babel?

#+BEGIN_SRC shaded
  |   Code |    1st |    2nd |
  |--------+--------+--------|
  | 361-94 | 830.00 | 830.00 |
  | 364-91 |   0.00 | 347.00 |
#+END_SRC


** Alternatives...

   Is there any other working alternative to get the power of Org tables and
   LaTeX code surrounding them, in order to get this:

\begin{shaded}
\begin{tabular}{rrr}
   Code  &     1st  &     2nd  \\
\hline
 361-94  &  830.00  &  830.00  \\
 364-91  &    0.00  &  347.00  \\
\end{tabular}
\end{shaded}

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org and LaTeX tables
  2010-01-06 10:29 Org and LaTeX tables Sébastien Vauban
@ 2010-01-06 10:43 ` Carsten Dominik
  2010-01-06 11:10   ` Sébastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2010-01-06 10:43 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode


On Jan 6, 2010, at 11:29 AM, Sébastien Vauban wrote:

> * Context
>
>  In the PDF output, I need to have tables somehow highlighted. For  
> example,
>  by placing a border around them, or by putting a background color.
>
>  Some months ago, I did that by using =org-special-blocks=, such in  
> the
>  following example:
>
> #+BEGIN_shaded
>  |   Code |    1st |    2nd |
>  |--------+--------+--------|
>  | 361-94 | 830.00 | 830.00 |
>  | 364-91 |   0.00 | 347.00 |
> #+END_shaded
>
>  But =org-special-blocks= turns out to be incompatible with Org- 
> babel, and
>  since the latter grows in importance...
>
>
> * Essays
>
>  All of the following essays fail, in that the tables are copied  
> verbatim in
>  the TeX output file. That is, the columns are not replaced by the  
> correct
>  code (with ampersand as separator).
>
> ** Embedding LaTeX
>
> \begin{shaded}
>  |   Code |    1st |    2nd |
>  |--------+--------+--------|
>  | 361-94 | 830.00 | 830.00 |
>  | 364-91 |   0.00 | 347.00 |
> \end{shaded}

The content of an environment will be exported literally.

>
>
> ** Quoting LaTeX code
>
> #+LaTeX: \begin{shaded}
>  |   Code |    1st |    2nd |
>  |--------+--------+--------|
>  | 361-94 | 830.00 | 830.00 |
>  | 364-91 |   0.00 | 347.00 |
> #+LaTeX: \end{shaded}

Here is a dirty trick that might work.  Environments are only detected  
if they are the first thing in a new line:

#+LaTeX: {}\begin{shaded}
  |   Code |    1st |    2nd |
  |--------+--------+--------|
  | 361-94 | 830.00 | 830.00 |
  | 364-91 |   0.00 | 347.00 |
#+LaTeX: \end{shaded}

HTH

- Carsten

>
>
> ** Quoting LaTeX code à la Org-babel?
>
> #+BEGIN_SRC shaded
>  |   Code |    1st |    2nd |
>  |--------+--------+--------|
>  | 361-94 | 830.00 | 830.00 |
>  | 364-91 |   0.00 | 347.00 |
> #+END_SRC
>
>
> ** Alternatives...
>
>   Is there any other working alternative to get the power of Org  
> tables and
>   LaTeX code surrounding them, in order to get this:
>
> \begin{shaded}
> \begin{tabular}{rrr}
>   Code  &     1st  &     2nd  \\
> \hline
> 361-94  &  830.00  &  830.00  \\
> 364-91  &    0.00  &  347.00  \\
> \end{tabular}
> \end{shaded}
>
> Best regards,
>  Seb
>
> -- 
> Sébastien Vauban
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org and LaTeX tables
  2010-01-06 10:43 ` Carsten Dominik
@ 2010-01-06 11:10   ` Sébastien Vauban
  2010-01-06 13:27     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Vauban @ 2010-01-06 11:10 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Carsten,

Carsten Dominik wrote:
> On Jan 6, 2010, at 11:29 AM, Sébastien Vauban wrote:
>>
>>  In the PDF output, I need to have tables somehow highlighted. For example,
>>  by placing a border around them, or by putting a background color.
>>
>>  Some months ago, I did that by using =org-special-blocks=, such in the
>>  following example:
>>
>> #+BEGIN_shaded
>>  |   Code |    1st |    2nd |
>>  |--------+--------+--------|
>>  | 361-94 | 830.00 | 830.00 |
>>  | 364-91 |   0.00 | 347.00 |
>> #+END_shaded
>>
>>  But =org-special-blocks= turns out to be incompatible with Org- babel, and
>>  since the latter grows in importance...
>>
>> ** Quoting LaTeX code
>>
>> #+LaTeX: \begin{shaded}
>>  |   Code |    1st |    2nd |
>>  |--------+--------+--------|
>>  | 361-94 | 830.00 | 830.00 |
>>  | 364-91 |   0.00 | 347.00 |
>> #+LaTeX: \end{shaded}
>>
>>   Is there any other working alternative to get the power of Org tables and
>>   LaTeX code surrounding them, in order to get this:
>>
>> \begin{shaded}
>> \begin{tabular}{rrr}
>>   Code  &     1st  &     2nd  \\
>> \hline
>> 361-94  &  830.00  &  830.00  \\
>> 364-91  &    0.00  &  347.00  \\
>> \end{tabular}
>> \end{shaded}
>
> Here is a dirty trick that might work. Environments are only detected if
> they are the first thing in a new line:
>
> #+LaTeX: {}\begin{shaded}
>  |   Code |    1st |    2nd |
>  |--------+--------+--------|
>  | 361-94 | 830.00 | 830.00 |
>  | 364-91 |   0.00 | 347.00 |
> #+LaTeX: \end{shaded}

That DOES work. Thanks a lot.

Now, regarding "long term" (whatever it means), can I count on that feature to
still be supported in the future?

Or would/should such a feature be implemented in a different manner?  Am I the
only one having that need?  Can others give a feedback on this?

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Org and LaTeX tables
  2010-01-06 11:10   ` Sébastien Vauban
@ 2010-01-06 13:27     ` Carsten Dominik
  2010-01-06 15:42       ` Eric Schulte
  2010-01-20 13:45       ` Sébastien Vauban
  0 siblings, 2 replies; 6+ messages in thread
From: Carsten Dominik @ 2010-01-06 13:27 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode


On Jan 6, 2010, at 12:10 PM, Sébastien Vauban wrote:

> Hi Carsten,
>
> Carsten Dominik wrote:
>> On Jan 6, 2010, at 11:29 AM, Sébastien Vauban wrote:
>>>
>>> In the PDF output, I need to have tables somehow highlighted. For  
>>> example,
>>> by placing a border around them, or by putting a background color.
>>>
>>> Some months ago, I did that by using =org-special-blocks=, such in  
>>> the
>>> following example:
>>>
>>> #+BEGIN_shaded
>>> |   Code |    1st |    2nd |
>>> |--------+--------+--------|
>>> | 361-94 | 830.00 | 830.00 |
>>> | 364-91 |   0.00 | 347.00 |
>>> #+END_shaded
>>>
>>> But =org-special-blocks= turns out to be incompatible with Org-  
>>> babel, and
>>> since the latter grows in importance...
>>>
>>> ** Quoting LaTeX code
>>>
>>> #+LaTeX: \begin{shaded}
>>> |   Code |    1st |    2nd |
>>> |--------+--------+--------|
>>> | 361-94 | 830.00 | 830.00 |
>>> | 364-91 |   0.00 | 347.00 |
>>> #+LaTeX: \end{shaded}
>>>
>>>  Is there any other working alternative to get the power of Org  
>>> tables and
>>>  LaTeX code surrounding them, in order to get this:
>>>
>>> \begin{shaded}
>>> \begin{tabular}{rrr}
>>>  Code  &     1st  &     2nd  \\
>>> \hline
>>> 361-94  &  830.00  &  830.00  \\
>>> 364-91  &    0.00  &  347.00  \\
>>> \end{tabular}
>>> \end{shaded}
>>
>> Here is a dirty trick that might work. Environments are only  
>> detected if
>> they are the first thing in a new line:
>>
>> #+LaTeX: {}\begin{shaded}
>> |   Code |    1st |    2nd |
>> |--------+--------+--------|
>> | 361-94 | 830.00 | 830.00 |
>> | 364-91 |   0.00 | 347.00 |
>> #+LaTeX: \end{shaded}
>
> That DOES work. Thanks a lot.
>
> Now, regarding "long term" (whatever it means), can I count on that  
> feature to
> still be supported in the future?
>
> Or would/should such a feature be implemented in a different  
> manner?  Am I the
> only one having that need?  Can others give a feedback on this?

I think Chris Gray's special blocks were actually not a bad idea
for this kind of problem.  What is the source of the
incompatibility with babel?

- Carsten

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Org and LaTeX tables
  2010-01-06 13:27     ` Carsten Dominik
@ 2010-01-06 15:42       ` Eric Schulte
  2010-01-20 13:45       ` Sébastien Vauban
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Schulte @ 2010-01-06 15:42 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Sébastien Vauban, emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Jan 6, 2010, at 12:10 PM, Sébastien Vauban wrote:

[...]

> I think Chris Gray's special blocks were actually not a bad idea
> for this kind of problem.  What is the source of the
> incompatibility with babel?
>

I'd be interested to hear this as well -- if babel is trampling on other
block types that is something I would very much want to correct -- Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org and LaTeX tables
  2010-01-06 13:27     ` Carsten Dominik
  2010-01-06 15:42       ` Eric Schulte
@ 2010-01-20 13:45       ` Sébastien Vauban
  1 sibling, 0 replies; 6+ messages in thread
From: Sébastien Vauban @ 2010-01-20 13:45 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Carsten and Eric,

Carsten Dominik wrote:
> On Jan 6, 2010, at 12:10 PM, Sébastien Vauban wrote:
>> Carsten Dominik wrote:
>>> On Jan 6, 2010, at 11:29 AM, Sébastien Vauban wrote:
>>>>
>>>> In the PDF output, I need to have tables somehow highlighted. For example:
>>>>
>>>> #+LaTeX: \begin{shaded}
>>>> |   Code |    1st |    2nd |
>>>> |--------+--------+--------|
>>>> | 361-94 | 830.00 | 830.00 |
>>>> | 364-91 |   0.00 | 347.00 |
>>>> #+LaTeX: \end{shaded}
>>>>
>>>> Is there any other working alternative to get the power of Org tables and
>>>> LaTeX code surrounding them?
>>>
>>> Here is a dirty trick that might work. Environments are only detected if
>>> they are the first thing in a new line:
>>>
>>> #+LaTeX: {}\begin{shaded}
>>> |   Code |    1st |    2nd |
>>> |--------+--------+--------|
>>> | 361-94 | 830.00 | 830.00 |
>>> | 364-91 |   0.00 | 347.00 |
>>> #+LaTeX: \end{shaded}
>>
>> That DOES work. Thanks a lot.
>>
>> Now, regarding "long term" (whatever it means), can I count on that feature
>> to still be supported in the future?
>>
>> Or would/should such a feature be implemented in a different manner? Am I
>> the only one having that need? Can others give a feedback on this?
>
> I think Chris Gray's special blocks were actually not a bad idea for this
> kind of problem.

Sure, they're a really nice and intuitive way to do.


> What is the source of the incompatibility with babel?

I vaguely remember something went wrong with verbatim stuff. But I honestly
have had no problems with org-special-blocks [¹] + org-babel for the last
couple of days, since I re-enable it. So, was my problem transient?  Was it
something else?  I can't tell exactly anymore.

So, I now have both enabled by default in my .emacs, and they love each other
right now.

Best regards,
  Seb

[¹] but the problems described in my previous post ("Error when exporting to
    LaTeX")... Partly, but not only it seems, the lack of way to pass
    parameters along with the environment.

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-20 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-06 10:29 Org and LaTeX tables Sébastien Vauban
2010-01-06 10:43 ` Carsten Dominik
2010-01-06 11:10   ` Sébastien Vauban
2010-01-06 13:27     ` Carsten Dominik
2010-01-06 15:42       ` Eric Schulte
2010-01-20 13:45       ` Sébastien Vauban

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