Fonts & Character SetsHyphenation in title page with ngerman

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
trophi20
Posts: 7
Joined: Thu Apr 02, 2020 7:17 pm

Hyphenation in title page with ngerman

Post by trophi20 »

Hi,

I want to use german hyphenations in the title. But it's not working. Does somebody know, how to handle this?

Code: Select all

\documentclass[12pt, ngerman]{report}	
\usepackage[ngerman]{babel}

\title{Title with hyphenation Test"=Test}
\author{My name}
\date{\today}

\begin{document}
\maketitle
Here the hyphenation is working: Test"=test. \\
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Hyphenation in title page with ngerman

Post by Ijon Tichy »

babel shorthands are deactivated after \begin{document} but not before, because before they could break packages:

Code: Select all

\documentclass[12pt, ngerman]{report}	
\usepackage{babel}% babel also recognizes the global option ngerman from \documentclass
     
\begin{document}
\title{Title mit Bindestrich Test"=Test}
\author{Mein Name}
\date{\today}
\maketitle
Hier funktioniert der Bindestrich auch: Test"=test.
\end{document}
Last edited by Ijon Tichy on Fri Feb 19, 2021 2:16 pm, edited 1 time in total.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
trophi20
Posts: 7
Joined: Thu Apr 02, 2020 7:17 pm

Hyphenation in title page with ngerman

Post by trophi20 »

Ah okay, thanks @Ijon!

I didn't know that's possible to put the \title etc. into the document section.
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Hyphenation in title page with ngerman

Post by Ijon Tichy »

The KOMA-Script manual even recommends to do so and explains the reason.

BTW: \\ is not a paragraph and should not be used instead of paragraphs. Paragraphs should be set in source with an empty line or \par. And you should never place \\ at the end of a paragraph. Doing so can result in an empty line at the beginning of a page and breaks the paragraph builder of TeX.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply