1

I am new to Latex, I apologize for the very basic question in advance.

I just cannot make Latex breake the words correctly, or adjust the spacement of words properly so that I have a straight line at the right of the text, in a "justified" format, a Microsoft Word-user would call.

Instead, I keep getting these "Overfull /hbox" warnings and this awful effect:

Ugly right-side border

I am using the AGU Template in Overleaf.

This piece of codes reproduce the effect. Every single paragraph gets a warning of "Overfull \hbox".

\documentclass[draft]{agujournal2019}
\usepackage{url} 
\usepackage{lineno}
\usepackage[inline]{trackchanges} 
\usepackage{soul}
\linenumbers
\draftfalse
\journalname{Enter journal name here}

\begin{document}

\title{=enter title here=}
\authors{=list all authors here=}
\affiliation{=number=}{=Affiliation Address=}
\correspondingauthor{=name=}{=email address=}

\section{My Section}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, purus quis fringilla vulputate, enim metus placerat urna, id varius tortor justo ac leo. Donec a euismod felis. 

Nulla venenatis lectus convallis pretium auctor. Phasellus tincidunt lorem quis lacus aliquam, ut fringilla dui pharetra. Quisque imperdiet metus sem, sit amet semper mauris sollicitudin quis. 

Vestibulum tortor urna, porttitor sit amet accumsan vitae, faucibus mattis velit. Aliquam mi dolor, vehicula sit amet nunc venenatis, efficitur ultricies eros.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis vitae turpis ac ornare. Nulla sollicitudin, nunc vehicula vehicula finibus, nulla enim facilisis leo, id rutrum massa nulla ut magna. Sed cursus tincidunt elit, vulputate placerat nisl eleifend eu. Pellentesque venenatis justo ante. Cras eget ullamcorper lectus. 

In fermentum fringilla porta. Praesent porta, ipsum nec ultrices porta, elit tortor eleifend ligula, ut sodales urna libero ac lectus. In nec nisl eu eros fermentum consectetur. 

Sed sodales massa at elit tincidunt consequat. Donec euismod facilisis mattis. Morbi semper lectus at condimentum convallis. Donec condimentum libero quis velit maximus malesuada. Quisque fermentum tristique venenatis. Pellentesque nec libero augue.

\acknowledgments
Enter acknowledgments, including your data availability statement, here.

\bibliography{ enter your bibtex bibliography filename here }

\end{document}

A full (all auxiliary files) reproducible example is available here.

Thank you for your advice.

5
  • 3
    please show a small example, the output that you show looks like \RaggedRight from the ragged2e package, the default settings would never produce that layout. Commented May 16, 2019 at 13:37
  • I added a link to a shared project in Overleaf, where anyone can have access through the link provided.
    – ouranos
    Commented May 16, 2019 at 14:22
  • I found it difficutl to show a "small example", because the problem is in a ready template, so I cannot know exactely where it comes from. Thus, I edited the question sharing a project example in Overleaf where this is reproduced.
    – ouranos
    Commented May 16, 2019 at 14:23
  • 1
    Please make examples inline here on this site (the question is archived forever and will not be understandable if the link breaks) If you really can not, at least make the external link not require an account at the other site. Commented May 16, 2019 at 14:24
  • Done. I inserted a piece of the .tex file, and a link to a Dropbox folder where everything can be downloaded, since there are some .sty and .cls files in the project too.
    – ouranos
    Commented May 16, 2019 at 14:41

1 Answer 1

2

As I guessed from the image as posted in the original question, the class file has

%% \RaggedRight makes the right margin go in and out; if this is commented out
%% the default will be a right justified margin.
\RequirePackage{ragged2e}
\RaggedRightParindent=24pt
\advance\RaggedRightRightskip 24pt
\RaggedRight

So by design the right margin is ragged. You could of course disable this (comment out the last line for example) but the whole point of a journal class is to remove style choice from the author and enforce the journal house style.

3
  • I understand your point, and that solves the problem. Would there be a way to keep the journal house style, and at the same time get rid of all the warnings? They are so annoying.
    – ouranos
    Commented May 16, 2019 at 14:55
  • 1
    @ouranos the warnings are specific to your text, I didn't download all the files, just looked at the class file source. The example in the image is trying to hyphenate mock latin text with american english hyphenation rules, so bad line breaks and warnings are expected. You can turn off the warnings, see tex.stackexchange.com/questions/50830/… Commented May 16, 2019 at 15:24
  • I get all the warnings using English as well. Thanks for the explanation. Seems like the forced style brings the warnings.
    – ouranos
    Commented May 16, 2019 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .