How To Install lhs2tex on Debian 9

In this tutorial we learn how to install lhs2tex on Debian 9. lhs2tex is Generates LaTeX code from literate Haskell sources

Introduction

In this tutorial we learn how to install lhs2tex on Debian 9.

What is lhs2tex

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.

There are three methods to install lhs2tex on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install lhs2tex Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install lhs2tex using apt-get by running the following command:

sudo apt-get -y install lhs2tex

Install lhs2tex Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install lhs2tex using apt by running the following command:

sudo apt -y install lhs2tex

Install lhs2tex Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install lhs2tex using aptitude by running the following command:

sudo aptitude -y install lhs2tex

How To Uninstall lhs2tex on Debian 9

To uninstall only the lhs2tex package we can use the following command:

sudo apt-get remove lhs2tex

Uninstall lhs2tex And Its Dependencies

To uninstall lhs2tex and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove lhs2tex

Remove lhs2tex Configurations and Data

To remove lhs2tex configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge lhs2tex

Remove lhs2tex configuration, data, and all of its dependencies

We can use the following command to remove lhs2tex configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge lhs2tex

Dependencies

lhs2tex have the following dependencies:

References

Summary

In this tutorial we learn how to install lhs2tex package on Debian 9 using different package management tools: apt, apt-get and aptitude.