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

[ bsd3, program, system ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/isovector/latex-live-snippets#readme


[Skip to Readme]
Versions [faq] 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 Wed Jul 11 14:24:28 UTC 2018
Distributions NixOS:0.1.0.0
Executables latex-live-snippets
Downloads 216 total (17 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Last success reported on 2018-07-11 [all 3 reports]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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.