SHARE
TWEET

Untitled

a guest Jul 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. documentclass{article}
  2.  
  3. usepackage{filecontents}
  4. begin{filecontents*}{product.tex}
  5. %Type =1,2...10
  6. No,Type,Name,Description
  7. 1,1,A1,D1
  8. 2,1,A1,D2
  9. 3,1,A1,D3
  10. 30,1,A1,D30
  11. 31,2,A2,D31
  12. 131,2,A2,D131
  13. 132,3,A3,D132
  14. 133,3,A3,D133
  15. 134,3,A3,D134
  16. 249,4,A4,D249
  17. 1000,10,A10,D1000
  18. end{filecontents*}
  19.  
  20. usepackage{datatool}
  21.  
  22. DTLloaddb[autokeys=false]{products}{product.tex}
  23.  
  24. newcommand{printtype}[1]{%
  25.   par
  26.   section*{Type #1}
  27.   DTLforeach*
  28.     [DTLiseq{Type}{#1}]% Condition
  29.     {products}% Database
  30.     {No=No,Type=Type,Name=Name,Description=Description}{%
  31.     noindentName quad Descriptionpar
  32.   }%
  33. }
  34.  
  35. begin{document}
  36.  
  37. %Here is some text.
  38.  
  39. printtype{1}
  40.  
  41. Some breaking text here.
  42.  
  43. printtype{3}
  44.  
  45. And then some final text.
  46.  
  47. end{document}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top