diff options
author | Kai Stevenson <kai@kaistevenson.com> | 2023-08-01 20:36:04 -0700 |
---|---|---|
committer | Kai Stevenson <kai@kaistevenson.com> | 2023-08-01 20:36:04 -0700 |
commit | 1ebf6a6467167ae9ec0db0c069cfe6170dbcc18f (patch) | |
tree | 6b9adb4cd20c8e4b0db7da620bcf6dfa55642666 | |
parent | 88bbd745f7ce7c3b0a4e91777ba1b34e22821c34 (diff) |
started calculus, fixed error in colorspace for phplatex
-rw-r--r-- | src/phplatex.php | 2 | ||||
-rw-r--r-- | src/style.php | 7 | ||||
-rw-r--r-- | src/writing/derivative.php | 25 |
3 files changed, 29 insertions, 5 deletions
diff --git a/src/phplatex.php b/src/phplatex.php index 6557ff0..4d2c60b 100644 --- a/src/phplatex.php +++ b/src/phplatex.php @@ -119,7 +119,7 @@ function texify($string,$dpi='90',$fore="",$back="",$extraprelude="",$trans=FALS if ($trans) { $convert_cmd .= ' -transparent-color "#'.$back.'" -transparent "#'.$back.'"'; } - $convert_cmd .= ' -colorspace RGB -density '.$dpi.' -trim +page '.$tfn.'.ps '.$tfn.'.'.$imgfmt; + $convert_cmd .= ' -colorspace sRGB -density '.$dpi.' -trim +page '.$tfn.'.ps '.$tfn.'.'.$imgfmt; exec($convert_cmd); #Note: +page OR -page +0+0 OR +repage moves the image to the cropped area (kills offset) diff --git a/src/style.php b/src/style.php index b55bb90..52fd66a 100644 --- a/src/style.php +++ b/src/style.php @@ -39,7 +39,7 @@ p { font-family: 'Quicksand', sans-serif; font-size: 16pt; color: var(--text); - padding: 8px 50px 8px 50px; + margin: 8px 75px 8px 75px; } h1 { @@ -94,7 +94,6 @@ ul p { font-family: 'Quicksand', sans-serif; font-size: 16pt; color: var(--text); - padding: 8px 50px 8px 50px; } a { @@ -134,3 +133,7 @@ hr { .ascii { color: var(--secondary); } +.center { + text-align: center; + margin: 14px 40px 14px 40px; +} diff --git a/src/writing/derivative.php b/src/writing/derivative.php index a7a369a..17f2e7f 100644 --- a/src/writing/derivative.php +++ b/src/writing/derivative.php @@ -3,7 +3,11 @@ $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");
+require($_SERVER["DOCUMENT_ROOT"] . "/vars.php");
+function tex($latex) {
+ global $c_fg, $c_bg;
+ return texify($latex, 130, $c_fg, $c_bg, "", FALSE);
+}
?>
<p>
<i>Calculus</i> is often used as the complete name of a branch of mathematics dealing with
@@ -12,6 +16,23 @@ include($_SERVER["DOCUMENT_ROOT"] . "/vars.php"); has come to be known in this way is a testament to its importance.
</p>
<p>
- Cube root of two: <?php echo(texify("$\\sqrt[3]{2}\$", 160, $c_fg, $c_bg, "", TRUE)); ?>
+ To understand calculus, it is critical to understand the derivative. Let us begin with
+ the definition of a function.
+</p>
+<p class="center"><?php echo(tex("\$y=f(x)\$")); ?></p>
+<p>
+ This expression defines a relation between two quantities <i>x</i> and <i>y</i>. It can be said that
+ y is given <i>in terms of</i> x. Specifically, we have defined a function <i>f</i> that provides
+ a mapping for values of x. The actual mapping of a given function varies; what follows is
+ one example.
+</p>
+<p class="center"><?php echo(tex("\$f(x)=ax\$")); ?></p>
+<p>
+ Here, the value of the function is said to be equal to the product of its argument, and
+ a constant <i>a</i>. Take note of the fact that this is a constant multiple, as it means that
+ the function is said to be linear--an important property. Evidently,
+ <?php echo(tex("\$y=f(x)=ax\\Rightarrow y=ax\$")); ?> by the transitive property.
+ Here, the relation between y and x becomes clear; y is greater than x by a multiple a.
+ Observe the pattern that forms when evaluating f at various x.
</p>
<?php require($_SERVER["DOCUMENT_ROOT"] . "/footer.php"); ?>
|