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

  • LaTeX
  • Thread starter caffeinemachine
  • Start date
  • Tags
    Google Latex
In summary, the conversation discusses the use of math symbols and LaTeX on a Google Site. One person suggests using MathJax for better alignment, but the other is not familiar with it. They also discuss adding a script to enable MathJax on the site, but the person is not familiar with HTML and JavaScript. The conversation ends with a suggestion to check out a link for converting LaTeX to HTML and a question about what types of code are allowed on the site.
  • #1
caffeinemachine
Gold Member
MHB
816
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
  • #2
We use MathJax here, which provides very nice alignment of text and $\LaTeX$. Is there a way you could install MathJax on your site?
 
  • #3
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.
 
  • #4
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. :eek: 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.
 
  • #5
Last edited:
  • #6
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.
 

1. Why does LaTeX look so ugly on Google sites?

Google sites use a limited version of LaTeX called MathJax, which has fewer features and customization options compared to the full version of LaTeX. This can result in the appearance of equations and symbols being less aesthetically pleasing.

2. Can I improve the appearance of LaTeX on Google sites?

Yes, you can improve the appearance of LaTeX on Google sites by using HTML and CSS to style the equations and symbols. You can also try using different fonts and sizes to make the equations more visually appealing.

3. Why do some symbols or equations not show up correctly on Google sites?

This could be due to compatibility issues between MathJax and the specific symbol or equation you are trying to display. It is also possible that there is a mistake in the code or formatting of the equation.

4. Is it possible to use the full version of LaTeX on Google sites?

No, Google sites only support the use of MathJax for displaying equations and symbols. However, you can create your equations using the full version of LaTeX and then use an online converter to turn them into images, which can then be inserted into your Google site.

5. Are there any alternatives to using MathJax for displaying LaTeX on Google sites?

Yes, you can use third-party tools and plugins such as KaTeX or Codecogs to display equations on Google sites. These tools offer more customization options and may result in a more visually pleasing display of equations and symbols.

Similar threads

  • General Math
Replies
1
Views
923
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
280
  • MATLAB, Maple, Mathematica, LaTeX
Replies
15
Views
25K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Replies
4
Views
3K
Back
Top