From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: Re: orgmod: R and threeparttable Date: Sat, 14 Dec 2013 14:48:27 +0100 Message-ID: References: <87sitvakg6.fsf@gmail.com> <87ob4jae2y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0160c35e56561004ed7ed55d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vrpa6-0003T4-7r for emacs-orgmode@gnu.org; Sat, 14 Dec 2013 08:48:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vrpa0-00030H-UL for emacs-orgmode@gnu.org; Sat, 14 Dec 2013 08:48:34 -0500 Received: from mail-ob0-f182.google.com ([209.85.214.182]:46276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vrpa0-00030B-Me for emacs-orgmode@gnu.org; Sat, 14 Dec 2013 08:48:28 -0500 Received: by mail-ob0-f182.google.com with SMTP id wp4so3168714obc.27 for ; Sat, 14 Dec 2013 05:48:27 -0800 (PST) In-Reply-To: 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --089e0160c35e56561004ed7ed55d Content-Type: text/plain; charset=ISO-8859-1 Nicolas, Special blocks seem to work very well, actually. Thank you. This is what you had proposed: #+begin_threeparttable ... tabular with Org syntax ... #+begin_tablenotes ... probably some raw LaTeX... #+end_tablenotes #+end_threeparttable It seem to work beautifully even when the table is a result of a source code block. My experiments suggest that when the result changes, on account of evaluating the source code block again, the special block structure around is respected. Super. I am amazed. Thank you. I bow. Vikas On Sat, Dec 14, 2013 at 1:06 PM, Vikas Rawal < vikaslists@agrarianresearch.org> wrote: > > > > On Sat, Dec 14, 2013 at 12:04 PM, Nicolas Goaziou wrote: > >> Vikas Rawal writes: >> >> > I do not know if I am expressing myself clearly. The table is being >> > generated by an R source code. We need a way of adding notes to such a >> > table. >> >> There are two different problems: >> >> 1. How to generate "threeparttable" environment using Org syntax and >> `latex' export back-end. >> 2. How to generate Org syntax specified above from a source block. >> >> At the moment, my only concern is point 1. >> >> > Yes, this is right. > > > Unfortunately, on such matters, one has to work with the conventions in > >> > different disciplines. At least in social sciences, it is usually >> expected >> > that notes are placed below Tables and Figures, and not as part of >> > footnotes, which are reserved for notes to text. At least my >> collaborators >> > and readers frown when I put table sources and notes in the footnotes. >> >> Understood. You didn't answer to my suggestion to use special blocks, >> though. >> >> > I do not know how to use special blocks. I will read the manual and see > what can be done with those. I f special blocks cannot give a statisfactory > solution (I do not know), other questions you raise may be relevant in > exploring a better solution. > > >> >> >> If my suggestion to use special blocks doesn't apply, you still need to >> properly define your problem. In particular: >> >> - How table notes are generated? Do you want to hijack footnotes in >> table to produce them? >> > - Should note numbers be configurable? >> > > We should be able to add something to #+RESULTS block. I would think that > the natural way would be to specify threeparttable in #+attr_latex. It > would be ideal to put contents of a footer under a separate headline > (tagged noexport) somewhere in the document with a custom_id property. This > custom_id could be specified along with threeparttable in the above > #+attr_latex. Something like the following: > > #+attr_latex: threeparttable [[notes_custom_id_1]] > #+RESUlTS: > |x|y|z| > |1|2|2| > > * Table notes :noexport: > :PROPERTIES: > :CUSTOM_ID: notes_custom_id_1 > :END: > + first note here > + second note here > + third note here > > - Should "threeparttable" be generated only when table contains at least >> a note and some global option is set to a non-nil value? Or should >> a user explicitly write that he requires such an environment for the >> current table? >> > > I would think threeparttable be generated when you have something like the > above specified in #+attr_latex. > > >> - Can another environment than "tabular" be used within >> "threeparttable"? >> - Is the "table" environment around mandatory? >> - ... >> > > I use tabulary inside threeparttable (that is, when I give raw latex > code). > > The code I used has table environment around it. I am no expert on latex > and I must have put it together using whatever I could find on > threeparttable. I cannot say whether this is mandatory. I am sure other > people on this list would just know this. Otherwise, I can experiment. > > I am really stretching my capabilities and knowledge of org. So, please > excuse me, if what I said is nonsensical. > > Vikas > > > --089e0160c35e56561004ed7ed55d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Nicolas,

Special blocks seem to= work very well, actually. Thank you.

This is what you ha= d proposed:

#+begin_threeparttable
=A0 ...
=A0 tabular with Org syntax
=A0 ...
=A0 #+begin_tablenotes
=A0 ... probably some raw LaTeX...
=A0 #+end_tablenotes
=A0 #+end_threeparttable

It seem to work beautifully even when the table is a result of= a source code block. My experiments suggest that when the result changes, = on account of evaluating the source code block again, the special block str= ucture around is respected.

Super. I am amazed.

Thank you.<= br>
I bow.

Vikas


On Sat, Dec 14, 2013 at 1:06 PM, Vikas R= awal <vikaslists@agrarianresearch.org> wrote:<= br>



On Sat, Dec 14, 2013 at 12:04 PM, Nicolas Goaziou= <n.goaziou@gmail.com> wrote:
Vikas Rawal <vikaslists= @agrarianresearch.org> writes:

> I do not know if I am expressing myself clearly. The table is being > generated by an R source code. We need a way of adding notes to such a=
> table.

There are two different problems:

=A0 1. How to generate "threeparttable" environment using Org syn= tax and
=A0 =A0 =A0`latex' export back-end.
=A0 2. How to generate Org syntax specified above from a source block.

At the moment, my only concern is point 1.


Yes, this is right.
> Unfortunately, on such matters, one has = to work with the conventions in
> different disciplines. At least in social sciences, it is usually expe= cted
> that notes are placed below Tables and Figures, and not as part of
> footnotes, which are reserved for notes to text. At least my collabora= tors
> and readers frown when I put table sources and notes in the footnotes.=

Understood. You didn't answer to my suggestion to use special blo= cks,
though.


I do not know how to = use special blocks. I will read the manual and see what can be done with th= ose. I f special blocks cannot give a statisfactory solution (I do not know= ), other questions you raise may be relevant in exploring a better solution= .

=A0

If my suggestion to use special blocks doesn't apply, you still n= eed to
properly define your problem. In particular:

- How table notes are generated? Do you want to hijack footnotes in
=A0 table to produce them?
- Should note numbers be configurable?

We should be able to add something to #+RESULTS block. I would think that the= natural way would be to specify threeparttable in #+attr_latex. It would b= e ideal to put contents of a footer under a separate headline (tagged noexp= ort) somewhere in the document with a custom_id property. This custom_id co= uld be specified along with threeparttable in the above #+attr_latex. Somet= hing like the following:

#+attr_latex: threeparttable [[notes_custom_id_1]]
=
#+RESUlTS:
|x|y|z|
|1|2|2|

* Table = notes=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 :noexport:
:PROPERTIES: :CUSTOM_ID: notes_custom_id_1
:END:
+ first note here
<= /div>
+ second note here
+ third note here

- Should "threeparttable" be generated only when table contains a= t least
=A0 a note and some global option is set to a non-nil value? Or should
=A0 a user explicitly write that he requires such an environment for the =A0 current table?

I would think = threeparttable be generated when you have something like the above specifie= d in #+attr_latex.
=A0
- Can another environment than "tabular" be used within
=A0 "threeparttable"?
- Is the "table" environment around mandatory?
- ...

I use tabulary inside three= parttable (that is, when I give raw latex code).

The cod= e I used has table environment around it. I am no expert on latex and I mus= t have put it together using whatever I could find on threeparttable. I can= not say whether this is mandatory. I am sure other people on this list woul= d just know this. Otherwise, I can experiment.

I am really stretching my capabilities and knowledge of org. So, p= lease excuse me, if what I said is nonsensical.

Vikas



--089e0160c35e56561004ed7ed55d--