Skip to content

Golang support for the listings package in LaTeX

License

Notifications You must be signed in to change notification settings

LaCodon/listings-golang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

listings-golang

This package provides Golang support for the listings package in LaTeX.

This version was adapted from the golang-latex-listings project.

Usage

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{listings-golang} % import this package after listings
\usepackage{color}

\lstset{ % add your own preferences
    frame=single,
    basicstyle=\footnotesize,
    keywordstyle=\color{red},
    numbers=left,
    numbersep=5pt,
    showstringspaces=false, 
    stringstyle=\color{blue},
    tabsize=4,
    language=Golang % this is it !
}

\begin{document}
\begin{lstlisting}
package main

import "fmt"

func main() {
    fmt.Println("Hello World!")
}
\end{lstlisting}
\end{document}

Don't forget to put the file listings-golang.sty in the folder of your project, or with the other installed packages.

About

Golang support for the listings package in LaTeX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TeX 100.0%