# LyX 2.3.x: how to insert externally generated code for table?

Andrew Parsloe ajparsloe at gmail.com
Thu Mar 5 04:19:00 UTC 2020

On 5/03/2020 5:10 am, Bernt Lie wrote:
>
> I’m running a program which generates LaTeX code for a table.
>
> Question:
>
>   * How can I insert this table into LyX?
>   * I want the table to have the same type of preview as Tables I set
>     up manually inside of LyX
>   * I want the table to be a floating table.
>   * Such tables may be large, so I may want to make it multi-page, and
>     possibly rotate it.
>
> Example:
>
>
> \begin{tabular}{rrr} \hline\hline \textbf{Temperature [K]} &
> \textbf{Pressure [bar]} & \textbf{Specific volume liq [m3/kg.1e3]} \\
> \texttt{Float64} & \texttt{Float64} & \texttt{Float64} \\\hline 273.15
> & 0.00611 & 1.0 \\ 275.0 & 0.00697 & 1.0 \\ 280.0 & 0.0099 & 1.0 \\
> 285.0 & 0.01387 & 1.0 \\ 290.0 & 0.01917 & 1.001 \\\hline\hline
> \end{tabular}
>
> Can I insert the table within LyX? Or do I have to insert the table in
> a LyX document and insert the code via an ASCII editor?
>
> Thanks for suggestions!
>
> BR,
>
> B
>
>
One way is to put an ert inset inside a preview inset inside a table
float and paste the table code into the ert inset. Move the cursor
outside the float and wait while preview does its thing. I did just that
and attach the result.

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20200305/d6069ed9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table.png
Type: image/png
Size: 21781 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20200305/d6069ed9/attachment-0001.png>