18

In my Tex, the word "Wikipedia" does not break down in the end of lines, therefore I always have "overfull hbox" problem.

Details:

it is a loooo-
oooo word

it is a long Wikipedia 
word

In the second case, the word "Wikipedia" does not break down automatically, so the line is too long.

How could I fix the problem?

Thanks a lot

7
  • 1
    Depending on the language in use, have you added possible breakpoints (using babel shorthands or TeX default)?
    – Johannes_B
    Jul 20, 2016 at 13:22
  • Hello, I am using ACM conference template without adding any babel support. Jul 20, 2016 at 13:24
  • 5
    Just add \hyphenation{wiki-pedia} before \begin{document}. However, since “encyclopedia” is hyphenated as en-cy-clo-pe-dia, you may want to do \hyphenation{wiki-pe-dia}
    – egreg
    Jul 20, 2016 at 13:29
  • 2
    @egreg: why don't you add that as an answer, so we're cutting down on the list of unanswered questions?
    – JPi
    Jul 20, 2016 at 13:43
  • 1
    I would advice against hyphenating names, which Wikipedia is. However, some might argue that since it is so commonly attributed to all things wiki, I guess one could under some circumstances hyphenate it.
    – Runar
    Jul 20, 2016 at 15:14

1 Answer 1

32

It's true that by default “Wikipedia” is not hyphenated:

\documentclass{article}
\usepackage{showframe}

\begin{document}

wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia

\end{document}

enter image description here

Solution: add \hyphenation{wiki-pe-dia}

\documentclass{article}
\usepackage{showframe}

\hyphenation{wiki-pe-dia} % like en-cy-clo-pe-dia

\begin{document}

wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia
wikipedia wikipedia wikipedia wikipedia wikipedia

\end{document}

enter image description here

If babel is used, the appropriate command is

\babelhyphenation{wiki-pe-dia}

which will set the hyphenation for all declared languages.

12
  • 4
    Why not wi-ki-pe-dia?
    – KRyan
    Jul 20, 2016 at 19:41
  • 2
    @KRyan I don't like to split “Wi-kipedia”, but that's just personal preference. I can tell you that Barbara Beeton has added the hyphenation wiki-pe-dia to the list of exception. See chat discussion at chat.stackexchange.com/transcript/message/31160649#31160649
    – egreg
    Jul 20, 2016 at 19:49
  • 1
    OK, sounds legit but I honestly have no idea what that is.
    – KRyan
    Jul 20, 2016 at 19:51
  • 3
    @KRyan since "wiki" is Hawaiian and "pedia" is derived from Greek, it's reasonable to prefer wiki-pedia. Also, since LaTeX is usually pretty good at formatting a complete paragraph, you don't really need to tell it every possible hyphenation point in a word. There are plenty of 4 and 5 letter English words that can't be hyphenated, so adding another two isn't going to hurt much. In fact there are even 9-letter English words with only one syllable, for example "strengths", so being unable to hyphenate "Wikipedia" at all isn't usually a problem for LaTeX...
    – alephzero
    Jul 21, 2016 at 0:14
  • 8
    @KRyan ... and you want to avoid hyphens that mislead the reader. "wikipe-..." might be misread with a long I and a silent E, but it's not as bad as "the-rapist" or "wee-knights".
    – alephzero
    Jul 21, 2016 at 0:19

You must log in to answer this question.

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