I am Google-ing now for a while but couldn't find the answer. So here are the questions again:
I am trying to include parts of my C++ source code into a LaTeX document, and right now I am using \lstinputlisting[language=C++, firstline=37, lastline=40] for this purpose, which seems pretty good for it. The only thing that annoys me is, that it seems impossible to
a) change the font type of the source code in the text. (It looks like 1997 not like 2018 :/ )
b) widen the space between the text and the frame (background-colour)
Right now my example is like this:
\usepackage{listings}
\lstset{ %
backgroundcolor=\color{gray},
basicstyle=\rmfamily,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
commentstyle=\color{mygreen},
extendedchars=true,
frame=single,
keepspaces=true,
keywordstyle=\color{blue},
language=c++,
numbers=none,
numbersep=5pt,
numberstyle=\tiny\color{blue},
rulecolor=\color{mygray},
showspaces=false,
showtabs=false,
stepnumber=5,
stringstyle=\color{mymauve},
tabsize=3,
title=\lstname
}
\begin{document}
\lstinputlisting[language=C++, firstline=37, lastline=300]{../source/document.cc}
/end{document}
And I want to make it look more like, for example, Github now (here is a random Github page, representing how I want the code to look like: https://github.com/tesseract-ocr/tesseract/wiki/APIExample )



adjustboxenvironment (from packagechngpage). – Bernard Jan 10 '18 at 16:30