lhs2TeX command not found

In this troubleshooting guide we learn how to fix lhs2TeX command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

lhs2TeX: command not found

or when using sudo you get the following error message

sudo: lhs2TeX: command not found

Solutions to lhs2TeX: command not found

How To Fix lhs2TeX: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu lhs2TeX is provided by lhs2tex package.

lhs2tex is:

lhs2TeX includes the following features:

Different styles to process your source file: for instance, “tt” style uses a monospaced font for the code while still allowing you to highlight keywords etc, whereas “poly” style uses proportional fonts for identifiers, handles indentation nicely, is able to replace binary operators by mathematical symbols and take care of complex horizontal alignments.

Formatting directives, which let you customize the way certain tokens in the source code should appear in the processed output.

A liberal parser that can handle most of the language extensions; you don’t have to restrict yourself to Haskell 98.

Preprocessor-style conditionals that allow you to generate different versions of a document from a single source file (for instance, a paper and a presentation).

Active documents: you can use Haskell to generate parts of the document (useful for papers on Haskell).

A manual explaining all the important aspects of lhs2TeX.

To fix this problem, we can install more using the command below.

sudo apt-get -y install lhs2tex

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install lhs2tex.

sudo apt -y install lhs2tex

Or if you have aptitude installed you can use the following command.

sudo aptitude install lhs2tex

Summary

In this tutorial we learn how to fix lhs2TeX command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.