Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{pgfplots, pgfplotstable}
- usepackage{filecontents}
- usepackage{indentfirst}
- usepackage{amsmath}
- usepackage{float}
- usepackage{hhline}
- usepackage{booktabs}
- usepackage[strict]{changepage}
- usepackage[position=top]{subfig}
- renewcommandthesection{}
- makeatletter
- renewcommandthesubsection{@arabicc@subsection}
- makeatother
- begin{filecontents}{data.dat}
- 28.1 0.7 0.9 1.2 1.4 1.5
- 40.0 11.2 11.7 12.0 12.2 12.9
- 44.7 18.2 19.3 19.7 19.8 20.4
- 50.9 28.0 28.9 29.4 29.6 30.1
- 57.0 43.2 42.2 41.6 40.7 40.4
- 61.5 50.2 51.0 52.1 52.6 52.7
- 67.0 62.8 64.5 65.5 65.6 68.5
- 72.2 78.3 79.2 80.7 80.8 82.7
- end{filecontents}
- pgfplotsset{compat=1.14}
- pgfplotstableread{data.dat}Data
- begin{document}
- newcountcountuno
- newcountcountdos
- begin{table}[H]
- begin{tabular}{lll}
- toprule
- $D$ & $h$ & $h/D$\
- midrule
- gdeftablecontents{}%
- foreachrow in {0,...,34}
- {%
- countdos = row
- countuno = row
- dividecountuno by 5
- dividecountdos by 5
- multiplycountuno by -5
- advancecountuno by row
- pgfplotstablegetelem{countdos}{0}ofDatapgfmathsetmacroelemtable{pgfplotsretval}%
- ifnumcountuno=1
- xdeftablecontents{%
- unexpandedexpandafter{tablecontents}%
- noexpandpgfmathprintnumber{elemtable}%
- }%
- fi
- pgfplotstablegetelem{countdos}{countuno}ofDatapgfmathsetmacroelemtabledos{pgfplotsretval}%
- pgfmathsetmacroelemtabletres{elemtabledos / elemtable}
- xdeftablecontents{%
- unexpandedexpandafter{tablecontents}%
- & noexpandpgfmathprintnumber{elemtabledos} & noexpandpgfmathprintnumber{elemtabletres}noexpand\
- }%
- ifnumcountuno=5 xdeftablecontents{%
- unexpandedexpandafter{tablecontents}%
- noexpandmidrulenoexpand\
- }%
- fi
- }
- tablecontents
- bottomrule
- end{tabular}
- end{table}
- end{document}
Add Comment
Please, Sign In to add comment