Re: How to insert a tabular array to LyX

2022-08-17 Thread Udicoudco
‫

> >
> > I want to insert a tblr environment (from the tabularray package) into
> my lyx document.
> >
> > I read that currently LyX supports only tabular environments for tables,
> and not even tabularx.
> >
> > But still I would like to get some thoughts or ideas from the members
> how to insert (graphically, not through ERT) something like the following
> environment:
> >
> > >\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
> > >item 1
> > >\\
> > >item 2
> > >\\
> > >item 3
> > >\end{tblr}
> >
> > Thanks very much.
>
> You could redefine the tabular environment used by LyX. However, you
> cannot use the GUI for setting tabular properties. Another difficulty is
> the fact that LyX uses \tabularnewline instead of \\ to end a line and,
> seemingly, the tabularray package does not understand it. So you have
> also to redefine \tabularnewline and remember to add \\ in ERT at the
> end of each table line.
>
> Arguments such as "width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines"
> can be passed through the "LaTeX argument" in the "Tabular Settings"
> paying attention to avoid any space character.
>
> See the attached example containing two examples in both ERT and a
> somewhat LyXfied form as explained above. This last form is marginally
> better than the ERT one.
>
> --
> Enrico
>


Hello Enrico,

You can overcome the \tabularnewline problem more easily if you will
replace "\renewenvironment{tabular}{\begin{tblr}[t]}{\end{tblr}}"  in the
preamble with
"\renewenvironment{tabular}{\begin{tblr}[t,expand=\tabularnewline]}{\end{tblr}}",
this way you won't have to add "\\'' manually at the end of a line.  See
the attached file.

Regards,
Udi


newfile1.lyx
Description: application/lyx
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to insert a tabular array to LyX

2022-08-17 Thread Enrico Forestieri
On Sat, Jul 30, 2022 at 05:42:50PM +, tush via lyx-users wrote:
> 
> I want to insert a tblr environment (from the tabularray package) into my lyx 
> document.
> 
> I read that currently LyX supports only tabular environments for tables, and 
> not even tabularx.
> 
> But still I would like to get some thoughts or ideas from the members how to 
> insert (graphically, not through ERT) something like the following 
> environment:
> 
> >\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
> >item 1
> >\\
> >item 2
> >\\
> >item 3
> >\end{tblr}
> 
> Thanks very much.

You could redefine the tabular environment used by LyX. However, you
cannot use the GUI for setting tabular properties. Another difficulty is
the fact that LyX uses \tabularnewline instead of \\ to end a line and,
seemingly, the tabularray package does not understand it. So you have
also to redefine \tabularnewline and remember to add \\ in ERT at the
end of each table line.

Arguments such as "width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines"
can be passed through the "LaTeX argument" in the "Tabular Settings"
paying attention to avoid any space character.

See the attached example containing two examples in both ERT and a
somewhat LyXfied form as explained above. This last form is marginally
better than the ERT one.

-- 
Enrico
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage{tabularray,xcolor}
\renewenvironment{tabular}{\begin{tblr}[t]}{\end{tblr}}
\def\tabularnewline{\relax}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1cm
\topmargin 2cm
\rightmargin 1cm
\bottommargin 2cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
\end_layout

\begin_layout Plain Layout

item 1
\end_layout

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\begin_layout Plain Layout

item 2
\end_layout

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\begin_layout Plain Layout

item 3
\end_layout

\begin_layout Plain Layout


\backslash
end{tblr}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Tabular





\begin_inset Text

\begin_layout Plain Layout
item 1
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\end_inset


\end_layout

\end_inset




\begin_inset Text

\begin_layout Plain Layout
item 2
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\end_inset


\end_layout

\end_inset




\begin_inset Text

\begin_layout Plain Layout
item 3
\end_layout

\end_inset




\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
begin{tblr}{
\end_layout

\begin_layout Plain Layout

colspec = {rX}, colsep = 8mm, hlines = {2pt, white},
\end_layout

\begin_layout Plain Layout

row{odd} = {azure8}, row{even} = {gray8},
\end_layout

\begin_layout Plain Layout

row{1} = {6em,azure2,fg=white,font=
\backslash
LARGE
\backslash
bfseries
\backslash
sffamily},
\end_layout

\begin_layout Plain Layout

row{2-Z} = {3em,font=
\backslash
Large},
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

Tabularray & Typeset Tabulars and Arrays with 
\backslash
LaTeX3 
\backslash


Re: How to insert a tabular array to LyX

2022-08-03 Thread Udicoudco
‫

> On Jul 30, 2022, 18:42, tush via lyx-users < lyx-users@lists.lyx.org>
> wrote:
>
>
> I want to insert a tblr environment (from the tabularray package) into my
> lyx document.
>
> I read that currently LyX supports only tabular environments for tables,
> and not even tabularx.
>
> But still I would like to get some thoughts or ideas from the members how
> to insert (graphically, not through ERT) something like the following
> environment:
>
> >\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
> >item 1
> >\\
> >item 2
> >\\
> >item 3
> >\end{tblr}
>
> Thanks very much.
>
>
Hello Ehud,

I am not sure if the last message  I've sent was received as it  does not
appear in the mail list archive.
I wrote a module to solve your problem, you can get it here
.  I apologize in
advance for any misspelling in the example file, as I am not a native
english speaker. Please read section 3 in Tabularray.pdf before you start
to use the module.

Regards,
Udi

-- 
> lyx-users mailing list
> lyx-users@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-users
>
>
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to insert a tabular array to LyX

2022-08-02 Thread tush via lyx-users
If anyone have any thing to say about this issue, I would be very glad to hear.

Regards

 Original Message 
On Jul 30, 2022, 18:42, tush via lyx-users wrote:

> I want to insert a tblr environment (from the tabularray package) into my lyx 
> document.
>
> I read that currently LyX supports only tabular environments for tables, and 
> not even tabularx.
>
> But still I would like to get some thoughts or ideas from the members how to 
> insert (graphically, not through ERT) something like the following 
> environment:
>
>>\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
>>item 1
>>\\
>>item 2
>>\\
>>item 3
>>\end{tblr}
>
> Thanks very much.-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


How to insert a tabular array to LyX

2022-07-30 Thread tush via lyx-users
I want to insert a tblr environment (from the tabularray package) into my lyx 
document.

I read that currently LyX supports only tabular environments for tables, and 
not even tabularx.

But still I would like to get some thoughts or ideas from the members how to 
insert (graphically, not through ERT) something like the following environment:

>\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
>item 1
>\\
>item 2
>\\
>item 3
>\end{tblr}

Thanks very much.-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users