Guest User

Untitled

a guest
Feb 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{pgfplots, pgfplotstable}
  3. usepackage{filecontents}
  4. usepackage{indentfirst}
  5. usepackage{amsmath}
  6. usepackage{float}
  7. usepackage{hhline}
  8. usepackage{booktabs}
  9. usepackage[strict]{changepage}
  10. usepackage[position=top]{subfig}
  11.  
  12. renewcommandthesection{}
  13. makeatletter
  14. renewcommandthesubsection{@arabicc@subsection}
  15. makeatother
  16.  
  17. begin{filecontents}{data.dat}
  18. 28.1 0.7 0.9 1.2 1.4 1.5
  19. 40.0 11.2 11.7 12.0 12.2 12.9
  20. 44.7 18.2 19.3 19.7 19.8 20.4
  21. 50.9 28.0 28.9 29.4 29.6 30.1
  22. 57.0 43.2 42.2 41.6 40.7 40.4
  23. 61.5 50.2 51.0 52.1 52.6 52.7
  24. 67.0 62.8 64.5 65.5 65.6 68.5
  25. 72.2 78.3 79.2 80.7 80.8 82.7
  26. end{filecontents}
  27.  
  28. pgfplotsset{compat=1.14}
  29. pgfplotstableread{data.dat}Data
  30.  
  31. begin{document}
  32. newcountcountuno
  33. newcountcountdos
  34.  
  35. begin{table}[H]
  36. begin{tabular}{lll}
  37. toprule
  38. $D$ & $h$ & $h/D$\
  39. midrule
  40. gdeftablecontents{}%
  41. foreachrow in {0,...,34}
  42. {%
  43. countdos = row
  44. countuno = row
  45. dividecountuno by 5
  46. dividecountdos by 5
  47. multiplycountuno by -5
  48. advancecountuno by row
  49. pgfplotstablegetelem{countdos}{0}ofDatapgfmathsetmacroelemtable{pgfplotsretval}%
  50. ifnumcountuno=1
  51. xdeftablecontents{%
  52. unexpandedexpandafter{tablecontents}%
  53. noexpandpgfmathprintnumber{elemtable}%
  54. }%
  55. fi
  56. pgfplotstablegetelem{countdos}{countuno}ofDatapgfmathsetmacroelemtabledos{pgfplotsretval}%
  57. pgfmathsetmacroelemtabletres{elemtabledos / elemtable}
  58. xdeftablecontents{%
  59. unexpandedexpandafter{tablecontents}%
  60. & noexpandpgfmathprintnumber{elemtabledos} & noexpandpgfmathprintnumber{elemtabletres}noexpand\
  61. }%
  62. ifnumcountuno=5 xdeftablecontents{%
  63. unexpandedexpandafter{tablecontents}%
  64. noexpandmidrulenoexpand\
  65. }%
  66. fi
  67. }
  68. tablecontents
  69. bottomrule
  70. end{tabular}
  71. end{table}
  72.  
  73. end{document}
Add Comment
Please, Sign In to add comment