2

I am using minted to highlight source code in my document.

I have defined

\definecolor{codeyellow}{RGB}{255,251,204}
\newminted{python}{linenos,breaklines,frame=lines,bgcolor=codeyellow}

in the preamble.

But I will also be able to show console code and output. I have read that I can use pycon so I have tried

\newminted{pycon}{linenos,breaklines,frame=lines}

but it shows just a listing with white background and black text. I know I should probably set bgcolor etc. but can I find a theme which suits the 'normal' console output look/theme?

Edit (minimal working solution)

\documentclass{article}

\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fullpage}
\usepackage{minted}

\newminted{pycon}{%
    linenos,
    breaklines,
    fontsize=\footnotesize,
    frame=lines,
    tabsize=4
}

\begin{document}

\begin{listing}
\begin{pyconcode}
python manage.py runserver:8000
\end{pyconcode}
\caption{Console}
\end{listing}

\end{document}

produces

enter image description here

  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Jun 13 '15 at 16:50
  • Hi. I have updated my question with a MWE :-) – Jamgreen Jun 13 '15 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.