diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex index caf37fc33ac..42a058d40a7 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex @@ -330,6 +330,8 @@ level,dof,error1,error2,info,{grad(log(dof),log(error2))},quot(error1) The choice \declaretext{false} is identical to this last case, i.e.\ even if the first line contains strings, they won't be recognised as column names. Finally, the choice \declaretext{has colnames} is the opposite of |false|: it assumes that the first non--comment line \emph{contains} column names. In other words: even if only numbers are contained in the first line, they are considered to be column \emph{names}. + + Note that this key only configures headers in \emph{input} tables. To configure \emph{output} headers, you may want to look at |every head row|. \end{key} \begin{pgfplotskey}{table/format=\mchoice{auto,inline,file} (initially auto)} @@ -758,6 +760,8 @@ A style which is installed for every column with odd column index (starting with \label{pgfplotstable:page:tablerow} \begin{command}{\pgfplotstablerow} During the evaluation of row or column options, this command expands to the current row's index. + + Note that it will have the special value $-1$ for the header row. \end{command} \begin{command}{\pgfplotstablecols} During the evaluation of row or column options, this command expands to the total number of columns in the output table. @@ -946,6 +950,22 @@ $3$ & $2$ & $2$ & $3 d\delta$ \\ \begin{stylekey}{/pgfplots/table/every head row} A style which is installed for each first row in the tabular. This can be used to adjust options for column names or to add extra lines/colours. + +\begin{codeexample}[] +\pgfplotstabletypeset[ + % suppress the header row 'col1 col2 col3': + every head row/.style={output empty row}, + col sep=comma, + columns/col1/.style={string type,column type=r}, + columns/col2/.style={string type,column type=l}, + columns/col3/.style={string type,column type=l}, + ] +{ + col1,col2,col3 + Col A,B,C + The first column,E,F +} +\end{codeexample} \end{stylekey} \begin{stylekey}{/pgfplots/table/every first row} @@ -1013,6 +1033,21 @@ $3$ & $2$ & $2$ & $3 d\delta$ \\ Note that |every nth row/.style 2 args=...| is the same as |every nth row=...|. \end{keylist} +\begin{stylekey}{/pgfplots/table/output empty row} + A style which suppresses output for the current row. + + This style is evaluated very late, after all column-specific content modifications have been applied. It is equivalent to +\begin{codeexample}[code only] +\pgfplotstableset{ + output empty row/.style={ + typeset cell/.style={@cell content={}} + }, +} +\end{codeexample} + + See |every head row| for an application. +\end{stylekey} + \subsection{Configuring Single--Cell Appearance: Styles} Besides the possibilities to change column styles and row styles, there are also a couple of styles to change single cells. \begin{stylekey}{/pgfplots/table/every row \meta{rowindex} column \meta{colindex}} @@ -1090,7 +1125,37 @@ The following keys allow changes of alignment (|begin table|) and |font| and the } \end{codeexample} - It is also possible to \emph{change} the value. For example, + Note that |longtable| allows the use of \emph{replicated headers} for multi-page tables\index{Multi-page} by means of its \declareandlabel{\endhead} macro:\index{Replicate headers} +\begin{codeexample}[code only] +% replicate column names on top of every page of a multi-page table: +\pgfplotstableset{ + row sep=\\, + begin table=\begin{longtable}, + end table=\end{longtable}, + every head row/.append style={after row=\endhead}, +} +\end{codeexample} + + If the first page should have a different header, you can use \declareandlabel{\endfirsthead} provided by the |longtable| package: +\begin{codeexample}[code only] +% replicate column names on top of every page of a multi-page table, +% but with different values for first page: +\pgfplotstableset{ + row sep=\\, + begin table=\begin{longtable}, + end table=\end{longtable}, + every head row/.append style={after row={% + \caption{The caption}% + \endfirsthead + \multicolumn{3}{c}{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\ + \endhead + }, + }, +} +\end{codeexample} + \noindent The preceding example uses the |longtable| macros |\caption|, |\endfirsthead|, |\thetable|, and |\endhead|. In addition, it requires to provide the number of columns (|{3}| in this case) \emph{explicitly}. + + It is also possible to \emph{change} the value of |begin table|. For example, \begin{codeexample}[code only] \pgfplotstableset{ begin table/.add={}{[t]}, |