]> git.lyx.org Git - features.git/blobdiff - lib/doc/EmbeddedObjects.lyx
EmbeddedObjects.lyx: describe the new table cell alignment feature
[features.git] / lib / doc / EmbeddedObjects.lyx
index a50f9c7a24583efc1e6eeaf8c384a4e00546dde3..8aacb638e80514e9fe93139d8a7e75445c393b85 100644 (file)
@@ -56,9 +56,6 @@
 % enables calculation of values,
 \usepackage{calc}
 
-% provides special table cell alignments
-\usepackage{dcolumn}
-
 % increase the bottom float placement fraction
 \renewcommand{\bottomfraction}{0.5}
 
@@ -2026,6 +2023,30 @@ Settings
 \family default
  Here you can set the horizontal alignment and the width of the current
  column.
+ The alignment 
+\family sans
+At
+\begin_inset space ~
+\end_inset
+
+Decimal
+\begin_inset space ~
+\end_inset
+
+Separator
+\family default
+ is described in section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Special-Cell-Alignment"
+
+\end_inset
+
+.
  When you have set a width you can also adjust the vertical alignment of
  the current row.
  A given width will allow the cell to have line breaks and multiple paragraphs
@@ -16616,6 +16637,13 @@ Huger
 
 \begin_layout Subsection
 Special Cell Alignment
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Special-Cell-Alignment"
+
+\end_inset
+
+
 \begin_inset Index idx
 status collapsed
 
@@ -16645,11 +16673,38 @@ with the decimal separator as in Table
 
 \begin_inset CommandInset ref
 LatexCommand ref
-reference "tab:Table-cells-of"
+reference "tab:Table-cells-align"
+
+\end_inset
 
+.
+ This alignment is achieved by highlighting the last 3
+\begin_inset space ~
+\end_inset
+
+cells of the column and then either pressing the toolbar button 
+\begin_inset Graphics
+       filename ../images/tabular-feature_align-decimal.png
+       scale 85
+       scaleBeforeRotation
+
+\end_inset
+
+ or setting the alignment in the table settings to 
+\family sans
+At
+\begin_inset space ~
+\end_inset
+
+Decimal
+\begin_inset space ~
 \end_inset
 
+Separator
+\family default
 .
+ The alignment character can be a character of your choice and is specified
+ in the table settings.
 \end_layout
 
 \begin_layout Standard
@@ -16665,7 +16720,7 @@ status open
 \begin_layout Plain Layout
 \begin_inset CommandInset label
 LatexCommand label
-name "tab:Table-cells-of"
+name "tab:Table-cells-align"
 
 \end_inset
 
@@ -16675,15 +16730,102 @@ Table cells of a column aligned with the decimal separator.
 \end_inset
 
 
+\end_layout
+
+\begin_layout Plain Layout
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="1">
+<features booktabs="true" tabularvalignment="middle">
+<column alignment="decimal" decimal_point="." valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+heading
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+12.6
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0.68
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+-123.0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float table
+placement h
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset Caption
+
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
+name "tab:Table-align-operator"
+
+\end_inset
+
+Table cells of a column aligned with the operators.
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Plain Layout
 \align center
 \begin_inset Tabular
 <lyxtabular version="3" rows="4" columns="2">
-<features tabularvalignment="middle">
-<column alignment="right" valignment="top" width="0">
-<column alignment="left" valignment="top" width="0" special="@{}l">
+<features booktabs="true" tabularvalignment="middle">
+<column alignment="right" valignment="top" width="0pt">
+<column alignment="left" valignment="top" width="0pt" special="@{}l">
 <row>
 <cell multicolumn="1" alignment="center" valignment="top" bottomline="true" usebox="none">
 \begin_inset Text
@@ -16709,7 +16851,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
-12.
+\begin_inset Formula $12\,+$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16718,7 +16863,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
-6
+\begin_inset Formula $\,6$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16729,7 +16877,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
-0.
+\begin_inset Formula $0\,-$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16738,7 +16889,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
-68
+\begin_inset Formula $\,68$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16749,7 +16903,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
--123.
+\begin_inset Formula $-123\,/$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16758,7 +16915,10 @@ heading
 \begin_inset Text
 
 \begin_layout Plain Layout
-0
+\begin_inset Formula $\,0$
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -16777,12 +16937,27 @@ heading
 \end_layout
 
 \begin_layout Standard
