From da165f8270b7b65f0606d7277902b4eaf89dfeb2 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 20 Apr 2021 21:22:17 +0200 Subject: [PATCH] add groff --- data/groff.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 data/groff.md diff --git a/data/groff.md b/data/groff.md new file mode 100644 index 0000000..df33c8e --- /dev/null +++ b/data/groff.md @@ -0,0 +1,86 @@ +# Basic Documents + +Great a file called `name.ms`, with the following content: + +``` +.TL +Groff-Time +.AU +Ghost +.NH +How to Format Groff Documents. +.PP +Groff needs two new lines to show a new paragraph. + +``` + +Then make a pdf from the document with: + +`groff -ems name.ms -Tpdf > name.pdf` + +The commands must be placed at the start of a line. + +The available commands are: + +| Result | Command | +|:----------------:|:-------------------| +| Section Header | .NH 1 | +| Subsection | .NH 2 | +| Subsubsection | .NH 3 | +| Paragraph | .PP | +| Bold text | .B "text" | +| Italic text | .I "text" | +| Bold Italic text | .BI "text" | +| Author | .AU | +| Title | .TL | +| Start abstract | .AB | +| Start an equation| .EQ | +| End an equation | .EN | + + +## Equations + +To format `2+2=5`, we can do: + +``` +.EQ +2+2=5 +.EN +``` + +The equation shorthands are predictable: + +| Symbol | Macro | +|:----------:|:--------| +| Greater than or equal to | >= | +| Not equal | != | +| Superscript | sup {thing} | + +- [List of symbols](https://www.math-linux.com/man/man7/groff_char.7.html) + +### Examples + +The fraction 2/5ths: + +``` +.EQ +\[25] +.EN +``` + +E=MC^2: + +``` +.EQ +E = MC sup 2 +.EN +``` + +Praedicate logic: + +``` +.EQ +\[fa] x Rx \[te] y Syx +.EN +``` +