# Tag Info

3

To easily define your new environment, you could use \newtcblisting from the powerful tcolorbox package and the fact that it cooperates with minted: \documentclass{article} \usepackage{minted} \usepackage{tcolorbox} \tcbuselibrary{minted} \definecolor{codebggray}{rgb}{0.95,0.95,0.95} \newtcblisting{codeblock}[2][]{% colback=codebggray, listing only, ...

3

stackexchange uses google prettify https://code.google.com/p/google-code-prettify/wiki/GettingStarted to format code blocks. It can't be too hard, if you format your code with that first to convert the generated html markup back to tex, but I don't know of an existing package that does it

3

Package minted is based on package fancyvrb. Thus the first space can be removed by disabling \FV@ListVSpace. The space at the end is caused by the code of column p. A final strut, which only contains the depth of the usual tabular strut box, is added at the end of the cell, intended to go to the end of the last line. However the environment minted is ...

Top 50 recent answers are included