Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % ---------------------------------------------------------------------------- %
- % File
- begin{filecontents*}{jobname.cpp}
- 0000
- 0000
- end{filecontents*}
- begin{filecontents*}{multijobname.cpp}
- 0000
- 0000
- 0000
- 0000
- end{filecontents*}
- % ---------------------------------------------------------------------------- %
- % Preamble
- documentclass[letterpaper, 12pt, onecolumn]{article}
- % ---------------------------------------------------------------------------- %
- % Packages
- usepackage{xcolor}
- usepackage{listings}
- usepackage{multicol}
- usepackage[most]{tcolorbox}
- % ---------------------------------------------------------------------------- %
- % Listings options
- definecolor{grey}{RGB}{224, 224, 224}
- newtcbinputlisting{inputcode}[4][normalsize]{
- code = {},
- enhanced,
- listing only,
- top = 0pt,
- bottom = 0pt,
- left = 0pt,
- right = 0pt,
- arc = 0pt,
- outer arc = 0pt,
- boxsep = 0pt,
- titlerule = 0pt,
- colback = grey,
- colframe = black,
- boxrule = 2pt,
- title = {centering{fontfamily{cmtt}selectfont#2strut}},
- listing options = {
- language = C++,
- framesep = 0pt,
- rulesep = 0pt,
- aboveskip = 0pt,
- belowskip = 0pt,
- basicstyle = fontfamily{cmtt}selectfont#1,
- #3,
- },
- listing file={#4},
- }
- % ---------------------------------------------------------------------------- %
- % Commands
- newcommand{alphabet}{small{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}}
- newcommand{makelisting}[2]{
- newpagenoindentalphabet
- inputcode[#1]{#2}{}{jobname.cpp}
- noindentalphabet
- inputcode[#1]{#2}{multicols = 2}{multijobname.cpp}
- noindentalphabet
- }
- % ---------------------------------------------------------------------------- %
- % Document
- begin{document}
- makelisting{tiny}{tiny}
- makelisting{scriptsize}{scriptsize}
- makelisting{footnotesize}{footnotesize}
- makelisting{small}{small}
- makelisting{normalsize}{normalsize}
- makelisting{large}{large}
- makelisting{Large}{Large}
- makelisting{LARGE}{LARGE}
- makelisting{huge}{huge}
- makelisting{Huge}{Huge}
- end{document}
- % ---------------------------------------------------------------------------- %
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement