From 4293841e610d4377ea50fd52ec72affbd19801bd Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 20 May 2020 12:25:08 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D1=82=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/preamble.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/preamble.tex b/setup/preamble.tex index a9a89c9..a073dee 100644 --- a/setup/preamble.tex +++ b/setup/preamble.tex @@ -212,6 +212,9 @@ \newcolumntype{Z}{>{\HY\raggedright\arraybackslash\hspace{0pt}}X} \newcolumntype{M}{>{\HY\RaggedRight\arraybackslash\hspace{0pt}}c} \newcolumntype{L}{>{\HY\RaggedRight\arraybackslash\hspace{0pt}}l} +\newcolumntype{C}{>{\centering\arraybackslash}p} + +\usepackage{pgfplotstable} %%%%% Заголовок на последней странице таблицы (обязательно после hyperref) \usepackage{fr-longtable} From 5ccae0d2cf09be83f8c7b0e6769b6505098139d5 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 20 May 2020 12:25:51 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20?= =?UTF-8?q?=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D1=8B=20=D1=81=20=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=B8=D0=B7=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/table-from-file/table.tex | 46 ++++++++++++ examples/table-from-file/test.dat | 114 +++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 examples/table-from-file/table.tex create mode 100644 examples/table-from-file/test.dat diff --git a/examples/table-from-file/table.tex b/examples/table-from-file/table.tex new file mode 100644 index 0000000..d9ad9e8 --- /dev/null +++ b/examples/table-from-file/table.tex @@ -0,0 +1,46 @@ +\documentclass{article} +% MWE from http://tex.stackexchange.com/questions/40411/import-files-with-pgfplotstable-and-split-tables-across-multiple-pages +\usepackage{pgfplotstable} +\usepackage{fr-longtable} +\usepackage{booktabs} +\usepackage{array} +\usepackage[a4paper]{geometry} %%% change the margins in your file suitably. +\usepackage{filecontents} + +\newcolumntype{C}{>{\centering\arraybackslash}p} + +\begin{document} + +\pgfplotstableset{ +begin table=\begin{longtable}, +end table=\end{longtable}, +} + +\pgfplotstabletypeset[ +col sep=space, +header=true, +columns={Idx,Nam,Dim,Grd}, % display specified columns +columns/Idx/.style={precision=2,column type=|C{40mm}}, +columns/Nam/.style={column type=|C{40mm},string type}, +columns/Dim/.style={precision=1,column type=|r}, +columns/Grd/.style={column type=|l|,string type}, +every even row/.style={after row=\hline}, +every odd row/.style={after row=\hline}, +% requires booktabs to place horiz rules +every head row/.style={before row=\toprule, after row=\midrule\endhead}, +every head row/.style={ + before row={% + \caption{The caption} + \endfirsthead + \multicolumn{4}{c}{{\tablename\ \thetable{}: continued from previous page}} \\ + \endhead + \multicolumn{4}{c}{{\tablename\ \thetable{}: last page}} \\ + \endlasthead + \hline + }, + after row=\hline +} +]{test.dat} + +\end{document} + diff --git a/examples/table-from-file/test.dat b/examples/table-from-file/test.dat new file mode 100644 index 0000000..268d54e --- /dev/null +++ b/examples/table-from-file/test.dat @@ -0,0 +1,114 @@ +%% LaTeX2e file `testdata.dat' +%% generated by the `filecontents' environment +%% from source `b' on 2020/01/02. +%% +Idx Nam Dim Grd +1 Ady 53 F +2 Bar 72 C +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +3 Cor 83 B +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +1 Ady 53 F +2 Bar 72 C +3 Cor 83 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C +7 Gar 74 C +8 Hur 65 D +9 Jaz 85 B +10 Ker 91 A +4 Dar 58 D +5 Esa 68 C +6 Foo 67 C