-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better code listings #6
Comments
SimonMcCallum
added a commit
that referenced
this issue
Apr 25, 2017
For code listing with syntax highlighting one could possibly also mention the minted package. Eksempel på bruk av minted sammen med tcolorbox % Minted og tcolorbox for syntax highlighting og fargerike bokser
\usepackage[many,minted]{tcolorbox}
\usepackage{minted}
% Default settings for Minted
\setminted{breaklines=true,autogobble=true}
% Macro for å opprette nytt minted miljø og tcolobox samtidig
\newcommand{\mynewminted}[3]{%
\newminted[#1]{#2}{#3}%
\tcbset{myminted/#1/.style={minted language=#2,minted options={#3}}}}
% Definere de forskjellige minted miljøene vi vil benytte
\mynewminted{myconsole}{console}{}
\mynewminted{myconsolelong}{console}{breakanywhere=true}
\mynewminted{mybash}{bash}{}
\mynewminted{mymanpage}{man}{}
% Kodeblokker
\newtcblisting[auto counter,number within=section,
list inside=mypyg]{kode}[3][]{%
listing only,title={#3},
list entry={\protect\numberline{\thetcbcounter}#3},
breakable,
enhanced,colframe=blue!50!black,drop fuzzy shadow,myminted/#2,#1}
% oppgavesitater
\newtcolorbox{oppgave}[1][]{%
title=Oppgavesitat,
breakable,
enhanced,colframe=brown!50!black,drop fuzzy shadow,
#1
}
% Endring
\newtcolorbox{altered}[1][]{%
title=Endring,
breakable,
enhanced,colframe=red!50!black,drop fuzzy shadow,
#1
} |
SimonMcCallum
added a commit
that referenced
this issue
May 1, 2018
… putting boxes around code listings
SimonMcCallum
added a commit
that referenced
this issue
May 1, 2018
SimonMcCallum
added a commit
that referenced
this issue
May 11, 2018
SimonMcCallum
added a commit
that referenced
this issue
Jan 9, 2019
After reading this discussion https://tex.stackexchange.com/questions/389191/minted-vs-listings-pros-and-cons I prefer to stay with listings. However, the listings package is highly configurable, so we could make much better use of it than we currently do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: