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: 18b55f2fb4118872119dd6b588d36c7f8043191e
parent: d1344350842af60c2564fec2ccf2790110d8d3f6
author: Chris Noxz <chris@noxz.tech>
date:   Sat, 21 Sep 2019 16:15:39 +0200
More maths!
Mnoxz.tech/guides/groff/index.md2+-
Mnoxz.tech/guides/mathematics/index.md86+++++++++++++++++++-
Mnoxz.tech/pub/style.css34+++++++-
3 files changed, 114 insertions(+), 8 deletions(-)
diff --git a/noxz.tech/guides/groff/index.md b/noxz.tech/guides/groff/index.md
@@ -56,7 +56,7 @@ Then use it like this:
 
     [...]
     .LP
-    Calculate the sum of #-4# och #-7#
+    Calculate the sum of #-4# and #-7#
     .sp 1
     .RS
     # (-4) + (-7) #
diff --git a/noxz.tech/guides/mathematics/index.md b/noxz.tech/guides/mathematics/index.md
@@ -8,10 +8,90 @@ out there.
 
 {:: class="toc"}
 {- class="toc-title"}Contents{--}
-+ 1 [Fractions](#math-fractions)
-  + 1.1 [The fraction flip when dividing](#math-fractions-flip)
++ 1 [Divisibility rules](#math-div-rules)
+  + 1.1 [Divisibility by 2](#math-div-rules-2)
++ 2 [Fractions](#math-fractions)
+  + 2.1 [The fraction flip when dividing](#math-fractions-flip)
 {::}
 
+{- id="math-div-rules"}Divisibility rules{--}
+---------------------------------------------
+When it comes to divisibility there exists some neat methods to test a certain
+number's different divisibilities, or factors. Following are those methods and
+their proof.
+
+### {- id="math-div-rules-2"}Divisibility by 2{--}
+It's common knowledge that every even number (numbers ending with an even
+number) is divisible by 2. This is because even numbers are multiples of 2. In
+short, if a number ends with either 0, 2, 4, 6 or 8 it is divisible by 2.
+
+Say we have a number
+{- class="math"}{- class="variable"}xyz{--}{--}, where
+ {- class="math"}{- class="variable"}x{--}{--} represents the number of
+ hundreds,
+ {- class="math"}{- class="variable"}y{--}{--} the number of tens and
+ {- class="math"}{- class="variable"}z{--}{--} the number of ones. This number
+ can be represented as
+{- class="math"}
+..{- class="equation"}
+....{-}100{--}
+....{- class="variable"}x{--}
+....{- class="operator"}+{--}
+....{-}10{--}
+....{- class="variable"}y{--}
+....{- class="operator"}+{--}
+....{- class="variable"}z{--}
+..{--}
+{--}. If {- class="math"}{- class="variable"}z{--}{--} is divisible by 2 we can
+ represent it as an even number
+{- class="math"}
+..{- class="equation"}
+....{-}2{--}
+....{- class="variable"}n{--}
+..{--}
+{--}, like so:
+
+{- class="math block"}
+..{- class="equation"}
+....{-}100{--}
+....{- class="variable"}x{--}
+....{- class="operator"}+{--}
+....{-}10{--}
+....{- class="variable"}y{--}
+....{- class="operator"}+{--}
+....{-}2{--}
+....{- class="variable"}n{--}
+..{--}
+..{- class="operator"}={--}
+..{- class="equation"}
+....{-}2{--}
+....{- class="fenced parenthesis"}
+......{-}50{--}
+......{- class="variable"}x{--}
+......{- class="operator"}+{--}
+......{-}5{--}
+......{- class="variable"}y{--}
+......{- class="operator"}+{--}
+......{- class="variable"}n{--}
+....{--}
+..{--}
+{--}
+
+{- class="math block"}
+..{- class="operator"}&rarr;{--}
+..{- class="equation"}
+....{-}2{--}
+....{- class="operator"}&#x2223;{--}
+....{- class="variable"}xyz{--}
+..{--}
+..{- class="operator"}&hArr;{--}
+..{- class="equation"}
+....{-}2{--}
+....{- class="operator"}&#x2223;{--}
+....{- class="variable"}z{--}
+..{--}
+{--}
+
 {- id="math-fractions"}Fractions{--}
 ------------------------------------
 
@@ -33,7 +113,7 @@ We start of with the division of
 ....{-}5{--}
 ..{--}
 {--}. From there we can reconstruct the two fractions as the dividend over
-the divisor with a horizontal line, for simplicity's sake, like so:
+ the divisor with a horizontal line, for simplicity's sake, like so:
 
 {- class="math block"}
 ..{- class="fraction"}
diff --git a/noxz.tech/pub/style.css b/noxz.tech/pub/style.css
@@ -256,8 +256,7 @@ ul.repo-log li .log-date {
 /* math extensions (alternative to MathML) */
 .math {
     font-family     : monospace;
-    /*font-size       : 1em;
-    line-height     : 1.6em;*/
+    font-size       : 1.1em;
 }
 
 .math.block {
@@ -275,6 +274,21 @@ ul.repo-log li .log-date {
     visibility      : hidden;
 }
 
+.math .variable {
+    vertical-align  : middle;
+    font-style      : italic;
+    padding         : 0;
+}
+
+.math .equation {
+    vertical-align  : middle;
+    padding         : 0 2px;
+}
+
+.math .equation>* {
+    vertical-align  : middle;
+}
+
 .math .operator {
     font-family     : "Latin Modern Math", "STIX Two Math", "XITS Math",
                       "STIX Math", "Libertinus Math", "TeX Gyre Termes Math",
@@ -283,11 +297,23 @@ ul.repo-log li .log-date {
                       "Asana Math", "Cambria Math", "Lucida Bright Math",
                       "Minion Math", STIXGeneral, STIXSizeOneSym, Symbol,
                       "Times New Roman", serif;
-    /*font-size       : 1em;*/
+    font-size       : 0.9em;
     padding         : 0 2px;
     vertical-align  : middle;
 }
 
+.math .fenced {
+    padding         : 0 0.4em;
+    margin          : 0 0.2em;
+}
+
+.math .fenced.parenthesis {
+    border-radius   : 3px;
+    border          : 1px solid #444;
+    border-top      : none;
+    border-bottom   : none;
+}
+
 .math .fraction,
 .math .fraction>span:first-child,
 .math .fraction>span:last-child {
@@ -302,5 +328,5 @@ ul.repo-log li .log-date {
 
 .math .fraction>span:last-child {
     display         : block;
-    border-top      : 1px solid #000000;
+    border-top      : 1px solid #444;
 }