daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. documentclass{article}
  2. usepackage{listings}
  3.  
  4. makeatletter
  5. defapp@exe{immediatewrite18}
  6. deflistDir#1{%
  7.   app@exe{ls #1/* | xargs cat >> jobname.tmp}%
  8.   lstinputlisting{jobname.tmp}
  9.   AtEndDocument{app@exe{rm -f #1/jobname.tmp}}}
  10. makeatother
  11.  
  12. begin{document}
  13.  
  14. listDir{your_directory}
  15.  
  16. end{document}
  17.    
  18. app@exe{cmd /c dir /b * > jobname.tmp}%
  19. AtEndOfDocument{app@exe{rm -f #1/jobname.tmp}}}
  20.    
  21. documentclass{article}
  22. usepackage[cache=false]{minted}
  23. usepackage{listings}
  24. usepackage{pgffor}
  25. usepackage{pgfplotstable}
  26. usemintedstyle{friendly} % Python Code Style
  27.  
  28. makeatletter
  29. defapp@exe{immediatewrite18}
  30. defcreateData#1{%
  31.   app@exe{cmd /c dir /b *.py > jobname.dat}%
  32.     AtEndDocument{app@exe{cmd rm -f #1/jobname.dat}}}
  33. makeatother
  34.  
  35.  
  36. begin{document}
  37.  
  38. createData{.}% from the current dir
  39. pgfplotstableread[header=false]{jobname.dat}{mytable}
  40. pgfplotstablegetrowsof{mytable}
  41. pgfmathsetmacro{rows}{pgfplotsretval-1}
  42.  
  43. foreach i in {0,...,rows} {
  44.                 pgfplotstablegetelem{i}{[index]0}ofmytable
  45.         subsection*{Source code for textsf{pgfplotsretval}}
  46.                 inputminted[
  47.                                         frame=lines,
  48.                                         framesep=2mm,
  49.                                         baselinestretch=1.2,
  50.                                         %bgcolor=gray,
  51.                                         fontsize=footnotesize,
  52.                                         linenos
  53.                                         ]
  54.                                         {python}{pgfplotsretval}
  55. }
  56.  
  57. end{document}
RAW Paste Data
Top