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: df06804aa6477c1adcf5a11c17cee06d2db2f4a9
parent: 199f5a51e4a75f00dbfaa44649e3819f99906ca7
author: Chris Noxz <chris@noxz.tech>
date:   Mon, 21 Apr 2025 21:01:04 +0200
use latex instead of eqn and pic
M.gitignore1+
MMakefile8+-
Mbuild204++++-
Dconfig/eqn.conf10-
Mconfig/www.conf83++
Mnoxz.tech/articles/divisibility_theorems_and_fraction_flipping/.assemble2+-
Mnoxz.tech/articles/divisibility_theorems_and_fraction_flipping/index.www947++++++++++----------
Mnoxz.tech/articles/sic_free_software_in_education/index.www2+-
Mnoxz.tech/articles/writing_a_resume_in_groff/example.pngBin114281
Mnoxz.tech/articles/writing_a_resume_in_groff/template.ms4+-
Mnoxz.tech/pub/style.css98+-
11 files changed, 824 insertions(+), 535 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -9,3 +9,4 @@ logo.png
 */pub/sitemap.xml
 grohtml-*.png
 eqn-*.png
+tex-*.svg
diff --git a/Makefile b/Makefile
@@ -5,12 +5,16 @@ all: clean check
 	@./build
 	@
 	@echo creating icons
-	@convert -density 1200 -resize 256x256 ./noxz.tech/pub/logo.black.svg ./noxz.tech/pub/logo.png
-	@convert -density 1200 -resize 256x256 ./git.noxz.tech/pub/logo.svg ./noxz.tech/git/pub/logo.png
+	@magick ./noxz.tech/pub/logo.black.svg -density 1200 -resize 256x256 ./noxz.tech/pub/logo.png
+	@magick ./git.noxz.tech/pub/logo.svg -density 1200 -resize 256x256 ./noxz.tech/git/pub/logo.png
 	@
 	@echo assembling tar archive '${ASSEMBLE_TAR}'
 	@./assemble "${ASSEMBLE_TAR}"
 
+only:
+	@echo building $${BUILDONLY}
+	@[ ! -z ${BUILDONLY} ] && ./build
+
 check:
 	@./build check
 
diff --git a/build b/build
@@ -19,6 +19,7 @@ CFG_DIR="./config"
 # ------------------------ groff configuration files ------------------------ #
 CFG_GROFF_WWW_MACRO="${CFG_DIR}/www.conf"
 CFG_GROFF_EQN="${CFG_DIR}/eqn.conf"
+CFG_GROFF_PIC="${CFG_DIR}/pic.conf"
 # ---------------------- main html configuration files ---------------------- #
 CFG_MAIN_HTML="${CFG_DIR}/main.html"
 # ---------------------- git html configuration files ----------------------- #
