MBX Tip #3. Customize your colors

57 views
Skip to first unread message

David Farmer

unread,
Oct 19, 2016, 7:27:25 PM10/19/16
to mathbook-x...@googlegroups.com

Did you know that there are 8 different color schemes available
for the HTML version of your book? And there can be more,
including one customized with the colors of your university.

In the file

mathbook-html.xsl

you will find a line

<xsl:param name="html.css.file" select="'mathbook-3.css'" />

You can replace

mathbook-3.css

by mathbook-N.css , where N is any element of this set:

{0, 1, 2, 3, 4, 5, 6, ups}

The last one stands for "University of Puget Sound" and it uses
the official colors of the employer of our fearless leader.

To see the colors of mathbook-N.css , look at Section N+1 here:

http://sl2x.aimath.org/development/collectedworks/htmlpaper/colorsample/
(the ups colors are used in the bibliography)

Each color scheme is built from two basic colors. Feel free to
contact me if you are interested in creating a new color scheme.

Regards,

David

ps. There may be (or there will be) a more elegant/official way
to change the colors. Other customization options are being
developed. You can use the ups colors even if you are not
affiliated with that institution.

Rob Beezer

unread,
Oct 19, 2016, 8:37:16 PM10/19/16
to mathbook-x...@googlegroups.com
Thanks, David - that is a fun demo.

One comment: don't actually edit mathbook-html.xsl or you will get a conflict
the next time you pull to update the code.

But DO use

-stringparam html.css.file mathbook-N.css

on your xsltproc command-line (in a script?). You can also use a "thin" XSL
file like we use for Judson's AATA or as demo'ed in the "contrib" directory of
the MBX distribution.

Until the documentation gets better, the place David mentions is the place to go
see what the right names are.

Rob

Karl-Dieter Crisman

unread,
Oct 20, 2016, 9:44:07 AM10/20/16
to MathBook XML Support, bee...@ups.edu

Thanks, David - that is a fun demo.


Yes, this really helps see what the options are, thank you!

One note: At http://sl2x.aimath.org/development/collectedworks/htmlpaper/colorsample/section7x.html I get a big box around an align environment on Safari with no MathJax rendering. Doesn't seem to be spurious.

Joe Christensen

unread,
Sep 11, 2017, 2:46:26 PM9/11/17
to MathBook XML Support
Hi, David.

This is cool.  Thanks.  

I found this while looking for a way to set my Touchstone asides as a specific and distinct color throughout the book.
Although I expect the answer is no, I wonder if anything more was developed as indicated as a possibility in your note?
I am also wondering if there is an option for changing the color of an assemblage or an aside?

Thanks

Joe

David Farmer

unread,
Sep 11, 2017, 3:25:47 PM9/11/17
to MathBook XML Support

Dear Joe,

As soon as the new format of asides has stabilized, we will
move on to classifying the types of asides (touchstone, warning,
historical note, etc). I suspect that one those are implemented,
they will be styled differently.

Not this week. Maybe next.

Regards,

David
> --
> You received this message because you are subscribed to the Google Groups "MathBook XML Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mathbook-xml-sup...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

Joe Christensen

unread,
Sep 11, 2017, 3:34:33 PM9/11/17
to MathBook XML Support
No rush, just curious.  Thanks

Michael Doob

unread,
Apr 5, 2018, 6:03:20 PM4/5/18
to MathBook XML Support
Since the subject has been brought up:

David kindly gave me the parameter for my own university.
I run xltproc with a file, the top few lines of which are:

     <?xml version="1.0" encoding="UTF-8"?>

     <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

     <xsl:import href="/home/mdoob/mathbook/xsl/mathbook-html.xsl" />
     <xsl:param name="html.css.file" select="'mathbook-manitoba.css'" />

Everything runs fine, but the initial page has the default blue-white colours,
but when you move to a new page the colours become the Manitoba ones.
This happens on all browsers.

Any ideas of why this happens?

Cheers,
Michael

PS My students thought the new colours were great!
Reply all
Reply to author
Forward
0 new messages