SHARE
TWEET

Untitled

a guest Jun 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. % ---------------------------------------------------------------------------- %
  2. % File
  3. begin{filecontents*}{jobname.cpp}
  4. 0000
  5. 0000
  6. end{filecontents*}
  7. begin{filecontents*}{multijobname.cpp}
  8. 0000
  9. 0000
  10. 0000
  11. 0000
  12. end{filecontents*}
  13. % ---------------------------------------------------------------------------- %
  14. % Preamble
  15. documentclass[letterpaper, 12pt, onecolumn]{article}
  16. % ---------------------------------------------------------------------------- %
  17. % Packages
  18. usepackage{xcolor}
  19. usepackage{listings}
  20. usepackage{multicol}
  21. usepackage[most]{tcolorbox}
  22. % ---------------------------------------------------------------------------- %
  23. % Listings options
  24. definecolor{grey}{RGB}{224, 224, 224}
  25. newtcbinputlisting{inputcode}[4][normalsize]{
  26.     code = {},
  27.     enhanced,
  28.     listing only,
  29.     top = 0pt,
  30.     bottom = 0pt,
  31.     left = 0pt,
  32.     right = 0pt,
  33.     arc = 0pt,
  34.     outer arc = 0pt,
  35.     boxsep = 0pt,
  36.     titlerule = 0pt,
  37.     colback = grey,
  38.     colframe = black,
  39.     boxrule = 2pt,
  40.     title = {centering{fontfamily{cmtt}selectfont#2strut}},
  41.     listing options = {
  42.         language = C++,
  43.         framesep = 0pt,
  44.         rulesep = 0pt,
  45.         aboveskip = 0pt,
  46.         belowskip = 0pt,
  47.         basicstyle = fontfamily{cmtt}selectfont#1,
  48.         #3,
  49.     },
  50.     listing file={#4},
  51. }
  52. % ---------------------------------------------------------------------------- %
  53. % Commands
  54. newcommand{alphabet}{small{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}}
  55. newcommand{makelisting}[2]{
  56. newpagenoindentalphabet
  57. inputcode[#1]{#2}{}{jobname.cpp}
  58. noindentalphabet
  59. inputcode[#1]{#2}{multicols = 2}{multijobname.cpp}
  60. noindentalphabet
  61. }
  62. % ---------------------------------------------------------------------------- %
  63. % Document
  64. begin{document}
  65. makelisting{tiny}{tiny}
  66. makelisting{scriptsize}{scriptsize}
  67. makelisting{footnotesize}{footnotesize}
  68. makelisting{small}{small}
  69. makelisting{normalsize}{normalsize}
  70. makelisting{large}{large}
  71. makelisting{Large}{Large}
  72. makelisting{LARGE}{LARGE}
  73. makelisting{huge}{huge}
  74. makelisting{Huge}{Huge}
  75. end{document}
  76. % ---------------------------------------------------------------------------- %
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top