latex-live-snippets: Automatically inline Haskell snippets into LaTeX documents.

[ bsd3, program, system ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), directory, filepath, lens, MissingH [details]
License BSD-3-Clause
Copyright 2018 Sandy Maguire
Author Sandy Maguire
Maintainer sandy@sandymaguire.me
Category System
Home page https://github.com/isovector/latex-live-snippets#readme
Bug tracker https://github.com/isovector/latex-live-snippets/issues
Source repo head: git clone https://github.com/isovector/latex-live-snippets
Uploaded by isovector at 2018-07-11T14:24:28Z
Distributions NixOS:0.1.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Executables latex-live-snippets
Downloads 832 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2018-07-11 [all 3 reports]

Readme for latex-live-snippets-0.1.0.0

[back to package description]

latex-live-snippets

Install with stack install, and then in latex via:

% set this to where your code is
\newcommand{\srcdir}{.}

\newcommand{\snip}[2]{\immediate\write18{latex-live-snippets \srcdir/#1.hs #2}\input{.latex-live-snippets/#1.#2.tex}}

Now, given a file Test.hs:

zoo :: Int
zoo = 5

test :: Bool -> Bool
test True = id $ True
test _    = True  -- ! 1

we can call

\snip{Test}{test}

which will result in:

\begin{code}
test :: Bool -> Bool
test True = id \$ True
test \_    = True \ann{1}
\end{code}

It will also find type families, data definitions. Custom snippet areas can be defined via comments of the form -- # name.