noxz-sites

A collection of a builder and various scripts creating the noxz.tech sites
git clone https://noxz.tech/git/noxz-sites.git
Log | Files | README | LICENSE

commit: 5f009121094ef4e40780a09b3017ad8afe88969f
parent: 040e1d1b17c56437a976ca209c65a236d985e023
author: Chris Noxz <chris@noxz.tech>
date:   Fri, 20 Sep 2019 15:36:19 +0200
Create guides section and some groff tricks
Anoxz.tech/guides/groff/index.md68++++++++++++++++++++
Anoxz.tech/guides/index.md15+++++
2 files changed, 83 insertions(+)
diff --git a/noxz.tech/guides/groff/index.md b/noxz.tech/guides/groff/index.md
@@ -0,0 +1,68 @@
+groff (GNU troff)
+=================
+As these guides are created for *groff*, I cannot guarantee that they are
+applicable to *troff*. If you use *troff* and can confirm them to work for it
+-- please let me know.
+
+Apart from *groff* these guides may include other programs used together with
+*groff*, such as *eqn*, *tbl*, and so on. I will try make this clear in the
+description of each guide.
+
+Crossing out expressions in *eqn*
+---------------------------------
+In the *man* page of *eqn* you can read about defining a macro for canceling an
+expression. This macro draws a line over the expression, as an indication it's
+canceled. When using paper and pen I usually use a cross instead, so this is
+how you do the same in *eqn*
+
+    \# define cancel_cross macro for expressions
+    .defcolor cancelcolor rgb 0.0f 0.0f 0.0f
+    .EQ }
+    define cancel_cross 'special Cax'
+    .EN
+    .de Cax
+    .  ds 0s \
+    \Z'\\*(0s'\
+    \Z'\D't 0.75p''\
+    \m[cancelcolor]\
+    \v'\\n(0du'\
+    \D'l \\n(0wu -\\n(0hu-\\n(0du'\
+    \h'-\\n(0wu'\
+    \D'l \\n(0wu \\n(0hu+\\n(0du'\
+    \v'-\\n(0hu-\\n(0du'\
+    \Z'\D't 0.5p''\
+    \m[default]\
+    \v'\\n(0hu'
+    ..
+
+Then use it for example like this: `{ 4 times 1 } over { 4 times 5 }
+= { cancel_cross 4 times 1 } over { cancel_cross 4 times 5 }`.
+
+You can of course name your macro `cancel` instead of `cancel_cross`. The
+`cancelcolor` is also optional, and in the case above redundant.
+
+Simplify expressions in *eqn*
+-----------------------------
+When writing *eqn* expressions in *groff* it's easier to distinguish what is
+*groff* and what is *eqn* using distinct delimiters for *eqn*. This is simply
+accomplished this way:
+
+    .EQ
+    set default_rule_thickness 13
+    delim ##
+    .EN
+
+Then use it like this:
+
+    [...]
+    .LP
+    Calculate the sum of #-4# och #-7#
+    .sp 1
+    .RS
+    # (-4) + (-7) #
+    
+    # = -4 - 7 #
+    
+    # = -11
+    .RE
+    [...]
diff --git a/noxz.tech/guides/index.md b/noxz.tech/guides/index.md
@@ -0,0 +1,15 @@
+Guides
+======
+The following is a collection of guides, hacks, HOWTOs, tips and tricks -- I
+have acquired over the years -- for various programs and concepts. I will fill
+this list over a period of time, so it's far from complete -- and probably
+won't be.
+
+Programs
+--------
+{:: class="definition"}
+**[groff](/guides/groff)** (also called GNU troff) is a typesetting system
+that creates formatted output when given plain text mixed with formatting
+commands. Output may be PostScript or PDF, html, or ASCII/UTF8 for display at
+the terminal.
+{::}