This repo provides a set of LaTeX packages for writings in programming languages. The goal of the project is allow users to use each package independent of other. However, since LaTeX does not track dependencies statically, there could be breakage. Please report them when you find them.
You can find (incomplete) set of examples under examples.
(Incomplete) List of packages:
pfpl-denfs,pl-syntaxandpl-judgments. All originally developed by Bob Harper.pfpl-defnscontains a collection of definitions intended for typesetting the textbook Practical Foundations for Programming Languages.pl-syntaxandpl-judgmentsare smaller sets, but modernized definitions achieving similar purposes.pfpl-defnsis forked to play nice with the two newer packages.
prose-abbrevprovides common abbreviations for prose.labelled-rulesprovides macros for type-setting rules that come with referenceable labels.apx-refprovides tools to reference to the Appendix.pl-defns-lrprovides definitions useful for defining logical relations.pl-defns-typopprovides definitions useful for defining type operators.
This repo also come with definitions specific to various calculi
ctillst-*collection of packages contains definitions for thectillstlanguage.pl-defns-adjunctionsfor adjoint types.pl-defns-linearyfor linear types.
To use the packages in your LaTeX project, follow the following steps. You have the option to set it up "globally" (recommended) or "locally".
- Clone the entire repository fully, including all its submodules. This step only need to be carried out once per machine.
git clone --recursive git@github.com:tripack45/pl-defns.git
- Suppose the root of the repository is in
$DIR.
Perform the following two steps if you with to set it globally. Skip them if not. You only need to perform these instructions once per machine.
- Modify the content of
latexmkrc.globalto point to root of the repository. It should like below with$DIRreplaced with the directory of project root.
# Sets up search path for defns
$GLOBAL_PL_DEFNS_ROOT="$DIR";
- Append
latexmkrc.globalto your globallatexmkrc. Create the file if it doesn't exist already.
cat latexmkrc/latexmkrc.global >> ~/.latexmkrc
For a LaTeX project whose project root is $PROJECT_ROOT:
- Copy
latexmkrc.projectto your project root.
cp latexmkrc/latexmkrc.project >> $PROJECT_ROOT/latexmkrc
If you opted to set up globally, this is all you need to do.
- Other-wise you need to modify the copied over
latexmkrcfor following the instructions inside and modify$PL_DEFNS_ROOTin the else branch to point to$DIR.
if (...) {
...
} else {
$PL_DEFNS_ROOT="$DIR";
}Issue a pull request that:
- Place your
package.styappropriately underdefns/. If it's a separate collection in its own directory. - If you placed them in a separate directory, modify the definition of variable
@PATHSinbin/env.plto add a line for that directory.
Send the pull request.