summaryrefslogtreecommitdiff
path: root/73996-src/README-math.txt
diff options
context:
space:
mode:
authorpgww <pgww@lists.pglaf.org>2026-05-24 11:01:14 -0700
committerpgww <pgww@lists.pglaf.org>2026-05-24 11:01:14 -0700
commit0df7fe5a4271acbe003ae1940137a98da10edc9f (patch)
treea5c1936a8886e3d173a835f0edcc2bb5b99eec35 /73996-src/README-math.txt
parent38045adbb4433c5c277de452d48ae1fdb0646f86 (diff)
add math sourceHEADmain
Diffstat (limited to '73996-src/README-math.txt')
-rw-r--r--73996-src/README-math.txt115
1 files changed, 115 insertions, 0 deletions
diff --git a/73996-src/README-math.txt b/73996-src/README-math.txt
new file mode 100644
index 0000000..d7be885
--- /dev/null
+++ b/73996-src/README-math.txt
@@ -0,0 +1,115 @@
+MathJax HTML source file instructions
+====================
+This project has math with high complexity equations (integrals, partial
+derivatives, gradients, matrices, etc.), grouped equations, etc. The source is
+a preliminary HTML file that uses MathJax to define mathematical expressions,
+which is processed to generate a final HTML file, along with SVG images with
+file names consisting of a number and “.svg”, such as “4.svg”.
+
+This source file is kept for the purpose of applying errata fixes. Although the
+MathJax takes some learning, it is clearer than the generated final. This also
+allows the SVG images to be regenerated with changes.
+
+Owing to the complexity of this type of book, it is not required to submit a
+text file.
+
+Inline svg note
+====================
+It is possible to use inline svg in the html file rather than images. It is
+essential in this case also to keep the source file.
+
+
+MathML note
+====================
+For books with less complex math, this may be a good choice. It does not
+require extra processing.
+
+
+Tools
+====================
+See the ppmath GitHub repository:
+ https://github.com/DistributedProofreaders/ppmath.
+Follow the instructions to install m2svg. Don't forget to run "npm update -g"
+before installing m2svg.
+
+Command line:
+ m2svg -i input.htm -o output.htm
+
+- The SVG files will be placed in a subdirectory of the working directory
+ called "images".
+
+- In the converted file, the maths expressions, delimited by the tags `\[`
+ and `\]` for *display* expressions or `\(` and `\)` for *inline*
+ expressions, are replaced by `<img>` links.
+
+- The "data-tex" attribute will contain the original maths expression.
+
+
+Inline code example
+====================
+For the expression AB^2 = AG × BD
+the input
+ `\(\mathrm{AB}^{2} = \mathrm{AG} \times \mathrm{BD}\)`
+
+becomes
+ `<span class="nowrap"><img style="vertical-align: -0.186ex; width: 16.872ex;
+ height: 2.253ex;" src="images/4.svg" alt="" data-tex="\mathrm{AB}^{2}
+ = \mathrm{AG} \times \mathrm{BD}">,</span>`
+
+The file images/4.svg displays the desired expression.
+
+
+Source files structure on Project Gutenberg
+====================
+(eBook 75107 is used as an example)
+
+- 75107/
+ - 75107-0.txt (optional)
+ - 75107-h/
+ - 75107-h.htm (final HTML file)
+ - images/ (generated SVGs + other images)
+ - cover.jpg
+ - 1.svg
+ - (etc.)
+ - 75107-src/
+ - 75107-src.htm (source HTML file with MathJax)
+ - README-math.txt (this file)
+
+
+Submission process
+====================
+- Generated final HTML and images should be submitted as normal.
+- In addition, the source HTML will be included in a "source/" subdirectory.
+- This readme will also be included in the "source/" subdirectory.
+ - Having it with the eBook makes it obvious, and avoids issues with
+ procedures changing in the future.
+- The submitter should add a note that this is a MathJax project, and whether a
+ text file is included.
+- Workflow will rename the source/ subdirectory and HTML file.
+
+
+Errata process
+====================
+(eBook 75107 is used as an example)
+
+1. Download the project files using Errata Workbench, and unzip.
+2. Install m2svg if not already done.
+3. Make the desired changes to 75107-src.htm.
+4. Execute command line "m2svg -i 75107-src.htm -o 75107-h.htm".
+ - The image files will be placed in a subdirectory of the working directory
+ called "images".
+ - Check error report: filename_svgerr.err (as generated by Guiguts 2)
+ - Preview 75107-h.htm in a browser to make sure that all changes are properly
+ added.
+5. Move 75107-h.htm to the 75107-h directory.
+6. Move the contents of the images directory to the 75107-h/images directory.
+ - The generated images are just a number with .svg extension. There could be
+ other svg files which are not generated by m2svg. It is best to remove the
+ existing generated files from 75107-h/images first.
+ - Any non-generated images should be kept. Otherwise, if the edit results in
+ there being fewer generated images than before, some old ones could be left
+ behind.
+7. Remove the generated images subdirectory and any other temporary files.
+8. Run PPhtml from Guiguts 2 or Post-Processing Workbench to verify all images
+ are used, and none are missing.
+9. Zip the project directory and upload to Errata Workbench.