On 5/22/19 10:51 AM, Paul Smith wrote:
Dear All,
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.
Thanks in advance,
Paul
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.
Paul