How to break words into syllables in LaTeX correctly
Asked Answered
Z

1

20

I am writing my MSc with LaTeX and I have the problem that sometimes my words are divided in a wrong way.

My language is spanish and I'm using babel package.

How could I solve it?

For example: propuestos appears prop-uestos (uestos in next line). It should be pro-puestos.

Thanks!!

Zymotic answered 29/9, 2010 at 15:29 Comment(1)
I'd be nice to move this question to tex.stackexchange.comSegno
D
32

If you only have a small number of hyphenation errors to correct, you can use \hyphenation to fix them. For instance: \hyphenation{pro-puestos}. This command goes after \documentclass and before \begin{document}.

You can put more than one dash in, if you want to give TeX more line-breaking options: \hyphenation{tele-mun-dos}. You can list many words inside the braces; put spaces between them.

If more than a handful of words are wrong, though, TeX is probably using hyphenation patterns for the wrong language -- and if "propuestos" were an English word, it would be hyphenated after "prop", so that's another point in favor of that theory. Do you get a message like this when you run LaTeX?

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language `Spanish'
(babel)                I will use the patterns loaded for \language=0 instead.

If so you need to reconfigure your TeX installation with Spanish hyphenation turned on. There should be instructions for that in the manuals that came with the installation. Unfortunately, this is one of the places where TeX's age shows through -- you can't just load a package with the proper hyphenation rules (or Babel would do that); you have to do it when compiling the "base format" with INITEX, which is a maintenance operation. Modern TeX installations have nice utilities for that but they're all different and I don't know which one you're using.

Dikmen answered 29/9, 2010 at 15:39 Comment(3)
I'm not sure if I understand you, I'm pretty new in LaTeX. Some of my words are OK, but not all (maybe 30% wrong). I am using Latex Editor (LEd), where can I check that configuration? If I use \hypenation I have to add that in my main document or in the word? Thanks a lot :)Zymotic
I edited my answer with more instructions for how to use \hyphenation. At 30% errors, though, I would bet on the language configuration being wrong. I don't know anything about LEd, sorry, but the place to tweak is probably not the editor, but TeX itself (MikTeX or TeXLive or something like that).Dikmen
I also have MikTeX so probably is there... anyway thanks Zack )Zymotic

© 2022 - 2024 — McMap. All rights reserved.