@@ -123,7 +124,7 @@ render_main_menu() {
 			[ -f "${f}/.buildignore" ] && continue                          # skip buildignore
 
 			ff="$(echo "${f}" | sed "s?^${menu_root}?//${SITE_DOMAIN}?")"
-			fn="$(echo "${f##*/}" | sed 's/_/ /g')"
+			fn="$(echo "${f##*/}" | sed -e 's/__/: /g' -e 's/_/ /g')"
 			menu_output=$(printf '%s<li><a href="%s">%s</a></li>'           \
 				"${menu_output}"                                            \
 				"${ff}"                                                     \
@@ -141,7 +142,7 @@ render_main_menu() {
 				[ -f "${f}/.buildignore" ] && continue                      # skip buildignore
 				menu_output="$(printf '%s<li' "${menu_output}")"
 				ff="$(echo "${f}" | sed "s?^${menu_root}?//${SITE_DOMAIN}?")"
-				fn="$(echo "${f##*/}" | sed 's/_/ /g')"
+				fn="$(echo "${f##*/}" | sed -e 's/__/: /g' -e 's/_/ /g')"
 				menu_output=$(printf '%s><a href="%s">%s</a></li>'          \
 					"${menu_output}"                                        \
 					"${ff}"                                                 \
@@ -159,7 +160,7 @@ render_main_menu() {
 
 			menu_buffer=$(printf '%s<li' "${menu_buffer}")
 			ff="$(echo "${f}" | sed "s?^${menu_root}?//${SITE_DOMAIN}?")"
-			fn="$(echo "${f##*/}" | sed 's/_/ /g')"
+			fn="$(echo "${f##*/}" | sed -e 's/__/: /g' -e 's/_/ /g')"
 			if [ "${f}" = "${menu_active}" ]; then                          # treat active different
 				menu_buffer=$(printf '%s class="active"><a href="%s">%s</a>'\
 					"${menu_buffer}"                                        \
@@ -306,36 +307,100 @@ render_articles() {
 	echo .DIVE
 }
 
+
+
 # fix for grohtml not reliably working for picture extraction
 extract_pictures() {
 	base_path="${SITE_WWW%/*}"
-	eqn=""
-	in_eqn=0
+	pic=""
+	tex=""
+	tex_type=""
+	in_pic=0
+	in_tex=0
 	i=0
 
+	tex_template() {
+		case "$1" in
+		tikz)
+		cat <<-LATEX
+		\\documentclass[tikz,border=10pt]{standalone}
+		\\usepackage{xcolor}
+		\\usepackage{tikz}
+		\\usepackage{ifthen}
+		\\begin{document}
+		\\begin{tikzpicture}
+		${tex}
+		\\end{tikzpicture}
+		\\end{document}
+		LATEX
+		;;
+		equation|*)
+		cat <<-LATEX
+		\\documentclass{article}
+		\\usepackage{amsmath}
+		\\usepackage{amssymb}
+		\\usepackage{xcolor}
+		\\newcommand{\\hi}[1]{\\textcolor{red}{#1}}
+		\\pagestyle{empty}
+		\\begin{document}
+		${tex}
+		\\end{document}
+		LATEX
+		;;
+		esac
+	}
+
 	cat - | while read -r line; do
-		if [ $in_eqn -eq 0 ] && [ "$(echo ${line} | grep '^\.EQ')" = ".EQ" ]; then
-			in_eqn=1
-			eqn=""
+		# extract LaTeX
+		if [ $in_tex -eq 0 ] && echo "${line}" | grep -q '^\.TEXS'; then
+			in_tex=1
+			tex_type=$(echo "${line}" | awk '{print $2}')
+			tex_type=${tex_type:-equation}
+			tex=""
+			continue
+		fi
+		# render and save TEX instance as a svg image
+		if [ $in_tex -eq 1 ] && [ "$(echo ${line} | grep '^\.TEXE')" = ".TEXE" ]; then
+			in_tex=0
+
+			# generate svg from tex
+			tex=$(printf '%s' "${tex}" | sed -e '1s/^\n*//' -e '$s/\n*$//')
+			tex_template "${tex_type}" | tex2svg - - | awk "
+			/<svg/ {
+				match(\$0, /viewBox='([0-9.e+-]+) ([0-9.e+-]+) ([0-9.e+-]+) ([0-9.e+-]+)'/, vb)
+				match(\$0, /width='([0-9.e+-]+)pt'/, w)
+				match(\$0, /height='([0-9.e+-]+)pt'/, h)
+
+				if (vb[0] && w[0] && h[0]) {
+					padding = 1
+					minx    = vb[1] - padding
+					miny    = vb[2] - padding
+					vbw     = vb[3] + padding * 2
+					vbh     = vb[4] + padding * 2
+					width   = w[1]  + padding * 2
+					height  = h[1]  + padding * 2
+
+					sub(/width='[0-9.e+-]+pt'/,  \"width='\" width \"pt'\")
+					sub(/height='[0-9.e+-]+pt'/, \"height='\" height \"pt'\")
+					sub(/viewBox='[^']+'/,       \"viewBox='\" minx \" \" miny \" \" vbw \" \" vbh \"'\")
+				}
+			}
+			{ print }" > "${base_path}/tex-${i}.svg"
+
+			printf '.SVG tex-%s.svg "tex tex-%s"\n' "${i}" "${tex_type}"
+
+			i=$((i+1))
 		fi
-		# catch and save every EQN instance
-		if [ $in_eqn -eq 1 ]; then
-			eqn="${eqn}${line}\n"
+		# catch and save every TEX instance
+		if [ $in_tex -eq 1 ]; then
+			if [ -z "${tex}" ]; then
+				tex="${line}"
+			else
+				tex="$(printf '%s\n%s' "${tex}" "${line}")"
+			fi
 		else
 			printf '%s\n' "${line}"
 		fi
-		# render and save EQN instance as a png image
-		if [ $in_eqn -eq 1 ] && [ "$(echo ${line} | grep '^\.EN')" = ".EN" ]; then
-			in_eqn=0
-			echo "${eqn}"                                                   \
-			| cat "${CFG_GROFF_EQN}" -                                      \
-			| groff -e -k -Tpdf                                             \
-			| convert -density 150 pdf:- -trim -quality 100 -sharpen 0x1.0 -resize 70% png:- > "${base_path}"/"eqn-${i}.png"
-			printf '.IMG %s/eqn-%s.png\n'                                   \
-				"${base_path}"                                              \
-				"${i}"
-			i=$((i+1))
-		fi
 	done
 }
 
@@ -425,6 +490,18 @@ render_main_content() {
 			next
 		}
 
+		/\047/ { # replace apostrophe
+			gsub(/\047/, "\\\[aq\]", $0);
+		}
+
+		/\~/ { # replace tilde
+			gsub(/\~/, "\\\[ti\]", $0);
+		}
+
+		/\^/ { # replace circumflex
+			gsub(/\^/, "\\\[ha\]", $0);
+		}
+
 		/\t/ { # replace tabs with 4 spaces
 			gsub(/\t/, "    ", $0);
 		}
@@ -496,8 +573,8 @@ render_main_content() {
 		-e 's/<dd>/<dd><p>/g'                                               \
 		-e 's/<p><!--/<!--/g' -e 's/--><\/p>/-->/g'                         \
 		-e 's/\[at\]/<span>\&#64;<\/span>/g'                                \
-		-e 's/\(src\|alt\)="[^"]*\(eqn-[0-9]*.png\)/\1="\2/g'               \
-		-e 's/\(<img src="eqn-[0-9]*.png" alt="eqn-[0-9]*.png"\)[^>]*>/<p class="eqn">\1\/><\/p>/g' \
+		-e 's/\(src\|alt\)="[^"]*\(\(eqn\|pic\)-[0-9]*.png\)/\1="\2/g'      \
+		-e 's/\(<img src="\(eqn\|pic\)-[0-9]*.\(png\|svg\)" alt="[^"]*"\)[^>]*>/<p class="\2">\1\/><\/p>/g' \
 		-e 's/<p align="\(left\|center\|right\)"[^>]*>/<p class="\1">/g'    \
 		-e 's/<pre><code>/<div class="code-wrap"><pre><code>/g'             \
 		-e 's/<\/code><\/pre>/<\/code><\/pre><\/div>/g'                     \
@@ -757,6 +834,16 @@ render_git_repo() {
 	repo_path_archive="${1}/${2}/archive"
 	repo_name="${2%.*}"
 	repo_description=""
+	repo_menu="$(
+		printf '<a href="//%s/log.html">Log</a>' "${1}/${2}"
+		printf ' | <a href="//%s/files.html">Files</a>' "${1}/${2}"
+		git -C "${1}/${2}" describe --tags >/dev/null 2>&1 &&               \
+		printf ' | <a href="//%s/tags.html">Tags</a>' "${1}/${2}"
+		git -C "${1}/${2}" show HEAD:README >/dev/null 2>&1 &&              \
+		printf ' | <a href="//%s/file/README.html">README</a>' "${1}/${2}"
+		git -C "${1}/${2}" show HEAD:LICENSE >/dev/null 2>&1 &&             \
+		printf ' | <a href="//%s/file/LICENSE.html">LICENSE</a>' "${1}/${2}"
+	)"
 
 	rsync -a --delete-before "${repo_path}/" "${1}/${2##*/}"
 	git -C "${1}/${2##*/}" --bare update-server-info
@@ -793,6 +880,7 @@ render_git_repo() {
 			render_git_commit "${1}/${2}" "${file}" > "${file_path}.html.tmp"
 		done
 
+
 	# render common html head
 	awk                                                                     \
 		-v var_site="$(awk_safe "${1}")"                                    \
@@ -800,24 +888,15 @@ render_git_repo() {
 		-v var_logo="$(awk_safe "${SITE_ICON_SVG}")"                        \
 		-v var_name="$(awk_safe "${repo_name}")"                            \
 		-v var_description="$(awk_safe "${repo_description}")"              \
-		-v var_menu="$(
-			printf '<a href="//%s/log.html">Log</a>' "${1}/${2}"
-			printf ' | <a href="//%s/files.html">Files</a>' "${1}/${2}"
-			git -C "${1}/${2}" describe --tags >/dev/null 2>&1 &&
-			printf ' | <a href="//%s/tags.html">Tags</a>' "${1}/${2}"
-			git -C "${1}/${2}" show HEAD:README >/dev/null 2>&1 &&          \
-			printf ' | <a href="//%s/file/README.html">README</a>' "${1}/${2}"
-			git -C "${1}/${2}" show HEAD:LICENSE >/dev/null 2>&1 &&         \
-			printf ' | <a href="//%s/file/LICENSE.html">LICENSE</a>' "${1}/${2}"
-		)"                                                                  \
+		-v var_menu="$(awk_safe "${repo_menu}")"                            \
 	'
 		{
-			gsub(/\{:site:\}/, var_site)
-			gsub(/\{:repo:\}/, var_repo)
-			gsub(/\{:logo:\}/, var_logo)
-			gsub(/\{:name:\}/, var_name)
-			gsub(/\{:description:\}/, var_description)
-			gsub(/\{:menu:\}/, var_menu)
+			gsub(/\{:site:\}/,          var_site)
+			gsub(/\{:repo:\}/,          var_repo)
+			gsub(/\{:logo:\}/,          var_logo)
+			gsub(/\{:name:\}/,          var_name)
+			gsub(/\{:description:\}/,   var_description)
+			gsub(/\{:menu:\}/,          var_menu)
 			print
 		}
 	' "${CFG_GIT_HEAD_HTML}" > "${repo_path_head}"
@@ -1151,13 +1230,22 @@ main() {
 	# check if build is possible
 	if [ "$1" = "check" ]; then
 		[ -d "${SITE_GIT_REPO_ROOT}" ] || exit 50
+		
+		missing=0
+		for cmd in tex2svg awk; do
+			if ! command -v "$cmd" >/dev/null 2>&1; then
+				echo "ERROR: '$cmd' is missing"
+				missing=1
+			fi
+		done
+		[ "$missing" -eq 0 ] || exit 52
 	fi
 
 	# make sure both arguments, if existing, are directories
 	[ -n "$1" ] && [ ! -d "$1" ] && return
 	[ -n "$2" ] && [ ! -d "$2" ] && return
 
-	if [ -z "$2" ]; then
+	if [ -z "$2" ] && [ -z "${BUILDONLY}" ]; then
 		print_loading "Running the prerequisite script"
 		# make sure site/git is removed before rendering (to avoid it in menu)
 		rm -rf "${1}/git"
@@ -1256,7 +1344,39 @@ main() {
 		print_loading "Generating sitemaps"
 		generate_sitemap "${1}"
 		print_done
+	elif [ -z "$2" ] && [ ! -z "${BUILDONLY}" ]; then
+
+		render_main "$1" "${BUILDONLY}"
+
+		# convert absolute paths to relative, so that they work with IPFS
+		print_loading "Converting absolute paths to relative"
+		find "${BUILDONLY}" -type f -name "*.html" | while read -r file; do
+			count="$(echo "$file" | tr -cd '/' | wc -c)"
+			sed -i "s,\"//\(${1}\|\[site\]\)/,\"$(
+					seq -f "../%g" -s '' 2 "$count" | sed 's/[0-9]//g'
+				),g" "$file"
+
+			# remove redundant prefix from references
+			grep -o '="../[^"]*"' "$file"                                   \
+			| sed -e 's/^="//g' -e 's/"$//g' | while read -r path; do
+				rel="$(realpath --relative-to="${file%/*}" "${file%/*}/${path}")"
+				rel="$(echo $rel | sed                                      \
+					-e 's/\./\\./g'                                         \
+					-e 's/\&/\\&/g'                                         \
+				)"
+				ref="$(echo $path | sed                                     \
+					-e 's/\./\\./g'                                         \
+					-e 's/\&/\\&/g'                                         \
+				)"
+				sed "s,=\"$ref\",=\"$rel\",g" -i "$file"
+			done
+
+		done
+		print_done
+
 	elif [ -n "$2" ]; then
+		[ ! -z ${BUILDONLY} ] && [ "${BUILDONLY}" != "${2}" ] && return
+
 		# sub render
 		render_main "$1" "$2"
 	fi
diff --git a/config/eqn.conf b/config/eqn.conf
@@ -1,10 +0,0 @@
-.defcolor hicolor rgb .90f .40f .69f
-.EQ
-define iff '\[u21D4]'
-define implies '~\[u21D2]~'
-define hi 'special Hi'
-gsize 14
-.EN
-.de Hi
-.ds 0s \m[hicolor]\\*(0s\m[]
-..
diff --git a/config/www.conf b/config/www.conf
@@ -32,6 +32,26 @@
 .       www-emit-ltag dd
 .   \}
 ..
+.de IMG
+.   ie \\n[www-html] \{\
+.       ie '\\$2'' \{\
+.           HTML <img src="\\$1" alt="\\$1" />
+.       \}
+.       el \{\
+.           HTML <img src="\\$1" alt="\\$2" />
+.       \}
+.   \}
+..
+.de SVG
+.   ie \\n[www-html] \{\
+.       ie '\\$2'' \{\
+.           HTML <object data="\\$1" />
+.       \}
+.       el \{\
+.           HTML <object data="\\$1" class="\\$2" />
+.       \}
+.   \}
+..
 .de TAG-REF
 .   ie \\n[www-html] \{\
 .       HTML (<a href="#\\$1">\\$2</a>)\\$3
@@ -84,12 +104,75 @@
 .       HTML <p class="\\$1">
 .   \}
 ..
+.de BCS
+.   ie \\n[www-html] \{\
+.       HTML <blockquote><p>
+.   \}
+..
+.de BCE
+.   ie \\n[www-html] \{\
+.       HTML </p></blockquote>
+.   \}
+..
 .de ARTTAG
 .   ie \\n[www-html] \{\
 .       HTML <a class="art-tag" href="\\$1">\\$2 <span>\\$3</span></a>\\$4
 .   \}
 ..
 .\" --------------------------------------------------------------------------
+.\" TABLE
+.\"
+.de TBLS
+.   ie \\n[www-html] \{\
+.       ie '\\$1'' \{\
+.           HTML <table>
+.       \}
+.       el \{\
+.           HTML <table class="\\$1">
+.       \}
+.   \}
+..
+.de TBLE
+.   ie \\n[www-html] \{\
+.       HTML </table>
+.   \}
+..
+.de TRS
+.   ie \\n[www-html] \{\
+.       ie '\\$1'' \{\
+.           HTML <tr>
+.       \}
+.       el \{\
+.           HTML <tr class="\\$1">
+.       \}
+.   \}
+..
+.de TRE
+.   ie \\n[www-html] \{\
+.       HTML </tr>
+.   \}
+..
+.de TH
+.   ie \\n[www-html] \{\
+.       ie '\\$2'' \{\
+.           HTML <th>\\$1</th>
+.       \}
+.       el \{\
+.           HTML <th class="\\$1"><span>\\$2</span></th>
+.       \}
+.   \}
+..
+.de TD
+.   ie \\n[www-html] \{\
+.       ie '\\$2'' \{\
+.           HTML <td>\\$1</td>
+.       \}
+.       el \{\
+.           HTML <td class="\\$1"><span>\\$2</span></td>
+.       \}
+.   \}
+..
+.\" --------------------------------------------------------------------------
 .\" DIVS classname
 .\"
 .\"   Start tag for div
diff --git a/noxz.tech/articles/divisibility_theorems_and_fraction_flipping/.assemble b/noxz.tech/articles/divisibility_theorems_and_fraction_flipping/.assemble
@@ -1,2 +1,2 @@
 index.html
-eqn-*.png
+tex-*.svg
diff --git a/noxz.tech/articles/divisibility_theorems_and_fraction_flipping/index.www b/noxz.tech/articles/divisibility_theorems_and_fraction_flipping/index.www
@@ -96,9 +96,9 @@ Divisibility by 1
 This theorem is quite easy to remember. Every integer is divisible by 1.
 
 .DIVS theorem
-.EQ
-1 ~|~ a ~iff~ a ~\[mo]~ "Z\h'-.83m'Z"
-.EN
+.TEXS
+\[ 1 \mid a \iff a \in \mathbb{Z} \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -133,21 +133,21 @@ is divisible by 2, we can represent it as an even number
 .I n , 2
 like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ 2n }
-above
-{ lineup 2 left ( 500a ~+~ 50b ~+~ 5c ~+~ n right ) }
-}
-.EN
+.TEXS
+\begin{align*}
+&1000a + 100b + 10c + 2n
+\\
+&2 \left( 500a + 50b + 5c + n \right)
+\end{align*}
+.TEXE
 
 We can now see that the number is divisible by 2 if, and only if, the last
 digit is divisible by 2. And so the theorem is proven.
 
 .DIVS theorem
-.EQ
-2 ~|~ abcd ~iff~ 2 ~|~ d
-.EN
+.TEXS
+\[ 2 \mid abcd \iff 2 \mid d \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -157,9 +157,9 @@ Divisibility by 3
 The theorem goes that if the sum of all digits in a number is divisible by 3,
 the whole number is divisible by 3, i.e.
 
-.EQ
-3 ~|~ abcd ~iff~ 3 ~|~ left ( a ~+~ b ~+~ c ~+~ d right )
-.EN
+.TEXS
+\[ 3 \mid abcd \iff 3 \mid \left( a + b + c + d \right) \]
+.TEXE
 
 Why is this proposition true?
 
@@ -188,15 +188,15 @@ and
 .I c
 from the first 3 terms, and factor out 3 like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup left ( 999a ~+~ 99b ~+~ 9c right ) ~+~ left ( a ~+~ b ~+~ c ~+~ d right ) }
-above
-{ lineup 3 left ( 333a ~+~ 33b ~+~ 3c right ) ~+~ left ( a ~+~ b ~+~ c ~+~ d right ) }
-}
-.EN
+.TEXS
+\begin{align*}
+& 1000a + 100b + 10c + d
+\\
+& \left( 999a + 99b + 9c \right) + \left( a + b + c + d \right)
+\\
+& 3 \left( 333a + 33b + 3c \right) + \left( a + b + c + d \right)
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 3, and the second term is
 divisible by 3 if, and only if, the sum of
@@ -210,9 +210,9 @@ divisible by 3 if, and only if, the sum of
 is divisible by 3. And so the theorem is proven.
 
 .DIVS theorem
-.EQ
-3 ~|~ abcd ~iff~ 3 ~|~ left ( a ~+~ b ~+~ c ~+~ d right )
-.EN
+.TEXS
+\[ 3 \mid abcd \iff 3 \mid \left( a + b + c + d \right) \]
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases. The procedure
@@ -227,9 +227,9 @@ Divisibility by 4
 The theorem goes that if the last two digits of a number are divisible by 4,
 the whole number is divisible by 4, i.e.
 
-.EQ
-4 ~|~ abcd ~iff~ 4 ~|~ cd
-.EN
+.TEXS
+\[ 4 \mid abcd \iff 4 \mid cd \]
+.TEXE
 
 Why is this proposition true?
 
@@ -253,22 +253,22 @@ This number can be represented as
 .I d .
 Now let's factor out 4 from the first two terms, like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup 4 left ( 250a ~+~ 25b ) ~+~ left ( 10c ~+~ d right ) }
-}
-.EN
+.TEXS
+\begin{align*}
+&1000a + 100b + 10c + d
+\\
+&4 \left( 250a + 25b \right) + \left( 10c + d \right)
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 4, so the whole number is
 divisible by 4 if, and only if, the second term is divisible by 4. And so the
 theorem is proven.
 
 .DIVS theorem
-.EQ
-4 ~|~ abcd ~iff~ 4 ~|~ cd
-.EN
+.TEXS
+\[ 4 \mid abcd \iff 4 \mid cd \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -278,9 +278,9 @@ Divisibility by 5
 The theorem goes that if the last digits of a number are divisible by 5, the
 whole number is divisible by 5, i.e.
 
-.EQ
-5 ~|~ abcd ~iff~ 5 ~|~ d
-.EN
+.TEXS
+\[ 5 \mid abcd \iff 5 \mid d \]
+.TEXE
 
 Why is this proposition true?
 
@@ -304,13 +304,13 @@ This number can be represented as
 .I d .
 Now let's factor out 5 from the first three terms, like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup 5 left ( 500a ~+~ 50b ~+~ 5c right ) ~+~ d }
-}
-.EN
+.TEXS
+\begin{align*}
+&1000a + 100b + 10c + d
+\\
+&5 \left( 500a + 50b + 5c \right) + d
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 5, so the whole number is
 divisible by 5 if, and only if, the second term is divisible by 5. And so the
@@ -319,9 +319,9 @@ and 5, another way of putting it is that if the last digit is 0 or 5, the
 number is divisible by 5.
 
 .DIVS theorem
-.EQ
-5 ~|~ abcd ~iff~ 5 ~|~ d
-.EN
+.TEXS
+\[ 5 \mid abcd \iff 5 \mid d \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -334,9 +334,9 @@ and
 .URL #math-div-theorems-3 "divisibility by 3" .
 
 .DIVS theorem
-.EQ
-6 ~|~ abcd ~iff~ 3 ~|~ left ( a ~+~ b ~+~ c ~+~ d right ) ~\[AN]~ 2~|~d
-.EN
+.TEXS
+\[ 6 \mid abcd \iff 3 \mid \left( a + b + c + d \right) \land 2 \mid d \]
+.TEXE
 .DIVE
 
 .B Note :
@@ -362,17 +362,17 @@ The theorem states that if the difference between the last digit multiplied by
 2 and the remaining digits in a number is divisible by 7, the whole number is
 divisible by 7. I'll show you the procedure with an example below:
 
-.EQ
-lpile {
-{ 7 ~|~ 3423 ~? }
-above
-{ 342 ~-~ 3 ~times~ 2 ~=~ 336 }
-above
-{ 33 ~-~ 6 ~times~ 2 ~=~ 21 }
-above
-{ 7 ~|~ 21 ~implies~ 7 ~|~ 3423 }
-}
-.EN
+.TEXS
+\begin{align*}
+&7 \stackrel{?}{\mid} 3423
+\\
+&342 - 3 \times 2   &= 336
+\\
+&33 - 6 \times 2    &= 21
+\\
+&7 \mid 21          &\Rightarrow 7 \mid 3423
+\end{align*}
+.TEXE
 
 Neat! So how and why does it work? For simplicity's sake, we use a two-digit
 number
@@ -408,36 +408,36 @@ If we have
 and it's divisible by 7, we know that 7 must be a factor of the
 expression. We can now create an equation.
 
-.EQ
-{ a ~-~ 2b ~=~ 7k }
-.EN
+.TEXS
+\[ a - 2b = 7k \]
+.TEXE
 
 Multiply the whole equation by 10, and add one extra
 .I b :
 
-.EQ
-lpile {
-{ hi{10}a ~-~ hi{20}b ~=~ hi{70}k }
-above
-{ 10a ~-~ 20b hi{~+~ b} ~=~ 70k hi{~+~ b} }
-above
-{ 10a ~-~ hi{19b} ~=~ 70k ~+~ b }
-}
-.EN
+.TEXS
+\begin{align*}
+\hi{10}a - \hi{20}b = \hi{70}k
+\\
+10a - 20b \hi{+ b} = 70k \hi{+ b}
+\\
+10a - \hi{19b} = 70k + b
+\end{align*}
+.TEXE
 
 Now add
 .I b "" 20
 to each side of the equation, and try to factor out 7:
 
-.EQ
-lpile {
-{ 10a ~-~ 19b hi{~+~ 20b} ~=~ 70k ~+~ b hi{~+~ 20b} }
-above
-{ 10a hi{~+~ b} ~=~ 70k hi{~+~ 21b} }
-above
-{ 10a ~+~ b ~=~ hi{7 left ( 10k ~+~ 3b right )} }
-}
-.EN
+.TEXS
+\begin{align*}
+10a - 19b \hi{+ 20b} = 70k + b \hi{+ 20b}
+\\
+10a \hi{+ b} = 70k \hi{+ 21b}
+\\
+10a + b = \hi{7 \left( 10k + 3b \right)}
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 7, and our
 left side says
@@ -466,23 +466,23 @@ Just as for
 we know that 7 must be a factor of the expression. We can
 now create another equation:
 
-.EQ
-{ 10a ~+~ b ~=~ 7k }
-.EN
+.TEXS
+\[ 10a + b = 7k \]
+.TEXE
 
 Subtract
 .I b "" 21
 from the whole equation, and factorize:
 
-.EQ
-lpile {
-{ 10a ~+~ b hi{~-~ 21b} ~=~ 7k hi{~-~ 21b} }
-above
-{ 10a hi{~-~ 20b} ~=~ 7k ~-~ 21b }
-above
-{ hi{10 left ( a ~-~ 2b right ) } ~=~ hi{7 left ( k ~-~ 3b right ) } }
-}
-.EN
+.TEXS
+\begin{align*}
+10a + b \hi{- 21b} = 7k \hi{- 21b}
+\\
+10a \hi{- 20b} = 7k - 21b
+\\
+\hi{10 \left( a - 2b \right) } = \hi{7 \left( k - 3b \right) }
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 7, and on
 our left hand, 10 is not divisible by 7, so the expression inside the
@@ -493,9 +493,9 @@ parenthesis must be. But isn't that expression
 We now have the proof for the theorem and can conclude that, indeed,
 
 .DIVS theorem
-.EQ
-7 ~|~ ab ~iff~ 7 ~|~ a ~-~ 2b
-.EN
+.TEXS
+\[ 7 \mid ab \iff 7 \mid a - 2b \]
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases.
@@ -509,9 +509,9 @@ The theorem is quite similar to the theorem for
 The theorem goes that if the last three digits of a number are divisible by 8,
 then the whole number is divisible by 8, i.e.
 
-.EQ
-8 ~|~ abcd ~iff~ 8 ~|~ bcd
-.EN
+.TEXS
+\[ 8 \mid abcd \iff 8 \mid bcd \]
+.TEXE
 
 Why is this proposition true?
 
@@ -535,22 +535,22 @@ This number can be represented as
 .I d .
 Now let's factor out 8 from the first term, like so,
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup 8 left ( 125a right ) ~+~ left ( 100b ~+~ 10c ~+~ d right ) }
-}
-.EN
+.TEXS
+\begin{align*}
+1000a + 100b + 10c + d
+\\
+8 \left( 125a \right) + \left( 100b + 10c + d \right)
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 8, so the whole number is
 divisible by 8 if, and only if, the second term is divisible by 8. And so the
 theorem is proven.
 
 .DIVS theorem
-.EQ
-8 ~|~ abcd ~iff~ 8 ~|~ bcd
-.EN
+.TEXS
+\[ 8 \mid abcd \iff 8 \mid bcd \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -562,9 +562,9 @@ Much like the theorem for
 the theorem goes that if the sum of all digits in a number is divisible by 9,
 the whole number is divisible by 9, i.e.,
 
-.EQ
-9 ~|~ abcd ~iff~ 9 ~|~ left ( a ~+~ b ~+~ c ~+~ d right )
-.EN
+.TEXS
+\[ 9 \mid abcd \iff 9 \mid \left( a + b + c + d \right) \]
+.TEXE
 
 Why is this proposition true?
 
@@ -589,15 +589,15 @@ This number can be represented as
 Now let's break out one a, b, and c from the first 3 terms, and factor out 9
 like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup left ( 999a ~+~ 99b ~+~ 9c right ) ~+~ left ( a ~+~ b ~+~ c ~+~ d right ) }
-above
-{ lineup 9 left ( 111a ~+~ 11b ~+~ 1c right ) ~+~ left ( a ~+~ b ~+~ c ~+~ d right ) }
-}
-.EN
+.TEXS
+\begin{align*}
+1000a + 100b + 10c + d
+\\
+\left( 999a + 99b + 9c \right) + \left( a + b + c + d \right)
+\\
+9 \left( 111a + 11b + 1c \right) + \left( a + b + c + d \right)
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 9, and the second term is
 divisible by 9 if, and only if, the sum of
@@ -611,9 +611,9 @@ divisible by 9 if, and only if, the sum of
 is divisible by 9. And so the theorem is proven.
 
 .DIVS theorem
-.EQ
-9 ~|~ abcd ~iff~ 9 ~|~ left ( a ~+~ b ~+~ c ~+~ d right )
-.EN
+.TEXS
+\[ 9 \mid abcd \iff 9 \mid \left( a + b + c + d \right) \]
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases. The procedure
@@ -628,9 +628,9 @@ Divisibility by 10
 The theorem goes that if the last digits of a number are divisible by 10, the
 whole number is divisible by 10, i.e.
 
-.EQ
-10 ~|~ abcd ~iff~ 10 ~|~ d
-.EN
+.TEXS
+\[ 10 \mid abcd \iff 10 \mid d \]
+.TEXE
 
 Why is this proposition true?
 
@@ -654,13 +654,13 @@ This number can be represented as
 .I d .
 Now let's factor out 10 from the first three terms, like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ lineup 10 left ( 100a ~+~ 10b ~+~ c right ) ~+~ d }
-}
-.EN
+.TEXS
+\begin{align*}
+1000a + 100b + 10c + d
+\\
+10 \left( 100a + 10b + c \right) + d
+\end{align*}
+.TEXE
 
 We can now see that the first term is divisible by 10, so the whole number is
 divisible by 10 if, and only if, the second term is divisible by 10. And so the
@@ -669,9 +669,9 @@ another way of putting it is that if the last digit is 0, the number is
 divisible by 10.
 
 .DIVS theorem
-.EQ
-10 ~|~ abcd ~iff~ 10 ~|~ d
-.EN
+.TEXS
+\[ 10 \mid abcd \iff 10 \mid d \]
+.TEXE
 .DIVE
 
 .HnS 2
@@ -681,15 +681,15 @@ Divisibility by 11
 The theorem goes that a number is divisible by 11 if, and only if, the
 alternate sum of its digits is divisible by 11. Like so,
 
-.EQ
-lpile {
-{ 11 ~|~ 190905 ~? }
-above
-{ 1 ~-~ 9 ~+~ 0 ~-~ 9 ~+~ 0 ~-~ 5 ~=~ -22 }
-above
-{ 11 ~|~ -22 ~implies~ 11 ~|~ 190905 }
-}
-.EN
+.TEXS
+\begin{align*}
+11 \stackrel{?}{\mid} 190905
+\\
+1 - 9 + 0 - 9 + 0 - 5 = -22
+\\
+11 \mid -22 \Rightarrow 11 \mid 190905
+\end{align*}
+.TEXE
 
 Neat! So how and why does it work? For simplicity's sake, we use a four-digit
 number
@@ -713,44 +713,44 @@ This number can be represented as
 This expression can also be represented in another way by manipulating
 the terms. We give and take in an alternating fashion, like so:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ hi{ a left ( 1000 right ) } ~+~
-  hi{ b left ( 100 right ) } ~+~
-  hi{ c left ( 10 right ) } ~+~ d }
-above
-{ a left ( hi{ 1001 ~-~ 1 } right ) ~+~
-  b left ( hi{ 99 ~+~ 1 } right ) ~+~
-  c left ( hi{ 11 ~-~ 1 } right ) ~+~ d }
-above
-{ hi{ 1001a ~-~ a } ~+~
-  hi{ 99b ~+~ b } ~+~
-  hi{ 11c ~-~ c} ~+~ d }
-above
-{ 1001a hi{ ~+~ 99b ~+~ 11c ~-~ a ~+~ b} ~-~ c ~+~ d }
-}
-.EN
+.TEXS
+\begin{align*}
+1000a + 100b + 10c + d
+\\
+\hi{ a \left( 1000 \right) } +
+\hi{ b \left( 100 \right) } +
+\hi{ c \left( 10 \right) } + d
+\\
+a \left( \hi{ 1001 - 1 } \right) +
+b \left( \hi{ 99 + 1 } \right) +
+c \left( \hi{ 11 - 1 } \right) + d
+\\
+\hi{ 1001a - a } +
+\hi{ 99b + b } +
+\hi{ 11c - c} + d
+\\
+1001a \hi{ + 99b + 11c - a + b} - c + d
+\end{align*}
+.TEXE
 
 Now we factorize the expression, like so:
 
-.EQ
-hi{ 11 left ( 91a ~+~ 9b ~+~ c right ) } ~-~ a ~+~ b ~-~ c ~+~ d
-.EN
+.TEXS
+\[ \hi{ 11 \left( 91a + 9b + c \right) } - a + b - c + d \]
+.TEXE
 
 We can see that the first term in the expression is divisible by 11. This means
 that if, and only if, the sum of the other terms is divisible by 11, then the
 whole expression is divisible by 11, and so the theorem is proven.
 
 .DIVS theorem
-.EQ
-lpile {
-{ 11 ~|~ abcd ~iff~ 11 ~|~ -a ~+~ b ~-~ c ~+~ d }
-above
-{ 11 ~|~ abcd ~iff~ 11 ~|~ a ~-~ b ~+~ c ~-~ d }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 11 \mid abcd \iff 11 \mid -a + b - c + d }
+\\
+{ 11 \mid abcd \iff 11 \mid a - b + c - d }
+\end{align*}
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases, as the number
@@ -768,21 +768,21 @@ The theorem states that if the sum of the last digit multiplied by
 4 and the remaining digits in a number is divisible by 13, the whole number is
 divisible by 13. I'll show you the procedure with an example below:
 
-.EQ
-lpile {
-{ 13 ~|~ 76752 ~? }
-above
-{ 7675 ~+~ 2 ~times~ 4 ~=~ 7683 }
-above
-{ 768 ~+~ 3 ~times~ 4 ~=~ 780 }
-above
-{ 78 ~+~ 0 ~times~ 4 ~=~ 78 }
-above
-{ 7 ~+~ 8 ~times~ 4 ~=~ 39 }
-above
-{ 13 ~|~ 39 ~implies~ 13 ~|~ 76752 }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 13 \stackrel{?}{\mid} 76752 }
+\\
+{ 7675 + 2 \times 4 = 7683 }
+\\
+{ 768 + 3 \times 4 = 780 }
+\\
+{ 78 + 0 \times 4 = 78 }
+\\
+{ 7 + 8 \times 4 = 39 }
+\\
+{ 13 \mid 39 \Rightarrow 13 \mid 76752 }
+\end{align*}
+.TEXE
 
 Neat! So how and why does it work? For simplicity's sake, we use a two-digit
 number
@@ -818,36 +818,38 @@ If we have
 and it's divisible by 13, we know that 13 must be a factor of the
 expression. We can now create an equation.
 
-.EQ
-{ a ~+~ 4b ~=~ 13k }
-.EN
+.TEXS
+\[
+a + 4b = 13k
+\]
+.TEXE
 
 Multiply the whole equation by 10, and add one extra
 .I b :
 
-.EQ
-lpile {
-{ hi{10}a ~+~ hi{40}b ~=~ hi{130}k }
-above
-{ 10a ~+~ 40b hi{~+~ b} ~=~ 130k hi{~+~ b} }
-above
-{ 10a ~+~ hi{41b} ~=~ 130k ~+~ b }
-}
-.EN
+.TEXS
+\begin{align*}
+{ \hi{10}a + \hi{40}b = \hi{130}k }
+\\
+{ 10a + 40b \hi{+ b} = 130k \hi{+ b} }
+\\
+{ 10a + \hi{41b} = 130k + b }
+\end{align*}
+.TEXE
 
 Now subtract
 .I b "" 40
 from each side of the equation, and try to factor out 13:
 
-.EQ
-lpile {
-{ 10a ~+~ 41b hi{~-~ 40b} ~=~ 130k ~+~ b hi{~-~ 40b} }
-above
-{ 10a hi{~+~ b} ~=~ 130k hi{~-~ 39b} }
-above
-{ 10a ~+~ b ~=~ hi{13 left ( 10k ~-~ 3b right )} }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 10a + 41b \hi{- 40b} = 130k + b \hi{- 40b} }
+\\
+{ 10a \hi{+ b} = 130k \hi{- 39b} }
+\\
+{ 10a + b = \hi{13 \left( 10k - 3b \right)} }
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 13, and our
 left side says
@@ -876,23 +878,23 @@ Just as for
 we know that 13 must be a factor of the expression. We can
 now create another equation:
 
-.EQ
-{ 10a ~+~ b ~=~ 13k }
-.EN
+.TEXS
+{ 10a + b = 13k }
+.TEXE
 
 Add
 .I b "" 39
 to both sides of the equation, and factorize:
 
-.EQ
-lpile {
-{ 10a ~+~ b hi{~+~ 39b} ~=~ 13k hi{~+~ 39b} }
-above
-{ 10a hi{~+~ 40b} ~=~ 13k ~+~ 39b }
-above
-{ hi{10 left ( a ~+~ 4b right ) } ~=~ hi{13 left ( k ~+~ 3b right ) } }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 10a + b \hi{+ 39b} = 13k \hi{+ 39b} }
+\\
+{ 10a \hi{+ 40b} = 13k + 39b }
+\\
+{ \hi{10 \left( a + 4b \right) } = \hi{13 \left( k + 3b \right) } }
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 13, and on
 our left hand, 10 is not divisible by 13, so the expression inside the
@@ -903,9 +905,11 @@ parenthesis must be. But isn't that expression
 We now have the proof for the theorem and can conclude that, indeed,
 
 .DIVS theorem
-.EQ
-13 ~|~ ab ~iff~ 13 ~|~ a ~+~ 4b
-.EN
+.TEXS
+\[
+13 \mid ab \iff 13 \mid a + 4b
+\]
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases.
@@ -922,35 +926,35 @@ The theorem states that if the difference between last digit multiplied by
 5 and the remaining digits in a number is divisible by 17, the whole number is
 divisible by 17. I'll show you the procedure with an example below:
 
-.EQ
-lpile {
-{ 17 ~|~ 206091 ~? }
-above
-{ 20609 ~-~ 1 ~times~ 5 ~=~ 20604 }
-above
-{ 2060 ~-~ 4 ~times~ 5 ~=~ 2040 }
-above
-{ 204 ~-~ 0 ~times~ 5 ~=~ 204 }
-above
-{ 20 ~-~ 4 ~times~ 5 ~=~ 0 }
-above
-{ 17 ~|~ 0 ~implies~ 17 ~|~ 206091 }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 17 \stackrel{?}{\mid} 206091 }
+\\
+{ 20609 - 1 \times 5 = 20604 }
+\\
+{ 2060 - 4 \times 5 = 2040 }
+\\
+{ 204 - 0 \times 5 = 204 }
+\\
+{ 20 - 4 \times 5 = 0 }
+\\
+{ 17 \mid 0 \Rightarrow 17 \mid 206091 }
+\end{align*}
+.TEXE
 
 If you are not satisfied with 0 being the numerator, here is another example:
 
-.EQ
-lpile {
-{ 17 ~|~ 2057 ~? }
-above
-{ 205 ~-~ 7 ~times~ 5 ~=~ 170 }
-above
-{ 17 ~-~ 0 ~times~ 5 ~=~ 17 }
-above
-{ 17 ~|~ 17 ~implies~ 17 ~|~ 2057 }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 17 \stackrel{?}{\mid} 2057 }
+\\
+{ 205 - 7 \times 5 = 170 }
+\\
+{ 17 - 0 \times 5 = 17 }
+\\
+{ 17 \mid 17 \Rightarrow 17 \mid 2057 }
+\end{align*}
+.TEXE
 
 Neat! So how and why does it work? For simplicity's sake, we use a two-digit
 number
@@ -986,36 +990,38 @@ If we have
 and it's divisible by 17, we know that 17 must be a factor of the
 expression. We can now create an equation.
 
-.EQ
-{ a ~-~ 5b ~=~ 17k }
-.EN
+.TEXS
+\[
+a - 5b = 17k
+\]
+.TEXE
 
 Multiply the whole equation by 10, and add one extra
 .I b :
 
-.EQ
-lpile {
-{ hi{10}a ~-~ hi{50}b ~=~ hi{170}k }
-above
-{ 10a ~-~ 50b hi{~+~ b} ~=~ 170k hi{~+~ b} }
-above
-{ 10a ~-~ hi{49b} ~=~ 170k ~+~ b }
-}
-.EN
+.TEXS
+\begin{align*}
+{ \hi{10}a - \hi{50}b = \hi{170}k }
+\\
+{ 10a - 50b \hi{+ b} = 170k \hi{+ b} }
+\\
+{ 10a - \hi{49b} = 170k + b }
+\end{align*}
+.TEXE
 
 Now add
 .I b "" 50
 to each side of the equation, and try to factor out 17:
 
-.EQ
-lpile {
-{ 10a ~-~ 49b hi{~+~ 50b} ~=~ 170k ~+~ b hi{~+~ 50b} }
-above
-{ 10a hi{~+~ b} ~=~ 170k hi{~+~ 51b} }
-above
-{ 10a ~+~ b ~=~ hi{17 left ( 10k ~+~ 3b right )} }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 10a - 49b \hi{+ 50b} = 170k + b \hi{+ 50b} }
+\\
+{ 10a \hi{+ b} = 170k \hi{+ 51b} }
+\\
+{ 10a + b = \hi{17 \left( 10k + 3b \right)} }
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 17, and our
 left side says
@@ -1044,23 +1050,25 @@ Just as for
 we know that 17 must be a factor of the expression. We can
 now create another equation:
 
-.EQ
-{ 10a ~+~ b ~=~ 17k }
-.EN
+.TEXS
+\[
+10a + b = 17k
+\]
+.TEXE
 
 Subtract
 .I b "" 51
 from both sides of the equation, and factorize:
 
-.EQ
-lpile {
-{ 10a ~+~ b hi{~-~ 51b} ~=~ 17k hi{~-~ 51b} }
-above
-{ 10a hi{~-~ 50b} ~=~ 17k ~+~ 51b }
-above
-{ hi{10 left ( a ~-~ 5b right ) } ~=~ hi{17 left ( k ~-~ 3b right ) } }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 10a + b \hi{- 51b} = 17k \hi{- 51b} }
+\\
+{ 10a \hi{- 50b} = 17k + 51b }
+\\
+{ \hi{10 \left( a - 5b \right) } = \hi{17 \left( k - 3b \right) } }
+\end{align*}
+.TEXE
 
 We can now see that the right side of the equation is divisible by 17, and on
 our left hand, 10 is not divisible by 17, so the expression inside the
@@ -1071,9 +1079,11 @@ parenthesis must be. But isn't that expression
 We now have the proof for the theorem and can conclude that, indeed,
 
 .DIVS theorem
-.EQ
-17 ~|~ ab ~iff~ 17 ~|~ a ~-~ 5b
-.EN
+.TEXS
+\[
+17 \mid ab \iff 17 \mid a - 5b
+\]
+.TEXE
 .DIVE
 
 We have shown that the procedure above will hold for all cases.
@@ -1088,9 +1098,11 @@ recursive algorithm in which the last digit is multiplied by a certain number
 and then either added to or subtracted from the number represented by the
 remaining digits. Similar to this
 
-.EQ
-abcd -> abc ~+~ d times n
-.EN
+.TEXS
+\[
+abcd \rightarrow abc + d \times n
+\]
+.TEXE
 
 where
 .I n
@@ -1099,15 +1111,15 @@ represents the number that is multiplied by the last digit
 In the theorems proven above, the rules for divisibility by 7, 13 and 17 could
 be summarized like so:
 
-.EQ
-lpile {
-{7 ~|~ abcd ~iff~ 7 ~|~  abc -2 times d}
-above
-{13 ~|~ abcd ~iff~ 13 ~|~  abc +4 times d}
-above
-{17 ~|~ abcd ~iff~ 17 ~|~  abc -5 times d}
-}
-.EN
+.TEXS
+\begin{align*}
+{7 \mid abcd \iff 7 \mid  abc -2 \times d}
+\\
+{13 \mid abcd \iff 13 \mid  abc +4 \times d}
+\\
+{17 \mid abcd \iff 17 \mid  abc -5 \times d}
+\end{align*}
+.TEXE
 
 Except for
 .I n
@@ -1271,97 +1283,86 @@ What we need:
 .LI
 The divisibility rule for the prime number 2: is the last digit an even number?
 
-.EQ
-2 ~|~ abcd ~iff~ 2 ~|~ d
-.EN
+.TEXS
+\[
+2 \mid abcd \iff 2 \mid d
+\]
+.TEXE
 
 .LI
 The divisibility rule for the prime number 5: is the last digit a 5 or a 0?
 
-.EQ
-5 ~|~ abcd ~iff~ 5 ~|~ d
-.EN
+.TEXS
+\[
+5 \mid abcd \iff 5 \mid d
+\]
+.TEXE
 
 .LI
 A general rule for any number with the last digit being 1, 3, 7 or 9, including
 the rest of all prime numbers:
 
-.EQ
-n ~|~ abcd ~iff~ n ~|~ abc ~+~ D(n) times d
-.EN
+.TEXS
+\[
+n \mid abcd \iff n \mid abc + D(n) \times d
+\]
+.TEXE
 
 .LI
 A way to calculate D(n):
 
-.EQ
-D(n) ~\[==]~ left {
-matrix {
-lcol {
-~9a + 1,
-above
-~3a + 1,
-above
-~7a + 5,
-above ~a + 1,
-}
-lcol {
-roman{if} ~n = 10a+1
-above
-roman{if} ~n = 10a+3
-above
-roman{if} ~n = 10a+7
-above
-roman{if} ~n = 10a+9
-}
-}
-.EN
+.TEXS
+\begin{align*}
+D(n) =
+\begin{cases}
+9a + 1, & \text{if } n = 10a + 1 \\
+3a + 1, & \text{if } n = 10a + 3 \\
+7a + 5, & \text{if } n = 10a + 7 \\
+a + 1,  & \text{if } n = 10a + 9
+\end{cases}
+\end{align*}
+.TEXE
 
 If we want a small number,
 .I D(n) ,
 to add or subtract:
 
-.EQ
-D sub {s}(n) ~\[==]~ left {
-matrix {
-lcol {
-D(n) - n,
-above
-D(n),
-}
-lcol {
-roman{if} ~n - D(n) < D(n)
-above
-roman{otherwise}
-}
-}
-.EN
+.TEXS
+\begin{align*}
+D_{s}(n) =
+\begin{cases}
+D(n) - n, & \text{if } n - D(n) < D(n) \\
+D(n), & \text{otherwise}
+\end{cases}
+\end{align*}
+.TEXE
 .OLE
 
 Example, get the divisibility algorithm for the prime number 71:
 
-.EQ
-lpile{
-{ D(71) = 9 times 7 + 1 = 64 }
-above
-{ D sub {s}(n) = 64 - 71 = -7 }
-above
-{ implies~ 71~|~abcd ~iff~ 71~|~abc -7d }
-}
-.EN
+.TEXS
+\begin{align*}
+{ D(71) = 9 \times 7 + 1 = 64 }
+\\
+{ D_{s}(n) = 64 - 71 = -7 }
+\\
+{ \Rightarrow 71 \mid abcd \iff 71 \mid abc -7d }
+\end{align*}
+.TEXE
 
 Find out if 87614 is divisible by 71:
 
-.EQ
-lpile{
-{ 8761 -7 times 4 = 8733 }
-above
-{ 873 -7 times 3 = 852 }
-above
-{ 85 -7 times 2 = 71 }
-above
-{ 71 ~|~ 71 ~implies~ 71 ~|~ 87614 }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 8761 -7 \times 4 = 8733 }
+\\
+{ 873 -7 \times 3 = 852 }
+\\
+{ 85 -7 \times 2 = 71 }
+\\
+{ 71 \mid 71 \Rightarrow 71 \mid 87614 }
+\end{align*}
+.TEXE
 
 .HnS 2
 .TAG "math-rev-div-alg-alt"
@@ -1405,38 +1406,38 @@ and
 so that we can deduce the circumstances under which divisibility by 13 is
 possible.
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ 1000a hi{~+~ 300a} ~+~ 100b hi{~+~ 30b} ~+~ 10c hi{~+~ 3c} ~+~ d hi{~+~ 12d}
-  hi{~-~ 300a} hi{~-~ 30b} hi{~-~ 3c} hi{~-~ 12d}
+.TEXS
+\begin{align*}
+{ 1000a + 100b + 10c + d }
+\\
+{ 1000a \hi{+ 300a} + 100b \hi{+ 30b} + 10c \hi{+ 3c} + d \hi{+ 12d}
+  \hi{- 300a} \hi{- 30b} \hi{- 3c} \hi{- 12d}
 }
-above
-{ hi{1300a} hi{~+~ 130b} hi{~+~ 13c} hi{~+~ 13d}
-  ~-~ 300a ~-~ 30b ~-~ 3c ~-~ 12d
+\\
+{ \hi{1300a} \hi{+ 130b} \hi{+ 13c} \hi{+ 13d}
+  - 300a - 30b - 3c - 12d
 }
-above
-{  hi{13 left ( 100a ~+~ 10b ~+~ c ~+~ d right ) }
-   hi{~-~ 3 left ( 100a ~+~ 10b ~+~ c ~+~ 4d right ) }
+\\
+{  \hi{13 \left( 100a + 10b + c + d \right) }
+   \hi{- 3 \left( 100a + 10b + c + 4d \right) }
 }
-}
-.EN
+\end{align*}
+.TEXE
 
 We can now observe that the first term is divisible by 13 since 13 is clearly a
 factor of that term. The second term has the factor 3, which is not divisible
 by 13. Therefore, for the entire expression to be divisible by 13, the sum of
 the terms inside the parenthesis must also be divisible by 13.
 
-.EQ
-lpile {
-{ 100a ~+~ 10b ~+~ c ~+~ 4d }
-above
-{ roman{let}~ 100a ~+~ 10b ~+~ c = abc }
-above
-{ implies~ abc ~+~ 4d }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 100a + 10b + c + 4d }
+\\
+{ \text{let } 100a + 10b + c = abc }
+\\
+{ \Rightarrow abc + 4d }
+\end{align*}
+.TEXE
 
 In other words,
 .I abcd
@@ -1451,38 +1452,38 @@ To demonstrate its applicability when
 = 4 - 13 = -9, we simply subtract and add 27 (3 \[mu] 9) instead of first adding
 and subtracting 12 (3 \[mu] 4), as demonstrated above:
 
-.EQ
-lpile {
-{ 1000a ~+~ 100b ~+~ 10c ~+~ d }
-above
-{ 1000a hi{~+~ 300a} ~+~ 100b hi{~+~ 30b} ~+~ 10c hi{~+~ 3c} ~+~ d hi{~-~ 27d}
-  hi{~-~ 300a} hi{~-~ 30b} hi{~-~ 3c} hi{~+~ 27d}
+.TEXS
+\begin{align*}
+{ 1000a + 100b + 10c + d }
+\\
+{ 1000a \hi{+ 300a} + 100b \hi{+ 30b} + 10c \hi{+ 3c} + d \hi{- 27d}
+  \hi{- 300a} \hi{- 30b} \hi{- 3c} \hi{+ 27d}
 }
-above
-{ hi{1300a} hi{~+~ 130b} hi{~+~ 13c} hi{~-~ 26d}
-  ~-~ 300a ~-~ 30b ~-~ 3c ~+~ 27d
+\\
+{ \hi{1300a} \hi{+ 130b} \hi{+ 13c} \hi{- 26d}
+  - 300a - 30b - 3c + 27d
 }
-above
-{  hi{13 left ( 100a ~+~ 10b ~+~ c ~-~ 2d right ) }
-   hi{~-~ 3 left ( 100a ~+~ 10b ~+~ c ~-~ 9d right ) }
+\\
+{  \hi{13 \left( 100a + 10b + c - 2d \right) }
+   \hi{- 3 \left( 100a + 10b + c - 9d \right) }
 }
-}
-.EN
+\end{align*}
+.TEXE
 
 Once again, the first term is divisible by 13 since 13 is a factor of that
 term. While the second term has the factor 3, which is not divisible by 13, the
 sum of the terms inside the parentheses must be divisible by 13 for the entire
 expression to be divisible by 13.
 
-.EQ
-lpile {
-{ 100a ~+~ 10b ~+~ c ~-~ 9d }
-above
-{ roman{let}~ 100a ~+~ 10b ~+~ c = abc }
-above
-{ implies~ abc ~-~ 9d }
-}
-.EN
+.TEXS
+\begin{align*}
+{ 100a + 10b + c - 9d }
+\\
+{ \text{let } 100a + 10b + c = abc }
+\\
+{ \Rightarrow abc - 9d }
+\end{align*}
+.TEXE
 
 In other words,
 .I abcd
@@ -1506,17 +1507,21 @@ in a division to instead use simpler multiplication. This is how it works:
 
 We start with the division:
 
-.EQ
-{ 3 over 2 } / { 4 over 5 }
-.EN
+.TEXS
+\[
+{ 3 \over 2 } / { 4 \over 5 }
+\]
+.TEXE
 
 From there, we can reconstruct the two fractions as the dividend over
 the divisor with a horizontal line, for simplicity's sake, like so:
 
-.EQ
-{ 3 over 2 } / { 4 over 5 }
-~=~ {{ 3 over 2 } over { 4 over 5 }}
-.EN
+.TEXS
+\[
+\dfrac{3}{2} / \dfrac{4}{5}
+= \dfrac{\dfrac{3}{2}}{\dfrac{4}{5}}
+\]
+.TEXE
 
 After that, the "trick" can begin. First, we multiply both the dividend and the
 divisor with the inverse of the divisor. As long as we treat the dividend and
@@ -1529,53 +1534,65 @@ either by
 or
 .I "xa + xb" .
 
-.EQ
-{ 3 over 2 } / { 4 over 5 }
-~=~ {{ 3 over 2 } over { 4 over 5 }}
-~=~ {{{ 3 over 2 } hi {~times~ 5 over 4 }} over {{ 4 over 5 } hi {~times~ 5 over 4 }}}
-~=~ {{{ 3 over 2 } ~times~ { 5 over 4 }} over hi{{ 4 ~times~ 5 } over { 5 ~times~ 4 }}}
-~=~ {{{ 3 over 2 } ~times~ { 5 over 4 }} over hi{20 over 20}}
-~=~ {{{ 3 over 2 } ~times~ { 5 over 4 }} over hi{1}}
-~=~ { 3 over 2 } ~times~ { 5 over 4 }
-.EN
+.TEXS
+\[
+\dfrac{3}{2} / \dfrac{4}{5}
+= \dfrac{\dfrac{3}{2}}{\dfrac{4}{5}}
+= \dfrac{\dfrac{3}{2} \hi{\times \dfrac{5}{4}}}{\dfrac{4}{5} \hi{\times \dfrac{5}{4}}}
+= \dfrac{\dfrac{3}{2} \times \dfrac{5}{4}}{\hi{\dfrac{4 \times 5}{5 \times 4}}}
+= \dfrac{\dfrac{3}{2} \times \dfrac{5}{4}}{\hi{\dfrac{20}{20}}}
+= \dfrac{\dfrac{3}{2} \times \dfrac{5}{4}}{\hi{1}}
+= \dfrac{3}{2} \times \dfrac{5}{4}
+\]
+.TEXE
 
 As you can see, the right fraction has now "flipped", and not by magic, but
 with logic and reason. So, as division by 1 is equal to the dividend, we can
 then solve the expression, like so:
 
-.EQ
-{ 3 over 2 } ~times~ { 5 over 4 }
-~=~ {{ 3 ~times~ 5 } over { 2 ~times~ 4 }}
-~=~ { 15 over 18 }
-.EN
+.TEXS
+\[
+{ 3 \over 2 } \times { 5 \over 4 }
+= {{ 3 \times 5 } \over { 2 \times 4 }}
+= { 15 \over 18 }
+\]
+.TEXE
 
 As the final cherry on top, we can prove the procedure by dividing 1 by 2, as
 we know this should result in one half.
 
-.EQ
-{ 1 / 2 }
-~=~ { 1 over 1 } / { 2 over 1 }
-~=~ { 1 over 1 } over { 2 over 1 }
-.EN
-
-.EQ
-{ 1 over 1 } / { 2 over 1 }
-~=~ { 1 over 1 } over { 2 over 1 }
-~=~ {{{ 1 over 1 } hi {~times~ 1 over 2 }} over {{ 2 over 1 } hi {~times~ 1 over 2 }}}
-~=~ {{{ 1 over 1 } ~times~ { 1 over 2 }} over hi{{ 2 ~times~ 1 } over { 1 ~times~ 2 }}}
-~=~ {{{ 1 over 1 } ~times~ { 1 over 2 }} over hi{2 over 2}}
-~=~ {{{ 1 over 1 } ~times~ { 1 over 2 }} over hi{1}}
-~=~ { 1 over 1 } ~times~ { 1 over 2 }
-.EN
-
-.EQ
-{ 1 over 1 } ~times~ { 1 over 2 }
-~=~ {{ 1 ~times~ 1 } over { 1 ~times~ 2 }}
-~=~ { 1 over 2 }
-.EN
+.TEXS
+\[
+1 / 2
+= \dfrac{1}{1} / \dfrac{2}{1}
+= \dfrac{\dfrac{1}{1}}{\dfrac{2}{1}}
+\]
+.TEXE
+
+.TEXS
+\[
+\dfrac{1}{1} / \dfrac{2}{1}
+= \dfrac{\dfrac{1}{1}}{\dfrac{2}{1}}
+= \dfrac{\dfrac{1}{1} \hi{\times \dfrac{1}{2}}}{\dfrac{2}{1} \hi{\times \dfrac{1}{2}}}
+= \dfrac{\dfrac{1}{1} \times \dfrac{1}{2}}{\hi{\dfrac{2 \times 1}{1 \times 2}}}
+= \dfrac{\dfrac{1}{1} \times \dfrac{1}{2}}{\hi{\dfrac{2}{2}}}
+= \dfrac{\dfrac{1}{1} \times \dfrac{1}{2}}{\hi{1}}
+= \dfrac{1}{1} \times \dfrac{1}{2}
+\]
+.TEXE
+
+.TEXS
+\[
+{ 1 \over 1 } \times { 1 \over 2 }
+= {{ 1 \times 1 } \over { 1 \times 2 }}
+= { 1 \over 2 }
+\]
+.TEXE
 
 .DIVS theorem
-.EQ
-a over b / c over d ~=~ a over b ~times~ d over c
-.EN
+.TEXS
+\[
+{a \over b} / {c \over d} = {a \over b} \times {d \over c}
+\]
+.TEXE
 .DIVE
diff --git a/noxz.tech/articles/sic_free_software_in_education/index.www b/noxz.tech/articles/sic_free_software_in_education/index.www
@@ -2,7 +2,7 @@ As a Free Software advocate and a soon to be teacher, I agree with
 Richard\~Stallman and the Free Software Foundation about the idea of software
 in schools and education being exclusively Free Software.
 
-In the spirit of caring through sharing, I would like to share two
+In the spirit of caring through sharing, I would like to share three
 articles on the matter.
 
 .DLS
diff --git a/noxz.tech/articles/writing_a_resume_in_groff/example.png b/noxz.tech/articles/writing_a_resume_in_groff/example.png
diff --git a/noxz.tech/articles/writing_a_resume_in_groff/template.ms b/noxz.tech/articles/writing_a_resume_in_groff/template.ms
@@ -91,7 +91,7 @@ T}
 tab(;) nospaces;
 rW15|lx.
 English\m[linecolor];T{
-\m[default]Professional working proficency
+\m[default]Professional working proficiency
 .br
 .sp .2
 T}
@@ -101,7 +101,7 @@ T{
 \m[linecolor]
 T};T{
 .B
-\m[default]Native proficency
+\m[default]Native proficiency
 .R
 .br
 .sp .2
diff --git a/noxz.tech/pub/style.css b/noxz.tech/pub/style.css
@@ -9,7 +9,7 @@ body {
 	overflow-y      : scroll;
 }
 
-/* begining: setup centered theme */
+/* beginning: setup centered theme */
 #header > div, #footer > div, #content > div {
 	max-width       : 980px;
 	margin          : 0 auto;
@@ -120,14 +120,35 @@ p, li {
 	hyphens         : auto;
 }
 
+blockquote {
+	background      : #f9f9f9;
+	border-left     : 10px solid #ccc;
+	margin          : 1.5em 10px;
+	padding         : 0.5em 10px;
+	quotes          : "\201C""\201D""\2018""\2019";
+}
+blockquote:before {
+	color           : #ccc;
+	content         : open-quote;
+	font-size       : 4em;
+	line-height     : 0.1em;
+	vertical-align  : -0.4em;
+}
+blockquote p {
+	display         : inline;
+	font-size       : .9em;
+}
+
 code {
+	border-radius   : 6px;
 	font-family     : monospace;
-	font-size       : 1rem;
+	font-size       : .9em;
 	background-color: #efefef;
-	padding         : 0.3em;
+	padding         : .35em .5em;
 }
 
 pre {
+	border-radius   : 6px;
 	background-color: #fafafa;
 	padding         : 1em;
 	overflow        : auto;
@@ -454,6 +475,50 @@ ul.repo-log li .log-date {
 	padding-right   : 1em;
 }
 
+.no-decoration>ul {
+	margin-left     : 0;
+	padding         : 0;
+}
+
+.no-decoration ul {
+	list-style-type : none;
+	list-style      : none;
+}
+
+table.nice {
+	border-spacing  : 1;
+	border-collapse : collapse;
+	border-radius   : 6px;
+	box-shadow      : 0 0 0 1px rgba(0,0,0,.1);
+	overflow        : hidden;
+	width           : 100%;
+	margin          : 1em auto;
+	font-size       : .8em;
+}
+
+table.nice tr {
+	height          : 48px;
+	border-bottom   : 1px solid rgba(0,0,0,.05);
+	&:last-child {
+	border          : 0;
+	}
+}
+
+table.nice tr th,
+table.nice tr td {
+	text-align      : left;
+	padding         : .5em 1em;
+	font-family     : sans-serif;
+	color           : #444;
+}
+
+table.nice tr td.code span {
+	font-family     : monospace;
+	border-radius   : 6px;
+	background      : #efefef;
+	padding         : .35em .5em;
+}
+
 /* table of contents */
 .toc {
 	background-color: #f6f7fa;
@@ -485,14 +550,23 @@ ul.repo-log li .log-date {
 	padding         : 0;
 }
 
+.pic {
+	text-align      : center !important;
+}
 
-.eqn img {
-	margin-left     : 2em;
-	padding         : 1em 1.5em;
-	border          : 1px solid #ccc;
+object.tex {
+	margin          : 3em auto;
+	display         : block;
+	vertical-align  : middle;
+}
+
+object.tex-equation {
+	margin          : 2em auto;
+	padding         : .5em;
+	transform       : scale(1.45);
 }
 
-.theorem img {
+.theorem object.tex {
 	padding         : 1em 1.5em;
 	border          : 1px double #000;
 	outline         : 2px solid #000;
@@ -522,10 +596,10 @@ dl>dt {
 #hamburger { display: none; }
 #hamburger ~ label { display: none; }
 @media screen and (max-width: 768px) {
-	table,
-	table tbody,
-	table tr,
-	table tr td { display: block !important; }
+	table:not(.nice),
+	table:not(.nice)>tbody,
+	table:not(.nice)>tbody>tr,
+	table:not(.nice)>tbody>tr>td { display: block !important; }
 	#burger-wrapper { display: none; }
 	#nav {
 		width       : auto;