Giter Club home page Giter Club logo

mmt-latex-helpers's Introduction

MMT LaTeX Helpers

PRs Welcome

LaTeX utility macros for typesetting papers and theses involving the MMT Language including

  • an mmttheory environment (see image below)
  • macros for typesetting simply- and dependently-typed function types (arrows, Pis), functions (lambdas), and function applications in different variants all with nice spacing:
    • basics: \to (LaTeX built-in), \tpi{x}[A] B (for \Pi x\colon A.\ B), \lam{x}[A] (for \lambda x\colon A.\ )
    • variadic (with nice spacing and ldots): \flexFun, \flexPi, \flexApp (for application)
    • doubly, triply variadic (e.g. to ultimately typeset \Pi a \Pi b \Pi c ... \Pi d \Pi e \Pi f): \flexDoublePi, \flexTriplePi
    • each variant (Pis, lambdas) accepts types of the variables as optional arguments
    • each variant supports (Pis, lambdas) accepts multiple variables too (e.g. \lam{a b}[T] to typeset \lambda a\,b\colon T)
    • and more stuff
  • macros for typesetting various FOL and SFOL stuff

Installation

  1. Get ahold of this repository's files, e.g. via git subrepo:

    > git subrepo clone https://github.com/ComFreek/mmt-latex-helpers.git mmt-latex-helpers
  2. Include the file all.tex in your LaTeX document:

    \RequirePackage{import}
    \subimport{mmt-latex-helpers/}{all}

    Here, we use the subimport command from the import package to allow all.tex to include files relatively to its containing directory. E.g. all.tex contains an \input{terms}, which would fail if we didn't use subimport above.

  3. Test by writing $\lam{x}[S] t$ somewhere in your document. This should render as ฮปx: S. t.

Minimal Working Example

Assuming you performed step 1 of the installation above, the following should compile fine with any TeX distribution:

\documentclass[]{article}

\RequirePackage{import}
\subimport{mmt-latex-helpers}{all}

\begin{document}

\begin{mmttheory}{T}
	S & \type\\
	T & \type\\
	t & T\\
	c & S \to T\\
	d & S \to T\mmtdef
	    \lam{s}[S] c\ s
\end{mmttheory}

\end{document}

Documentation

So far no shiny external documentation is available; you have to read the inline documentation in source, unfortunately ๐Ÿ˜€

Partial Documentation Attempt

Imgur

\makecn{Unital}
\makecn{neut}

\begin{mmttheory}{\Unital}
    \mmtinclude{\SFOL}
    U      & \tp\\
    \circ  & \tm{U} \to \tm{U} \to \tm{U}\\
    e      & \tm{U}\\
    \neut  & \ded \fall{x}[\tm{U}] e \circ x \doteq x
\end{mmttheory}

Macros suffixed with c (for constant) usually expand to constant names (without any left/right space padding) as such. While \tm{T} expands to tm T with a good font chosen for tm of spacing towards T, the macro \tmc exapnds to just tm with a good font.

mmt-latex-helpers's People

Contributors

comfreek avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mmt-latex-helpers's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.