From 7175a9c8e1bfb2a19cb77d8ce5b8c9609a7b3e4d Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Tue, 1 Aug 2023 15:36:09 -0700 Subject: changed phplatex to use hex --- src/head.php | 2 +- src/phplatex.php | 11 ++-- src/style.css | 149 --------------------------------------------- src/style.php | 136 +++++++++++++++++++++++++++++++++++++++++ src/vars.php | 6 ++ src/writing/derivative.php | 5 +- 6 files changed, 150 insertions(+), 159 deletions(-) delete mode 100644 src/style.css create mode 100644 src/style.php create mode 100644 src/vars.php diff --git a/src/head.php b/src/head.php index 8e33858..bb3358f 100644 --- a/src/head.php +++ b/src/head.php @@ -4,7 +4,7 @@ ini_set('display_errors', 1); ?> - + diff --git a/src/phplatex.php b/src/phplatex.php index f8bebeb..ce6a2fe 100644 --- a/src/phplatex.php +++ b/src/phplatex.php @@ -35,24 +35,21 @@ function phplatex_colorhex($r,$g,$b) { } -function texify($string,$dpi='90', $r=0.0,$g=0.0,$b=0.0, $br=1.0,$bg=1.0,$bb=1.0,$extraprelude="", $trans=FALSE) { +function texify($string,$dpi='90',$fore="",$back="",$extraprelude="",$trans=FALSE) { global $imgfmt,$path_to_latex,$path_to_dvips,$path_to_convert; if ($dpi>300) $dpi=300; - $back = phplatex_colorhex($br,$bg,$bb); - $fore = phplatex_colorhex($r,$g,$b); - # Figure out TeX string, either to get the right cache entry, or to compile # Adds semi-common symbol packages (ams) # used to include ,landscape in documentclass to avoid page wrapping, but it seems this sometimes implies 90 degree rotation $totex = "\\documentclass[14pt]{extarticle}\n". - "\\usepackage{color}\n". + "\\usepackage{xcolor}\n". "\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n". $extraprelude."\n". "\\pagestyle{empty}\n". #removes header/footer; necessary for trim "\\begin{document}\n". - "\\color[rgb]{".$r.",".$g.",".$b."}\n". - "\\pagecolor[rgb]{".$br.",".$bg.",".$bb."}\n". + "\\color[HTML]{".$fore."}\n". + "\\pagecolor[HTML]{".$back."}\n". $string."\n". "\\end{document}\n"; $hashfn = sha1($totex).".".$dpi.".".$fore.".".$back.".".intval($trans); #file cache entry string: 40-char hash string plus size diff --git a/src/style.css b/src/style.css deleted file mode 100644 index 26cec6d..0000000 --- a/src/style.css +++ /dev/null @@ -1,149 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap'); - -:root { - /* COLOURSCHEME 1, BLUE */ - /* - --background: #121d28; - --text: #bbd7f2; - --header: #bbd7f2; - --secondary: #76baf9; - --highlight: #7ceea7; - */ - /* COLOURSCHEME 2, ORANGE */ - /* - --background: #141210; - --header: #fdb04d; - --text: #faca8b; - --secondary: #ee8041; - --highlight: #ee4c41; - */ - /* COLOURSCHEME 3, RED? */ - --background: #1E1B1B; - --text: #F5F5F5; - --header: #F5F5F5; - --secondary: #FF5A5F; - --highlight: #FF8A8C; -} - -body { - margin: 0px; - background-color: var(--background); -} - -@media (max-aspect-ratio: 6/7) { - .contentpane { - margin: auto; - width: 100%; - min-height: 100%; - } -} - -@media (min-aspect-ratio: 7/7) { - .contentpane { - margin: auto; - width: 60%; - min-height: 100%; - } -} - -p { - text-align: left; - text-indent: 25px; - font-family: 'Quicksand', sans-serif; - font-size: 16pt; - color: var(--text); - padding: 8px 50px 8px 50px; -} - -h1 { - text-align: center; - font-family: 'Quicksand', sans-serif; - font-size: 30pt; - font-weight: 600; - color: var(--header); - padding: 50px 50px 3px 50px; - margin: auto auto 0px auto; -} - -h2 { - text-align: center; - font-family: 'Quicksand', sans-serif; - font-size: 24pt; - font-weight: 600; - color: var(--header); - padding: 8px 50px 8px 50px; -} - -h3 { - text-align: left; - text-indent: 55px; - font-family: 'Quicksand', sans-serif; - font-size: 16pt; - font-weight: 600; - color: var(--text); - padding: 8px 50px 2px 50px; -} - -h3.nav { - text-align: center; - text-indent: 0px; - padding: 3px 50px 8px 50px; - margin: 0px auto auto auto; -} - -ul h3 { - font-style: italic; - text-align: left; - text-indent: 0px; - padding: 8px 50px 8px 50px; -} - -ul h3 a { - font-style: italic; -} - -ul p { - text-indent: 0px; - font-family: 'Quicksand', sans-serif; - font-size: 16pt; - color: var(--text); - padding: 8px 50px 8px 50px; -} - -a { - color: var(--secondary); - font-family: 'Quicksand', sans-serif; - text-decoration: none; -} - -a:hover { - color: var(--highlight); -} -a.backbutton { - font-style: normal; - font-size: 80%; - text-decoration: none; - padding: 0px; -} - -ul { - list-style-position: outside; - padding: 0px 0px 0px 75px; -} - -li { - color: var(--highlight); -} - -hr { - border-color: var(--text); - background-color: var(--text); -} - -.footer { - width: auto; - margin: auto; -} -.ascii { - color: var(--secondary); -} diff --git a/src/style.php b/src/style.php new file mode 100644 index 0000000..b55bb90 --- /dev/null +++ b/src/style.php @@ -0,0 +1,136 @@ + +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap'); + +:root { + --background: #; + --text: #; + --header: #; + --secondary: #; + --highlight: #; +} + +body { + margin: 0px; + background-color: var(--background); +} + +@media (max-aspect-ratio: 6/7) { + .contentpane { + margin: auto; + width: 100%; + min-height: 100%; + } +} + +@media (min-aspect-ratio: 7/7) { + .contentpane { + margin: auto; + width: 60%; + min-height: 100%; + } +} + +p { + text-align: left; + text-indent: 25px; + font-family: 'Quicksand', sans-serif; + font-size: 16pt; + color: var(--text); + padding: 8px 50px 8px 50px; +} + +h1 { + text-align: center; + font-family: 'Quicksand', sans-serif; + font-size: 30pt; + font-weight: 600; + color: var(--header); + padding: 50px 50px 3px 50px; + margin: auto auto 0px auto; +} + +h2 { + text-align: center; + font-family: 'Quicksand', sans-serif; + font-size: 24pt; + font-weight: 600; + color: var(--header); + padding: 8px 50px 8px 50px; +} + +h3 { + text-align: left; + text-indent: 55px; + font-family: 'Quicksand', sans-serif; + font-size: 16pt; + font-weight: 600; + color: var(--text); + padding: 8px 50px 2px 50px; +} + +h3.nav { + text-align: center; + text-indent: 0px; + padding: 3px 50px 8px 50px; + margin: 0px auto auto auto; +} + +ul h3 { + font-style: italic; + text-align: left; + text-indent: 0px; + padding: 8px 50px 8px 50px; +} + +ul h3 a { + font-style: italic; +} + +ul p { + text-indent: 0px; + font-family: 'Quicksand', sans-serif; + font-size: 16pt; + color: var(--text); + padding: 8px 50px 8px 50px; +} + +a { + color: var(--secondary); + font-family: 'Quicksand', sans-serif; + text-decoration: none; +} + +a:hover { + color: var(--highlight); +} +a.backbutton { + font-style: normal; + font-size: 80%; + text-decoration: none; + padding: 0px; +} + +ul { + list-style-position: outside; + padding: 0px 0px 0px 75px; +} + +li { + color: var(--highlight); +} + +hr { + border-color: var(--text); + background-color: var(--text); +} + +.footer { + width: auto; + margin: auto; +} +.ascii { + color: var(--secondary); +} diff --git a/src/vars.php b/src/vars.php new file mode 100644 index 0000000..fa9218a --- /dev/null +++ b/src/vars.php @@ -0,0 +1,6 @@ + diff --git a/src/writing/derivative.php b/src/writing/derivative.php index 28bc00d..a7a369a 100644 --- a/src/writing/derivative.php +++ b/src/writing/derivative.php @@ -3,14 +3,15 @@ $title = "The Calculus of Infinitesimals"; require($_SERVER["DOCUMENT_ROOT"] . "/head.php"); require($_SERVER["DOCUMENT_ROOT"] . "/header.php"); include($_SERVER["DOCUMENT_ROOT"] . "/phplatex.php"); +include($_SERVER["DOCUMENT_ROOT"] . "/vars.php"); ?>

Calculus is often used as the complete name of a branch of mathematics dealing with rates of change and very small numbers. In fact, a calculus is a specific discipline or method for the analysis of some set of problems. The fact that the calculus of infinitesimals - has come to known in this way is a testament to its importance. + has come to be known in this way is a testament to its importance.

- + Cube root of two:

-- cgit v1.2.3-70-g09d2