As far as I can see, there is no way to use \cline in an array environment via the LyX GUI. Therefore, to use the GUI to create the table-like structure, one has to use a tabular: Insert --> Table. It is not an ideal solution, as each cell has to be placed in (inline) math mode. The code below is a .lyx file with an example, copy the code into a text editor and save the file as something.lyx.
Things to note:
- I don't know if this is the kind of layout you'd like.
- The lines are added via the table toolbar, just select the cells you want underlined, and click the appropriate button.
- The intercolumn spacing has been removed from some of the columns, by adding a custom column declaration in the table settings. Right click a cell --> More ... --> Settings. In the LaTeX argument box you'll see something like
@{}r, which creates a right aligned column with the column padding before the column removed.
- The empty braces (
{}) before the plus signs is to ensure the right spacing. When writing $+4$, the plus is a unary relation, while with ${}+4$ it is a binary relation, which you want.
- I added a phantom
) in row 1, column 2, as in Peter Grill's answer, to improve alignment.
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\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 false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\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 Tabular
<lyxtabular version="3" rows="5" columns="4">
<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt" special="@{}r">
<column alignment="center" valignment="top" width="0pt" special="@{}r">
<column alignment="center" valignment="top" width="0pt" special="@{}r@{}">
<column alignment="center" valignment="top" width="0pt" special="l">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $x^{2}$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}+4x\phantom{)}$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}:x+2=x+2$
\end_inset
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $-(x^{2}$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}+2x)$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $2x$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $2x$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $0$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\end_body
\end_document
There is no simpler way?
– heblyx Jan 10 '14 at 08:40array, so you could of course create anarrayvia the LyX GUI, i.e. Insert --> Math --> Array environment. – Torbjørn T. Jan 10 '14 at 08:52Thank you!
– heblyx Jan 10 '14 at 09:55\clinein anarrayvia the GUI. You can achieve the same effect in a normaltabular, but I didn't immediately see a way witharray. Have to look at this later, don't really have time right now. – Torbjørn T. Jan 10 '14 at 10:21