0

I am getting the following Overfull \hbox (0.10945pt too wide) in paragraph at lines 12--13. How could I prevent this?

I am using \, inside \dotuline because I want to use a little bit longer dotted underline.

\documentclass[12pt]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm, noheadfoot]{geometry}
\usepackage[dot]{dashundergaps}

\setlength\parindent{0pt}

\begin{document}

Lorem \dotuline{\,\,LoremLoremLoremLoremLoremLoremLoremLorem LoremLoremLoremLoremLorem\,\,} Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem Lorem

\end{document}

UPDATE

\documentclass[12pt]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm, noheadfoot]{geometry}
\hyphenation{Lor-em}
\usepackage[dot]{dashundergaps}

\setlength\parindent{0pt}

\begin{document}

Lorem \dotuline{\,\,Lor\-emLor\-emLor\-emLor\-emLor\-emLor\-emLor\-em} Lor\-em Lor\-emLor\-emLor\-emLor\-emLor\-emLor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em Lor\-em

\end{document}

In this case I am getting the following Overfull \hbox (20.50162pt too wide) in paragraph at lines 13--14

4
  • 1
    why do you have \setlength\parindent{0pt} as you are not setting \parskip you make it very difficult to distinguish paragraphs. Dec 26, 2022 at 22:31
  • @DavidCarlisle cuz I do not want indention. After each paragraph I use ˛\vskip 1cm
    – mala97
    Dec 26, 2022 at 22:44
  • \newcommand{\newpara}{\vskip 1cm} I think this is better looking, or is there a better way?
    – mala97
    Dec 26, 2022 at 22:47
  • 1
    do not mark each paragraph space. the paragraph layout is a global property of the document. Just use a blank line to end a paragraph, add \usepackage{parskip} and paragraphs will be marked with vertical space rather than indentation. Dec 26, 2022 at 23:39

1 Answer 1

2

Your string of Lorems simply stretches past the line limit, and TeX can't find a good place to end the line (before the Lorem would add too much space, and inserting the break afterward, which it does, overfills the hbox). (This is unrelated to your \dotuline).

Try locating which "Lorem" TeX inserts a line break after, and insert a discretionary hyphen (\-) in it somewhere to tell TeX to allow a break there (eg Lor\-em).

You could also add \hyphenation{Lor-em} to your preamble to let TeX know that whenever it encounters a Lorem it needs to break up, it can insert a discretionary hyphen between the r and e.

2
  • I have just added an UPDATE to my question. As you can see I am still getting the same error.
    – mala97
    Dec 26, 2022 at 20:49
  • 3
    @mala97 now you have no spaces between many of your "Lor\-em"s, which still leads to the same issue (you have unbreakable "emLor"s). Also, instead of doing many Lor\-ems, perhaps just put \hyphenation{Lor-em} in your preamble.
    – Slurp
    Dec 26, 2022 at 20:54

You must log in to answer this question.

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