Improving Math Symbol Alignment on Google Sites: A Scientist's Guide

  • Context: LaTeX 
  • Thread starter Thread starter caffeinemachine
  • Start date Start date
  • Tags Tags
    Google Latex
Click For Summary

Discussion Overview

The discussion revolves around the challenges of aligning math symbols with text on Google Sites, specifically focusing on the use of MathJax for improved rendering of LaTeX. Participants explore various methods and share experiences related to integrating mathematical notation into web content.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant expresses frustration with the alignment of math symbols when using HTML boxes on Google Sites, noting that the output is visually unappealing.
  • Another participant suggests using MathJax for better alignment of text and LaTeX, asking if it can be installed on the site.
  • A participant shares a script for enabling MathJax on web pages, detailing the configuration needed for rendering LaTeX code properly.
  • One participant expresses skepticism about MathJax, describing it as a "bugaboo" and indicating a lack of familiarity with it, while considering consulting a knowledgeable friend.
  • Another participant points out that Google Sites may not support JavaScript, complicating the implementation of MathJax.
  • A suggestion is made to check out resources for converting LaTeX to HTML as an alternative approach.
  • A participant raises a question about the types of code permitted on Google Sites, emphasizing the need for user-friendly input methods for rendering LaTeX.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method for integrating math symbols into Google Sites, with differing opinions on the feasibility and usability of MathJax and other alternatives.

Contextual Notes

Limitations include uncertainty about the compatibility of JavaScript with Google Sites and the varying levels of technical knowledge among participants, which may affect their ability to implement suggested solutions.

caffeinemachine
Gold Member
MHB
Messages
799
Reaction score
15
I want to write math symbols along with normal text on my google site. I googled on how to go about doing that. That led me to this page https://sites.google.com/site/gencoreoperative/index/articles-and-hacks/google-s-latex

So now what I did was put "Prove that for any natural number <img src="http://www.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chco=000000&chl=n" /> the number <img src="http://www.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chco=000000&chl=\displaystyle{2n}\choose{n}" /> divides the least common multiple of <img src="http://www.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chco=000000&chl=1,\,2,\,\ldots,\,2n-1,\,2n" />." inside an 'HTML Box' I inserted using the insert menu. It works but the output is extremely ugly. The Math symbols are not properly aligned with the text.
 
Physics news on Phys.org
We use MathJax here, which provides very nice alignment of text and $\LaTeX$. Is there a way you could install MathJax on your site?
 
What I did to enable MathJax on my website (credits to Jameson for showing me) is add this script to the top of every page you want to become math-enabled:

Code:
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({

    TeX: {extensions: ["cancel.js"]},
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
 displayAlign: "center",
          displayIndent: "2em",
    tex2jax: {
       inlineMath: [ ['$','$'], ['\\(','\\)'] ], 
displayMath: [ ['$$','$$'], ['\\\[','\\\]'] ],
      processEscapes: true
    }
  });  
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

Then on those pages everything between dollar signs will be interpreted as LaTeX code and rendered accordingly.
 
Ackbach said:
We use MathJax here, which provides very nice alignment of text and $\LaTeX$. Is there a way you could install MathJax on your site?
Thanks Ackbach for replying. To me 'MathJax' is a bugaboo. I have heard stories that people use MathJax.. but I don't know anything more than that about it. :o I'll ask my techie friend about MathJax.. he might know something.

- - - Updated - - -

Bacterius said:
What I did to enable MathJax on my website (credits to Jameson for showing me) is add this script to the top of every page you want to become math-enabled:

Code:
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({

    TeX: {extensions: ["cancel.js"]},
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
 displayAlign: "center",
          displayIndent: "2em",
    tex2jax: {
       inlineMath: [ ['$','$'], ['\\(','\\)'] ], 
displayMath: [ ['$$','$$'], ['\\\[','\\\]'] ],
      processEscapes: true
    }
  });  
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

Then on those pages everything between dollar signs will be interpreted as LaTeX code and rendered accordingly.
Thanks Bacterius. I tried something like this too.. But google sites don't recognize javascripts.. I wish I could explain this better but I am a total newbie when it comes to websites, HTML, MathJax, JS, PHP.
 
Last edited:
What kinds of code do you have permission to use on the site? Finding a way to render $\LaTeX$ online isn't the problem, as there are many free sites that allow this. The tricky part is making the input user friendly and avoiding the horribly long string of code you posted in the OP.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
25K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
5K