This Latex package aims to display code in a beautiful way.
This package provides tcolorbox environments for block and inline code, as well as lstlisting styles. This package loads tcolorbox, listings and xcolor.
First, add the moderncode.sty file to your project, and include it via
\usepackage{moderncode}Now, you can use the environments moderncode and moderncodeout, as well as the commands moderncodeinline, moderncodeinput and moderncodekey. If you wish to use lstlisting instead, you can do that as well. This package also provides a pseudo language style called pseudo.
The moderncode environment has two optional parameters.
The first argument will be passed to the underlying listing, while the second will be passed to the tcolorbox.
However, the first argument has another important aspect to note: while it accepts a list of keys, the first key will always be passed to the language property.
This is done for ease of use, as usually no further keys are required.
- minute spacing adjustments
- add new dedicated argument for the language
- add
escapechar! - adjust
escapeinsideto be<*and*>respectively. The old values(*and*)could lead to errors when displaying C code with function pointers, and some IDEs might complain about improper parenthesis placement. - the
skinslibrary fromtcbis now also loaded - the styles of
moderncode,moderncodeinlineandmoderncodekeycan now be accessed via the keys/tcb/moderncode,tcb/moderncode/inlineandtcb/moderncode/key/respectivly. - remove
breakablekeyword frommoderncode,moderncodeoutand\moderncodeinputas it could break when used intcbrasteror inside ofminipage. Usebreakable=truein order to restore old behavior.
- add
.chktexrcfile
- add
moderncodeinput
- add
mathescapeto standardlstlistingstyle - change the arguments of the
moderncodeandmoderncodeoutenvironment to be optional. The first argument controls settings for the internallisting. The first entry will always be interpreted as a language. The second optional argument controls settings for thetcolorbox
- add optional argument for the language for the
moderncodeinlinecommand - add local latex indent config file
- fix typos
initial version