Skip to content

sihlecodes/code-handout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Handout

A Latex template for creating beautiful programming notes and exercise sheets. Here's a glimpse of the package in action! :D

Screenshot 1

Latex Package Installation

Copy the code-handout.sty to your local latex packages folder. It's usually C:\Users\yourusername\texmf\tex\latex on windows and /home/yourusername/texmf/tex/latex on linux. You'll most probably have to create it yourself.

You can also run kspewhich -var-value=TEXMFHOME to find out the exact path, just remember to place the .sty file inside the tex/latex folder within the latex packages folder.

Alternatively you can run the installation script for your system.

Windows

git clone https://github.com/sihlecodes/code-handout.git
cd code-handout
start install.bat

Linux

git clone https://github.com/sihlecodes/code-handout.git
cd code-handout
./install.sh

Pygments Plugin installation

To install the pygements plugin run pip3 install . inside the plugin directory.

git clone https://github.com/sihlecodes/code-handout.git
cd code-handout/pygments-plugin
pip3 install .

Usage

Just include the code-handout package, set the title and author name and you're good to go. The package includes a bunch of useful packages, with minted being one of them.

\documentclass{article}
\usepackage{code-handout}

\title{Insert title}
\author{Insert your name or leave this blank}

% If you haven't installed the pygments-plugin uncomment the following
% \usemintedstyle{default}
% \setminted{bgcolor=Beige}

\begin{document}

\subsection*{Insert sub section title}
% ...

% \begin{minted}{csx}
% \end{minted}

\end{document}

The package automatically adds a \section* with the document title on the first page.

Improved Lexers

The improved lexers included with the pygments plugin can be used by adding x to the normal aliases of a language.

% ...
\begin{minted}{csx} % <-- This is what I mean
Your code goes here :D
\end{minted}
%...

Available Improved Lexers

Here's a list of the available lexers as well as their aliases. You can use any of the aliases for a particular language.

Language Aliases
C# csx, csharpx

About

A Latex template for creating beautiful programming notes and exercise sheets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published