Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julienc91/listings-golang
Golang support for the listings package in LaTeX
https://github.com/julienc91/listings-golang
Last synced: 5 days ago
JSON representation
Golang support for the listings package in LaTeX
- Host: GitHub
- URL: https://github.com/julienc91/listings-golang
- Owner: julienc91
- License: mit
- Created: 2014-07-26T18:20:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-02T18:55:54.000Z (about 6 years ago)
- Last Synced: 2023-08-03T06:08:49.172Z (over 1 year ago)
- Language: TeX
- Size: 12.7 KB
- Stars: 60
- Watchers: 5
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
listings-golang
===============This package provides Golang support for the `listings` package in LaTeX.
* Author: Julien CHAUMONT (https://julienc.io)
* Version: 1.1
* Date: 2017-10-11
* Licence: MIT
* Url: http://github.com/julienc91/listings-golang
* Golang version: 1.11This version was adapted from the [golang-latex-listings][1] project.
## Usage
```latex
\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 mainimport "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.[1]: https://bitbucket.org/korfuri/golang-latex-listings