# Tag: LaTeX

## Science via email

One thing scientists and engineers have to do daily is discuss collaborative work via email exchanges. This often includes the need to share and discuss mathematical equations and to represent variables with subscripts and superscripts or special characters; something that is tricky when you are emailing in plain text.

WikiImages / Pixabay

Of course it is possible to work around this problem! Email was invented by scientists, and for decades they have been communicating in this manner, using various conventions to convey the correct information using plaintext. However, if you are a Gmail user there is a nice extension that will make your equations look proper good.

## Tex for Gmail

TeX for Gmail is a Chrome browser extension that checks a Gmail email that you are writing for LaTeX markup and converts the markup to a visually prettier equation, using one of two modes. In Simple Math mode, subscripts and superscripts are correctly formatted but the current font is maintained and text remains ediatble. In Rich Math mode, the equation is rendered into TeX and replaced by an embedded image.  The email recipient doesn’t need the extension installed on their browser in order to read your nice equations!

### Example

Original markup:

\$E = mc^{2}\$

Simple Math mode:

E = mc2

Rich Math mode:
$\dpi{300}\inline E = mc^{2}$

## Issues

One problem; once the extension has converted my markup to formatted text, I cannot get the markup back. So editing a small mistake usually means re-doing all the curly brackets and other stuff that a TeX equation requires. The only workaround seems to be to stay vigilant and use Undo (Ctrl-z), but this doesn’t work when you notice a mistake in an equation that you wrote a while ago. One improvement could be the option to restore any equation to the original markup.

## Conclusions

Overall, a great little tool to improve the clarity of science and maths communications over email. With a few small improvements it could be even better but it is already very usable.

### LaTeX overfull hbox errors (and how I fixed mine)

If you have ever written a journal article or thesis using LaTeX then you probably came across lots of errors and warnings in the process. Those warnings can usually be ignored as they don’t stop the document from compiling, and many of us who just want to cross the finishing line probably never investigate what was causing them.

One such common warning is the Overfull or Underfull /hbox message.

These usually occur through no fault of the author, but because LaTeX doesn’t know how to hy-ph-enate certain words. You see, LaTeX tries to typeset in a strict column width and has a dictionary of words that includes hyphenation information that tells it where the most logical places to split a word up are, with some order of priority. When it wants to flow text at the end of a line it can and does automatically hyphenate (usually longer) words to keep the character spacing constant while adhering to the strict column width.

What I have found is that certain words I was using were not in the LaTeX list of words and the /hbox problems were caused by LaTeX not knowing how to hyphenate them. Thus the column widths were being messed up. Such special words for me were micromagnetics, intergranular and so on.

By supplying forced hyphenation marks manually, e.g. micro\-mag\-net\-ics I was able to get rid of all the warnings.