4

I am writing a paragraph that includes chemical formulas using mhchem package. The problem is that I get overfull lines. Here is an example with my packages:

\documentclass[14 pt]{extarticle}
\usepackage{graphics,graphicx, epstopdf}
\usepackage[version=4]{mhchem} 
\usepackage{hyperref}
\usepackage{url}
\usepackage[articletitle]{achemso}
\usepackage{amsmath}
\usepackage{gensymb}

\newcommand{\RomanNumeralCaps}[1]
    {\MakeUppercase{\romannumeral #1}} 
    
    \usepackage{geometry}
\geometry{a4paper,left=3.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm}


\begin{document}
\frenchspacing

\section*{Abstract}
\normalsize The spinel binary (\ce{MgCr2O4},\ce{ZnFe2O4}) and ternary (\ce{ZnAl2Cr2O4}, \ce{WCu2Cr2O4}) mixed metal oxides (MMOs) were prepared by co-precipitation method for the catalyzed....

\end{document}

Can you please help me with that, because I'm facing this problem in almost every section in my research? Note: I'm about to rewrite my research using microsoft word just because of this problem, so I would really appreciate it if you save me from this exhausting task.

2 Answers 2

6

First, add a space after the first comma (between MgCr2O4 and ZnFe2O4) to give LaTeX more leeway to adjust horizontal spacing. Second the word "co-precipitation" can't be hyphenated because there's already a dash inside it. You can manually add another to say to LaTeX "it's okay to cut this word here". In your example: co-preci\-pitation gives good results.

3

First some necessary fixes to your code:

  1. the option is 14pt and not 14 pt;
  2. you should load neither graphics nor epstopdf;
  3. hyperref should be loaded last and url is not necessary because hyperref loads it.

After these fixes, the problem is still there. And with such long formulas, you'll incur in similar ones quite frequently.

The reason is that you want 14pt font size and you have chosen A4 paper with a line width of 15cm, and you get an average of about 50 characters per line, which is really too short.

My advice is to use 12pt size, if you want large font size, unless the copy is for visually impaired people (but then 14pt is probably too small). Alternatively, increase the line width.

With 12pt size you get

enter image description here

With left=2.5cm,right=1.5cm and 14pt size you get

enter image description here

In either case, be prepared to solve such problems by rewording.

1
  • Thank you! my department asked for a 14 font size in microsoft word, do you have any idea what corresponds to it in latex?
    – Naseebah
    Apr 3 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.