LaTeX forum ⇒ Fonts & Character SetsHyphenation in title page with ngerman Topic is solved

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

Hyphenation in title page with ngerman

Postby trophi20 » Fri Feb 19, 2021 12:06 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[12pt, ngerman]{report}
  2. \usepackage[ngerman]{babel}
  3.  
  4. \title{Title with hyphenation Test"=Test}
  5. \author{My name}
  6. \date{\today}
  7.  
  8. \begin{document}
  9. \maketitle
  10. Here the hyphenation is working: Test"=test. \\
  11. \end{document}

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

Postby Ijon Tichy » Fri Feb 19, 2021 1:06 pm

babel shorthands are deactivated after \begin{document} but not before, because before they could break packages:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[12pt, ngerman]{report}
  2. \usepackage{babel}% babel also recognizes the global option ngerman from \documentclass
  3.  
  4. \begin{document}
  5. \title{Title mit Bindestrich Test"=Test}
  6. \author{Mein Name}
  7. \date{\today}
  8. \maketitle
  9. Hier funktioniert der Bindestrich auch: Test"=test.
  10. \end{document}
Last edited by Ijon Tichy on Fri Feb 19, 2021 2:16 pm, edited 1 time in total.

trophi20
Posts: 7
Joined: Thu Apr 02, 2020 7:17 pm

Postby trophi20 » Fri Feb 19, 2021 1:33 pm

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: 415
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Fri Feb 19, 2021 2:20 pm

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.


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 1 guest