Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. documentclass[fontsize=11pt,paper=a4,DIV=6,landscape]{scrartcl}
  2. usepackage{tikz}
  3. usepackage{graphicx}
  4. usepackage{tabularx}
  5. usepackage{booktabs}
  6.  
  7. newcolumntype{s}{>{hsize=.05hsizecenteringarraybackslash}X} %for id
  8. newcolumntype{n}{>{hsize=.1hsizeraggedrightarraybackslash}X} %for name
  9. newcolumntype{y}{>{hsize=.2hsizecenteringarraybackslash}X} %for everthing else
  10. newcolumntype{e}{>{hsize=.3hsizeraggedrightarraybackslash}X} %for email
  11. usepackage{datatool}
  12.  
  13.  
  14. DTLloaddb[noheader]{data}{namelist.csv}
  15.  
  16. newcommand{circleme}[1]{begin{tikzpicture}
  17. begin{scope}
  18. clip [rounded corners=.4cm] (0,0) rectangle coordinate (centerpoint) (.8,.8cm);
  19. node [inner sep=0pt] at (centerpoint) {includegraphics[width=.8cm, height=.8cm]{#1}};
  20. end{scope}
  21. draw[mycolor,very thick] (.4cm,.4cm) circle (.4cm);
  22. end{tikzpicture}}
  23.  
  24. begin{filecontents*}{namelist.csv}
  25. 1,Name One,PhD,supervisor,Immunology,nameone@yahoo.com,logo,red
  26. 2,Name Two,MSc,worker,Microbiology,nametwo@yahoo.com,logo,blue
  27. 3,Name Three,BSc,worker,Chemistry,namethree@yahoo.com,logo,green
  28. end{filecontents*}
  29.  
  30. newcommand{tabcontents}{begin{tabularx}{textwidth}{@{}snyyyey@{}}
  31. toprule
  32. & multicolumn{1}{c}{textbf{Name}}
  33. & multicolumn{1}{c}{textbf{Qual}}
  34. & multicolumn{1}{c}{textbf{Specs}}
  35. & multicolumn{1}{c}{textbf{Descr}}
  36. & multicolumn{1}{c}{textbf{E-mail}}
  37. &}
  38.  
  39. begin{document}
  40. thispagestyle{empty}
  41. DTLforeach*{data}{idcode=Column1,name=Column2,qual=Column3,%
  42. descr=Column4,spec=Column5,email=Column6,figpath=Column7,mycolor=Column8}%
  43. {%
  44. eapptotabcontents{noexpand\noexpandmidrule
  45. idcode noexpand&
  46. name noexpand&
  47. qual noexpand&
  48. spec noexpand&
  49. descr noexpand&
  50. email noexpand&
  51. noexpandraisebox{-.5baselineskip}{noexpandcircleme{figpath}}}
  52. }%
  53. apptotabcontents{\bottomruleend{tabularx}}
  54.  
  55. tabcontents%
  56. end{document}
  57.  
  58. %%% Local Variables:
  59. %%% mode: latex
  60. %%% TeX-master: t
  61. %%% TeX-engine: xetex
  62. %%% End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement