GeneralControlling hyphenation for words globally?

LaTeX specific issues not fitting into one of the other forums of this category.
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Controlling hyphenation for words globally?

Post by benowar »

Hi,

I found out that for some words hyphenation is totally wrong. Now, instead of changing every word to use "\-" at the right position, is there any way to define the correct hyphenation of a word globally? That way I could once and for all define how a certain word was hyphenated and dont have to go through the 180 pages of my book.

Thanks,
Ben

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Controlling hyphenation for words globally?

Post by balfonsi »

There may be several reasons for your problem: do you write in english or in a language with accented letters? In the last case you may have problems if you don't use the T1 encoding. Are the correct hyphenation patterns for your language loaded? If you write in english, do you need the american or the british ones? Finally, there exists a 'hyphenation' command which lets you specify in your preamble the hyphenation points of such and such word. Take a look at the UK TeX FAQ, questions 271--278 for details.

Regards,
B.A.
Andy22
Posts: 16
Joined: Wed Jul 25, 2007 10:11 am

Controlling hyphenation for words globally?

Post by Andy22 »

You can use

Code: Select all

\hyphenation{in-ter-net}
to force the hyphenation of "internet" globally.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Re: Controlling hyphenation for words globally?

Post by localghost »

It would be very interesting what you do in your preamble to control hyphenation.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Controlling hyphenation for words globally?

Post by benowar »

Thanks for the replies! I am writing in German and there is several words where the hyphenation is wrong and some cases where the hyphenation is unusual (e.g. "Suchergebnis" gets "Sucher-gebnis" but it should be "Such-ergebnis").

Here is some details from my header.tex:

\documentclass[
pdftex,
11pt,
a4paper,
pagesize,
%DIVcalc,
BCOR12mm,
smallheadings,
halfparskip,
plainheadsepline,
plainfootsepline,
openright,
]{scrbook}

\usepackage{german, ngerman}
\usepackage[german]{babel}

\usepackage[latin1]{inputenc}

I will try the hyphenation command too!
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Controlling hyphenation for words globally?

Post by benowar »

Hm I tried setting

Code: Select all

\hyphenation{Such-ergeb-nisse}
but it did not change anything. Maybe some commands I use in my header is not compatible with this command?
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Controlling hyphenation for words globally?

Post by balfonsi »

Are you sure you can load simultaneously german and ngerman? Take a look at your log file.

B.A.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Controlling hyphenation for words globally?

Post by localghost »

Forget the packages german and ngerman, because these are obsolete. Only use the babel package with the ngerman option. Add the fontenc package with the T1 encoding option to enable Cork Encoding for better hyphenation.

Code: Select all

\documentclass[
pdftex,
11pt,
a4paper,
pagesize,
%DIVcalc,
BCOR12mm,
smallheadings,
halfparskip,
plainheadsepline,
plainfootsepline,
openright,
]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
…
The fontenc package serves in every language for better hyphenation, not only in German.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Controlling hyphenation for words globally?

Post by benowar »

Hm, I tried to follow your instructions but the result is very weird now. See the attached screenshot. Here is the full header.tex I am using now:

Code: Select all

\documentclass[
	pdftex,
	11pt,
	a4paper,
	pagesize,
	%DIVcalc,
	BCOR12mm,
	smallheadings,
	halfparskip,
	plainheadsepline,
	plainfootsepline,
	openright,
]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{url}

\usepackage{fixltx2e}

% Theoreme
\usepackage{amsmath, amsthm, amssymb}
\usepackage{paralist}

%Änderung der Tabulatoren ist möglich. Außerdem können Zeilennummern hinzugefügt werden
\usepackage{moreverb}

%Zum Einbinden von Grafiken
\usepackage{graphicx}

%Source-Code printer for LaTeX:
\usepackage{listings}

\usepackage[square]{natbib}
\usepackage[babel,german=quotes]{csquotes}
\usepackage{color}
\usepackage{textcomp} %Für Sonderzeichen

\usepackage{tabularx}
\usepackage[table]{xcolor}

\usepackage{booktabs}
\usepackage{array}

% --- Kopfzeilen mit Koma ---
% Linien auf alle Seiten oben und unten um Kopf- und Fußzeilen abzutrennen
\usepackage{scrpage2}

\usepackage{microtype} % optischer Randausgleich

% --- Grafiken sofort plazieren ---
\usepackage{float}
%\floatplacement{figure}{H}

% --- mehrere Literaturverzeichnisse ---
\usepackage[resetlabels]{multibib}
\newcites{www}{Internet-Quellen}

% --- pdf and hyperlink support. should be last in package list ---
\usepackage[
	bookmarks=true,
	bookmarksopenlevel=3,
	bookmarksopen=true,	
	bookmarksnumbered=true,
	linkbordercolor={1 1 1},
	citebordercolor={1 1 1},
	urlbordercolor={1 1 1},
	pdfstartview={FitH}
	linktocpage=true % fix fuer lange ueberschriften
	plainpages=false,% correct hyperlinks
]{hyperref}

%% --- Schusterjungen und Hurenkinder verhindern. Siehe deutsches TeX-FAQ (6.1.3) ---
\widowpenalty = 10000
\clubpenalty = 10000
\displaywidowpenalty = 10000
\raggedbottom

% Definition von Farbwerten
\definecolor{lightgray}{rgb}{0.95,0.95,0.95}
\definecolor{gray}{rgb}{0.90,0.90,0.90}
\definecolor{darkred}{rgb}{0.5,0,0}
\definecolor{darkgreen}{rgb}{0,0.5,0}
\definecolor{darkblue}{rgb}{0,0,0.5}
Btw this seems to be caused by using

Code: Select all

\usepackage[T1]{fontenc}
Attachments
Weird output
Weird output
img.png (34.67 KiB) Viewed 16010 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Controlling hyphenation for words globally?

Post by meho_r »

benowar wrote: Hm I tried setting

Code: Select all

\hyphenation{Such-ergeb-nisse}
but it did not change anything. Maybe some commands I use in my header is not compatible with this command?


Keep in mind that ''Such-ergeb-nisse'' will do the job for EXACTLY that word: ''suchergebnisse''. It will not be applied, i.e., for ''suchergebnis'' and similar words. You should specify all forms of word you want hyphenated.
Post Reply