-This table was created with a 4×2 table.
+For alignments at characters in formulas this method does not work because
+ the field to specify the alignment character does not allow formulas.
+ In this case one need to use the method from Table
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "tab:Table-align-operator"
+
+\end_inset
+
+.
+ This table was created with a 4×2 table.
  The heading is a centered multicolumn.
- The first column is right-aligned and contains the digits before the decimal
- point and the decimal point.
- The second column is left aligned and contains the digits after the decimal
- point.
+ The first column is right-aligned and contains the first part including
+ the operator.
+ The second column is left aligned and contains the rest.
+ A small space was added at the beginning of each cell of the second column
+ to get the space that is usually around operators.
  To omit the space that is normally between two table columns, the following
  LaTeX-argument was used for the second column:
 \end_layout
@@ -16806,9 +16981,19 @@ reference "tab:Several-table-cell"
 \end_inset
 
  shows some example alignments.
- For the alignment with the relation sign, you must add the second smallest
- math-space at the beginning of the last column to get the correct space
- surrounding the relation sign.
+ For the alignment with the relation sign, a small space was added like
+ for the second column of Table
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "tab:Table-align-operator"
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Standard
 \end_inset
 
 
-\end_layout
-
-\begin_layout Standard
-\begin_inset VSpace bigskip
-\end_inset
-
-There is also the LaTeX-package 
-\series bold
-dcolumn
-\series default
-
-\begin_inset Index idx
-status collapsed
-
-\begin_layout Plain Layout
-LaTeX-packages ! dcolumn
-\end_layout
-
-\end_inset
-
- that provides table cell alignments.
- But this unfortunately treats the cell entries as math and does not allow
- formulas in table cells: The first column of Table
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "tab:Several-table-cell"
-
-\end_inset
-
- will look with 
-\series bold
-dcolumn
-\series default
- like the first column in Table
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "tab:Alignments-when"
-
-\end_inset
-
- and only with some tricks as you would want.
- The alignment of the second and third column of Table
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "tab:Several-table-cell"
-
-\end_inset
-
- is not possible with 
-\series bold
-dcolumn
-\series default
-.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-placement h
-wide false
-sideways false
-status open
-
-\begin_layout Plain Layout
-\begin_inset Caption
-
-\begin_layout Plain Layout
-\begin_inset CommandInset label
-LatexCommand label
-name "tab:Alignments-when"
-
-\end_inset
-
-Alignments when LaTeX-package dcolumn is used.
- For all column alignments tricks have to be used to get the output.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Plain Layout
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="4" columns="3">
-<features tabularvalignment="middle">
-<column alignment="center" valignment="top" width="0" special="D{x}{\times}{-1}">
-<column alignment="center" valignment="top" width="0" special="D{x}{\times}{4.9}">
-<column alignment="center" valignment="top" width="0" special="D{+}{\,}{9.7}">
-<row>
-<cell multicolumn="1" alignment="center" valignment="top" bottomline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-units
-\end_layout
-
-\end_inset
-</cell>
-<cell multicolumn="1" alignment="center" valignment="top" bottomline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-units
-\end_layout
-
-\end_inset
-</cell>
-<cell multicolumn="1" alignment="center" valignment="top" bottomline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-units
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-12x24
-\begin_inset space \thinspace{}
-\end_inset
-
-bottles
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-12x24
-\begin_inset space \thinspace{}
-\end_inset
-
-
-\begin_inset Formula $\mbox{bottles}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-12
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-times 
-\end_layout
-
-\end_inset
-
-24+
-\begin_inset Formula $\mbox{bottles}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-1024x768
-\begin_inset space \thinspace{}
-\end_inset
-
-Pixels
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-1024x768
-\begin_inset space \thinspace{}
-\end_inset
-
-
-\begin_inset Formula $\mbox{Pixels}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-1024
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-times 
-\end_layout
-
-\end_inset
-
-768+
-\begin_inset Formula $\mbox{Pixels}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-32x6
-\begin_inset space \thinspace{}
-\end_inset
-
-cm
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-32x6
-\begin_inset space \thinspace{}
-\end_inset
-
-
-\begin_inset Formula $\mbox{cm}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-32
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-times 
-\end_layout
-
-\end_inset
-
-6+
-\begin_inset Formula $\mbox{cm}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Subsection