On Wed, May 22, 2019 at 4:28 PM Paul A. Rubin <[email protected]> wrote:
>
> > Where can one find the specifications of the LyX file format for tables?
> >
> > The reason why I am asking that is because I have a bunch of tables
> > that I want to export from R to a single LyX document, and the
> > approach I am considering is to produce in R a text file in LyX format
> > with all my tables inserted.
> >
> I'm not sure if there is explicit documentation of the syntax for tables
> in LyX. You can create a small sample table with the desired format in
> LyX, open the code pane (View > Code Preview Pane) and set the format
> for the pane to LyX. That will show you what your sample table would
> look like in a LyX source file.
>
> I wonder if there might not be an easier way, though. There are several
> functions/packages in R that are designed for producing nice looking
> tables (including xtable and the kable() function from knitr), and a
> number of them have the option of generating LaTeX output. So you could
> have your R script generate the desired tables with the desired format
> and write them all to a LaTeX text file, then import that into LyX (File
>  > Import > LaTeX (plain), and copy/paste them where they are needed in
> your actual document.

Thanks, Paul. I imagined your "View > Code Preview Pane" idea, but I
though it would be easier to read the documentation, if there is some.
(The file format of tables in LyX does not appear to be simple.)

Regarding your other idea -- using xtable() or ktable -- I guess it is
not very practical in my case, as I have too many table (about 50
tables), and therefore I would like to insert all of them in their
right place in the LyX document, to avoid the work of copying and
pasting 50 times!

Paul

Reply via email to