mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
EmbeddedObjects.lyx: add section about the calculation of the table width
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40236 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
76e90badc0
commit
900787723e
@ -11234,7 +11234,7 @@ Franz
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Multiple Lines Columns and Rows
|
||||
Multiple Lines, Columns and Rows
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
@ -16614,6 +16614,322 @@ arrayrulewidth}{0.4pt}
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Table Width Calculation
|
||||
\begin_inset CommandInset label
|
||||
LatexCommand label
|
||||
name "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
For wide tables it is sometimes difficult to assure that the table does
|
||||
not protrude over the page margin.
|
||||
Setting a fixed width for every column of the table is the solution, but
|
||||
what amount of space is needed for each column?
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
The table width
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
can be calculated: Every column has the width of the specified column width
|
||||
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
(that the content of the column can consume) plus two times the separation
|
||||
between the column content and the column border (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
tabcolsep
|
||||
\series default
|
||||
, default 6
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt) plus the width of a border line (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
arrayrulewidth
|
||||
\series default
|
||||
, default 0.4
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt): So if all
|
||||
\begin_inset Formula $n$
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
columns have the same width, the table width is
|
||||
\begin_inset Formula
|
||||
\begin{equation}
|
||||
W_{\mathrm{table}}=n\left(W_{\mathrm{column}}+2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)+\backslash\mbox{arrayrulewidth}
|
||||
\end{equation}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
The available width for a table is the space between the page margins or
|
||||
the width of a text column (for a two-column document) (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
columnwidth
|
||||
\series default
|
||||
).
|
||||
If all table columns should have the same width and
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
should be 1
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
|
||||
\backslash
|
||||
columnwidth,
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
can easily be calculated.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
To be able to perform calculations you need to load the LaTeX-package
|
||||
\series bold
|
||||
calc
|
||||
\series default
|
||||
|
||||
\begin_inset Index idx
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
LaTeX-packages ! calc
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
in the document preamble.
|
||||
To set the width in the table dialog you have to use the field
|
||||
\family sans
|
||||
LaTeX argument
|
||||
\family default
|
||||
.
|
||||
The command scheme for this field is the same that is explained in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:Multicolumn-Calculations"
|
||||
|
||||
\end_inset
|
||||
|
||||
.
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns with an uniform width and centered text, enter there for each column
|
||||
the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/5}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns where 2 should have 0.75
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
times the width than the 3 others, the calculation is
|
||||
\begin_inset Formula
|
||||
\begin{align}
|
||||
\backslash\mbox{columnwidth} & =3\, W_{\mathrm{column}}+2\cdot0.75\, W_{\mathrm{column}}+\backslash\mbox{arrayrulewidth}\nonumber \\
|
||||
& \phantom{=\,}+5\left(2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)\nonumber \\
|
||||
& =4.5\, W_{\mathrm{column}}+62.4\,\mathrm{pt}\nonumber \\
|
||||
W_{\mathrm{column}} & =\frac{\backslash\mbox{columnwidth}-62.4\,\mathrm{pt}}{4.5}
|
||||
\end{align}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
In the table therefore the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
is used for the wider columns and
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}*
|
||||
\backslash
|
||||
real{0.75}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
for the smaller ones:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Tabular
|
||||
<lyxtabular version="3" rows="2" columns="5">
|
||||
<features tabularvalignment="middle">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
1
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
3
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
4
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
5
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
111111 1111111 111111 111111111 11111 11111 1111
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2222 22222 222222 222222222 2222222 22 22222
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
333333 333333 333333 33333 3333333 333
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
</lyxtabular>
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
@ -18047,7 +18363,18 @@ Table Customization ! Cell/Column Format
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Calculating the required width for spanned columns as in section
|
||||
Calculating the required width for normal columns as described in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
or for spanned columns as described in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
@ -18058,9 +18385,9 @@ reference "sub:Multicolumn-Calculations"
|
||||
|
||||
\end_inset
|
||||
|
||||
is very annoying if you have several tables with multicolumn cells.
|
||||
is very annoying if you have several tables where a calculation is necessary.
|
||||
To make life easier, you can define a cell/column format in the preamble,
|
||||
so that it can be used in all tables of the document.
|
||||
that can be used in all tables of the document.
|
||||
The format is defined with the command
|
||||
\end_layout
|
||||
|
||||
@ -18155,7 +18482,11 @@ M{width}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
as LaTeX-argument in the table dialog to create a multicolumn.
|
||||
as
|
||||
\family sans
|
||||
LaTeX-argument
|
||||
\family default
|
||||
in the table dialog to create a multicolumn.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
@ -16787,6 +16787,328 @@ setzt die Liniendicke wieder auf ihren Standardwert zurück
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
Berechnung der Tabellenbreite
|
||||
\begin_inset CommandInset label
|
||||
LatexCommand label
|
||||
name "sec:Berechnung-der-Tabellenbreite"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Für breite Tabellen ist es manchmal schwierig sicherzustellen, dass die
|
||||
Tabelle nicht über den Seitenrand hinausragt.
|
||||
Das Setzen einer festen Breite für jede Spalte der Tabelle ist die Lösung,
|
||||
aber wie viel Platz wird für jede Spalte benötigt?
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Die Tabellenbreite
|
||||
\begin_inset Formula $W_{\mathrm{Tabelle}}$
|
||||
\end_inset
|
||||
|
||||
kann berechnet werden: Jede Spalte hat die Breite der angegebenen Spaltenbreite
|
||||
|
||||
\begin_inset Formula $W_{\mathrm{Spalte}}$
|
||||
\end_inset
|
||||
|
||||
(die der Inhalt der Spalte belegen kann) plus zweimal den Abstand zwischen
|
||||
Spalteninhalt und dem Rand der Spalte (LaTeX-Länge
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
tabcolsep
|
||||
\series default
|
||||
, Voreinstellung 6
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt) plus die Breite einer Tabellenlinie (LaTeX-Länge
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
arrayrulewidth
|
||||
\series default
|
||||
, Voreinstellung 0.4
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt): Wenn alle
|
||||
\begin_inset Formula $n$
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
Spalten dieselbe Breite haben, ist die Tabellenbreite also
|
||||
\begin_inset Formula
|
||||
\begin{equation}
|
||||
W_{\mathrm{Tabelle}}=n\left(W_{\mathrm{Spalte}}+2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)+\backslash\mbox{arrayrulewidth}
|
||||
\end{equation}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Die verfügbare Breite für eine Tabelle ist der Raum zwischen den Seitenrändern
|
||||
oder die Breite einer Textspalte (für ein zweispaltiges Dokument) (LaTeX-Länge
|
||||
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
columnwidth
|
||||
\series default
|
||||
).
|
||||
Wenn alle Tabellenspalten dieselbe Breite haben sollen und
|
||||
\begin_inset Formula $W_{\mathrm{Tabelle}}$
|
||||
\end_inset
|
||||
|
||||
gleich 1
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
|
||||
\backslash
|
||||
columnwidth sein soll, kann
|
||||
\begin_inset Formula $W_{\mathrm{Spalte}}$
|
||||
\end_inset
|
||||
|
||||
leicht berechnet werden.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Um Berechnungen ausführen zu können, muss das LaTeX-Paket
|
||||
\series bold
|
||||
calc
|
||||
\series default
|
||||
|
||||
\begin_inset Index idx
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
LaTeX-Pakete ! calc
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
im LaTeX-Vorspann geladen werden.
|
||||
Um die Breite im Tabellendialog anzugeben, muss das Feld
|
||||
\family sans
|
||||
LaTeX-Argument
|
||||
\family default
|
||||
verwendet werden.
|
||||
Das Befehlsschema für dieses Feld ist dasselbe, das in Abschnitt
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "uab:Mehrfachspalten-Berechnungen"
|
||||
|
||||
\end_inset
|
||||
|
||||
erklärt ist.
|
||||
Für eine Tabelle mit 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
Spalten mit einer einheitlichen Breite und zentriertem Text, gibt man dort
|
||||
für jede Spalte den Befehl
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/5}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
an.
|
||||
Für eine Tabelle mit 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
Spalten bei der 2 das 0,75
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
fache der Breite der anderen 3
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
Spalten haben sollen, ist die Berechnung
|
||||
\begin_inset Formula
|
||||
\begin{align}
|
||||
\backslash\mbox{columnwidth} & =3\, W_{\mathrm{Spalte}}+2\cdot0,75\, W_{\mathrm{Spalte}}+\backslash\mbox{arrayrulewidth}\nonumber \\
|
||||
& \phantom{=\,}+5\left(2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)\nonumber \\
|
||||
& =4,5\, W_{\mathrm{Spalte}}+62,4\,\mathrm{pt}\nonumber \\
|
||||
W_{\mathrm{Spalte}} & =\frac{\backslash\mbox{columnwidth}-62,4\,\mathrm{pt}}{4,5}
|
||||
\end{align}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
In der Tabelle wird daher der Befehl
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
für die breiteren Spalten verwendet und
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}*
|
||||
\backslash
|
||||
real{0.75}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
für die schmaleren:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Tabular
|
||||
<lyxtabular version="3" rows="2" columns="5">
|
||||
<features tabularvalignment="middle">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
1
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
3
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
4
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
5
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
111111 1111111 111111 111111111 11111 11111 1111
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2222 22222 222222 222222222 2222222 22 22222
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
333333 333333 333333 33333 3333333 333
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
</lyxtabular>
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
@ -18229,16 +18551,29 @@ Wenn man wie in Abschnitt
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sec:Berechnung-der-Tabellenbreite"
|
||||
|
||||
\end_inset
|
||||
|
||||
oder Abschnitt
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "uab:Mehrfachspalten-Berechnungen"
|
||||
|
||||
\end_inset
|
||||
|
||||
die gewünschte Breite einer Mehrfachspalte berechnen will, ist das bei
|
||||
mehreren Tabellen mit Mehrfachspalten sehr lästig.
|
||||
Um sich das Leben zu erleichtern, können Sie im LaTeX-Vorspann Zellen/Spalten
|
||||
definieren:
|
||||
die gewünschte Breite von Spalten berechnen muss, ist das bei mehreren
|
||||
Tabellen sehr lästig.
|
||||
Um sich das Leben zu erleichtern, kann man im LaTeX-Vorspann ein Zellen/Spalten
|
||||
-Format definieren, das dann in allen Tabellen des Dokuments verwendet werden
|
||||
kann.
|
||||
Das Format wird mit dem Befehl
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
@ -18250,7 +18585,8 @@ newcolumntype{Formatname}[Zahl der Argumente]{Befehle}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Der Formatname darf nur ein Buchstabe sein, aber nicht
|
||||
definiert.
|
||||
Der Formatname darf nur ein Buchstabe sein, aber nicht
|
||||
\emph on
|
||||
b
|
||||
\emph default
|
||||
@ -18336,11 +18672,7 @@ im
|
||||
\family sans
|
||||
LaTeX-Argument
|
||||
\family default
|
||||
im
|
||||
\family sans
|
||||
Tabellen-Einstellungen
|
||||
\family default
|
||||
-Dialog eine Mehrfachspalte definieren.
|
||||
im Tabellen-Einstellungen-Dialog eine Mehrfachspalte definieren.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
@ -14152,7 +14152,7 @@ reference "sec:Diálogo-Marcos"
|
||||
\begin_layout Standard
|
||||
En el ejemplo siguiente los cuadros están en un marco tipo minipágina
|
||||
\begin_inset Foot
|
||||
status open
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
Las minipáginas se describen en la sección
|
||||
@ -16502,6 +16502,351 @@ arrayrulewidth}{0.4pt}
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
|
||||
\lang english
|
||||
Table Width Calculation
|
||||
\begin_inset CommandInset label
|
||||
LatexCommand label
|
||||
name "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For wide tables it is sometimes difficult to assure that the table does
|
||||
not protrude over the page margin.
|
||||
Setting a fixed width for every column of the table is the solution, but
|
||||
what amount of space is needed for each column?
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The table width
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
can be calculated: Every column has the width of the specified column width
|
||||
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
(that the content of the column can consume) plus two times the separation
|
||||
between the column content and the column border (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
tabcolsep
|
||||
\series default
|
||||
, default 6
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt) plus the width of a border line (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
arrayrulewidth
|
||||
\series default
|
||||
, default 0.4
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt): So if all
|
||||
\begin_inset Formula $n$
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
columns have the same width, the table width is
|
||||
\lang spanish
|
||||
|
||||
\begin_inset Formula
|
||||
\begin{equation}
|
||||
W_{\mathrm{table}}=n\left(W_{\mathrm{column}}+2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)+\backslash\mbox{arrayrulewidth}
|
||||
\end{equation}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The available width for a table is the space between the page margins or
|
||||
the width of a text column (for a two-column document) (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
columnwidth
|
||||
\series default
|
||||
).
|
||||
If all table columns should have the same width and
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
should be 1
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
|
||||
\backslash
|
||||
columnwidth,
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
can easily be calculated.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
To be able to perform calculations you need to load the LaTeX-package
|
||||
\series bold
|
||||
calc
|
||||
\series default
|
||||
\lang spanish
|
||||
|
||||
\begin_inset Index idx
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
LaTeX-paquetes ! calc
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
in the document preamble.
|
||||
To set the width in the table dialog you have to use the field
|
||||
\family sans
|
||||
LaTeX argument
|
||||
\family default
|
||||
.
|
||||
The command scheme for this field is the same that is explained in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang spanish
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:Cálculos-en-Multicolumnas"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
.
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns with an uniform width and centered text, enter there for each column
|
||||
the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/5}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns where 2 should have 0.75
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
times the width than the 3 others, the calculation is
|
||||
\lang spanish
|
||||
|
||||
\begin_inset Formula
|
||||
\begin{align}
|
||||
\backslash\mbox{columnwidth} & =3\, W_{\mathrm{column}}+2\cdot0.75\, W_{\mathrm{column}}+\backslash\mbox{arrayrulewidth}\nonumber \\
|
||||
& \phantom{=\,}+5\left(2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)\nonumber \\
|
||||
& =4.5\, W_{\mathrm{column}}+62.4\,\mathrm{pt}\nonumber \\
|
||||
W_{\mathrm{column}} & =\frac{\backslash\mbox{columnwidth}-62.4\,\mathrm{pt}}{4.5}
|
||||
\end{align}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
In the table therefore the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
is used for the wider columns and
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}*
|
||||
\backslash
|
||||
real{0.75}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
for the smaller ones:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Tabular
|
||||
<lyxtabular version="3" rows="2" columns="5">
|
||||
<features tabularvalignment="middle">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
1
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
3
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
4
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
5
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
111111 1111111 111111 111111111 11111 11111 1111
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2222 22222 222222 222222222 2222222 22 22222
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
333333 333333 333333 33333 3333333 333
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
</lyxtabular>
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
@ -17930,8 +18275,19 @@ Cuadros ! Personalización ! Formato de celda/columna
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
El cálculo de la anchura necesaria para columnas extendidas descrito en
|
||||
la sección
|
||||
El cálculo de la anchura necesaria para columnas estándar descrito en la
|
||||
sección
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
y para columnas extendidas descrito en la sección
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
@ -17942,7 +18298,7 @@ reference "sub:Cálculos-en-Multicolumnas"
|
||||
|
||||
\end_inset
|
||||
|
||||
es muy pesado si tienes varios cuadros con multicolumnas.
|
||||
es muy pesado si tienes varios cuadros.
|
||||
Para hacerlo más fácil, puedes definir en el preámbulo un formato de celda/colu
|
||||
mna aplicable a todos los cuadros del documento.
|
||||
El formato se define con el comando
|
||||
|
@ -16850,6 +16850,352 @@ arrayrulewidth}{0.4pt}
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
|
||||
\lang english
|
||||
Table Width Calculation
|
||||
\begin_inset CommandInset label
|
||||
LatexCommand label
|
||||
name "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For wide tables it is sometimes difficult to assure that the table does
|
||||
not protrude over the page margin.
|
||||
Setting a fixed width for every column of the table is the solution, but
|
||||
what amount of space is needed for each column?
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The table width
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
can be calculated: Every column has the width of the specified column width
|
||||
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
(that the content of the column can consume) plus two times the separation
|
||||
between the column content and the column border (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
tabcolsep
|
||||
\series default
|
||||
, default 6
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt) plus the width of a border line (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
arrayrulewidth
|
||||
\series default
|
||||
, default 0.4
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt): So if all
|
||||
\begin_inset Formula $n$
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
columns have the same width, the table width is
|
||||
\lang french
|
||||
|
||||
\begin_inset Formula
|
||||
\begin{equation}
|
||||
W_{\mathrm{table}}=n\left(W_{\mathrm{column}}+2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)+\backslash\mbox{arrayrulewidth}
|
||||
\end{equation}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The available width for a table is the space between the page margins or
|
||||
the width of a text column (for a two-column document) (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
columnwidth
|
||||
\series default
|
||||
).
|
||||
If all table columns should have the same width and
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
should be 1
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
|
||||
\backslash
|
||||
columnwidth,
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
can easily be calculated.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
To be able to perform calculations you need to load the LaTeX-package
|
||||
\series bold
|
||||
calc
|
||||
\series default
|
||||
\lang french
|
||||
|
||||
\begin_inset Index idx
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
Paquetages LaTeX ! calc
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
in the document preamble.
|
||||
To set the width in the table dialog you have to use the field
|
||||
\family sans
|
||||
LaTeX argument
|
||||
\family default
|
||||
.
|
||||
The command scheme for this field is the same that is explained in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang french
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:Calculs-multicolonnes"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
.
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns with an uniform width and centered text, enter there for each column
|
||||
the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/5}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns where 2 should have 0.75
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
times the width than the 3 others, the calculation is
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Formula
|
||||
\begin{align}
|
||||
\backslash\mbox{columnwidth} & =3\, W_{\mathrm{column}}+2\cdot0.75\, W_{\mathrm{column}}+\backslash\mbox{arrayrulewidth}\nonumber \\
|
||||
& \phantom{=\,}+5\left(2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)\nonumber \\
|
||||
& =4.5\, W_{\mathrm{column}}+62.4\,\mathrm{pt}\nonumber \\
|
||||
W_{\mathrm{column}} & =\frac{\backslash\mbox{columnwidth}-62.4\,\mathrm{pt}}{4.5}
|
||||
\end{align}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
In the table therefore the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
is used for the wider columns and
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}*
|
||||
\backslash
|
||||
real{0.75}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
for the smaller ones:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Tabular
|
||||
<lyxtabular version="3" rows="2" columns="5">
|
||||
<features tabularvalignment="middle">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
1
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
3
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
4
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
5
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
111111 1111111 111111 111111111 11111 11111 1111
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2222 22222 222222 222222222 2222222 22 22222
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
333333 333333 333333 33333 3333333 333
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
</lyxtabular>
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
@ -18310,8 +18656,23 @@ Personnalisation des tableaux ! Format de cellule/colonne
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Calculer la largeur nécessaire pour des colonnes couvertes par un cellule
|
||||
multi-colonne comme dans la section
|
||||
Calculer la largeur nécessaire pour colonnes normales comme dans la section
|
||||
\lang english
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang french
|
||||
et pour des colonnes couvertes par un cellule multi-colonne comme dans
|
||||
la section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
@ -18322,8 +18683,7 @@ reference "sub:Calculs-multicolonnes"
|
||||
|
||||
\end_inset
|
||||
|
||||
peut devenir très pénible si vous avez plusieurs tableaux avec des cellules
|
||||
multi-colonnes.
|
||||
peut devenir très pénible si vous avez plusieurs tableaux.
|
||||
Pour vous rendre la vie plus facile, vous pouvez définir dans le préambule
|
||||
un format de cellule/colonne, qui puisse être utilisé dans tous les tableaux
|
||||
du document.
|
||||
|
@ -15760,6 +15760,351 @@ arrayrulewidth}{0.4pt}
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
|
||||
\lang english
|
||||
Table Width Calculation
|
||||
\begin_inset CommandInset label
|
||||
LatexCommand label
|
||||
name "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For wide tables it is sometimes difficult to assure that the table does
|
||||
not protrude over the page margin.
|
||||
Setting a fixed width for every column of the table is the solution, but
|
||||
what amount of space is needed for each column?
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The table width
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
can be calculated: Every column has the width of the specified column width
|
||||
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
(that the content of the column can consume) plus two times the separation
|
||||
between the column content and the column border (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
tabcolsep
|
||||
\series default
|
||||
, default 6
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt) plus the width of a border line (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
arrayrulewidth
|
||||
\series default
|
||||
, default 0.4
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
pt): So if all
|
||||
\begin_inset Formula $n$
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
columns have the same width, the table width is
|
||||
\lang japanese
|
||||
|
||||
\begin_inset Formula
|
||||
\begin{equation}
|
||||
W_{\mathrm{table}}=n\left(W_{\mathrm{column}}+2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)+\backslash\mbox{arrayrulewidth}
|
||||
\end{equation}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
The available width for a table is the space between the page margins or
|
||||
the width of a text column (for a two-column document) (LaTeX length
|
||||
\series bold
|
||||
|
||||
\backslash
|
||||
columnwidth
|
||||
\series default
|
||||
).
|
||||
If all table columns should have the same width and
|
||||
\begin_inset Formula $W_{\mathrm{table}}$
|
||||
\end_inset
|
||||
|
||||
should be 1
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
|
||||
\backslash
|
||||
columnwidth,
|
||||
\begin_inset Formula $W_{\mathrm{column}}$
|
||||
\end_inset
|
||||
|
||||
can easily be calculated.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
To be able to perform calculations you need to load the LaTeX-package
|
||||
\series bold
|
||||
calc
|
||||
\series default
|
||||
\lang japanese
|
||||
|
||||
\begin_inset Index idx
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
LaTeXぱっけーじ@LaTeXパッケージ ! calc
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
in the document preamble.
|
||||
To set the width in the table dialog you have to use the field
|
||||
\family sans
|
||||
LaTeX argument
|
||||
\family default
|
||||
.
|
||||
The command scheme for this field is the same that is explained in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang japanese
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:連結列の計算"
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang english
|
||||
.
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns with an uniform width and centered text, enter there for each column
|
||||
the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/5}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
For a table with 5
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
columns where 2 should have 0.75
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
times the width than the 3 others, the calculation is
|
||||
\lang japanese
|
||||
|
||||
\begin_inset Formula
|
||||
\begin{align}
|
||||
\backslash\mbox{columnwidth} & =3\, W_{\mathrm{column}}+2\cdot0.75\, W_{\mathrm{column}}+\backslash\mbox{arrayrulewidth}\nonumber \\
|
||||
& \phantom{=\,}+5\left(2\backslash\mbox{tabcolsep}+\backslash\mbox{arrayrulewidth}\right)\nonumber \\
|
||||
& =4.5\, W_{\mathrm{column}}+62.4\,\mathrm{pt}\nonumber \\
|
||||
W_{\mathrm{column}} & =\frac{\backslash\mbox{columnwidth}-62.4\,\mathrm{pt}}{4.5}
|
||||
\end{align}
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
In the table therefore the command
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
is used for the wider columns and
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\series bold
|
||||
>{
|
||||
\backslash
|
||||
centering}p{(1
|
||||
\backslash
|
||||
columnwidth-62.4pt)/
|
||||
\backslash
|
||||
real{4.5}*
|
||||
\backslash
|
||||
real{0.75}}
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
||||
\lang english
|
||||
for the smaller ones:
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Tabular
|
||||
<lyxtabular version="3" rows="2" columns="5">
|
||||
<features tabularvalignment="middle">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<column alignment="center" valignment="top" width="0pt" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}*\real{0.75}}">
|
||||
<column alignment="center" valignment="top" width="20col%" special=">{\centering}p{(1\columnwidth-62.4pt)/\real{4.5}}">
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
1
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
3
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
4
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
5
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
111111 1111111 111111 111111111 11111 11111 1111
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
2222 22222 222222 222222222 2222222 22 22222
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
|
||||
\begin_inset Text
|
||||
|
||||
\begin_layout Plain Layout
|
||||
333333 333333 333333 33333 3333333 333
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
</cell>
|
||||
</row>
|
||||
</lyxtabular>
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Section
|
||||
@ -17091,15 +17436,38 @@ status collapsed
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
連結列セルを含む表がいくつもある場合には、第
|
||||
|
||||
\lang english
|
||||
Calculating the required width for normal columns as described in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sec:Table-Width-Calculation"
|
||||
|
||||
\end_inset
|
||||
|
||||
or for spanned columns as described in section
|
||||
\begin_inset space ~
|
||||
\end_inset
|
||||
|
||||
|
||||
\lang japanese
|
||||
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:連結列の計算"
|
||||
|
||||
\end_inset
|
||||
|
||||
節のように連結部分を含む列に必要とされる幅を計算することはたいへん面倒です。そこで楽をするために、プリアンブルでセル・列書式を定義してしまえば、それを文書中のす
|
||||
べての表で使うことができます。書式は、以下のように定義します。
|
||||
|
||||
\lang english
|
||||
is very annoying if you have several tables where a calculation is necessary.
|
||||
|
||||
\lang japanese
|
||||
そこで楽をするために、プリアンブルでセル・列書式を定義してしまえば、それを文書中のすべての表で使うことができます。書式は、以下のように定義します。
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
|
Loading…
Reference in New Issue
Block a user