6

My babel configuration includes ngerman and english ...

\documentclass[
oneside, openright, titlepage,
dottedtoc, numbers=noenddot,
headinclude, footinclude=true,
cleardoublepage=empty, abstractoff,
BCOR=5mm, paper=a4, fontsize=11pt,
ngerman,
american,
draft
]
{scrreprt}

\PassOptionsToPackage{utf8}{inputenc}
\usepackage{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage[pdfspacing]{classicthesis}

\begin{document}

% Disable paragraph indentation.
\setlength{\parindent}{0pt}

9. Wie lange benötigen die Personen für die Erfassung/Aktualisierung
der Daten vor Ort und bei der Nachbearbeitung im Büro?\\

10. Verwenden Sie ein kommerzielles Hardware- oder Software-Produkt
für die Verwaltung\\

\end{document}

..., however, the hyphenation seems to be not working correctly, as I can see in draft mode.

German hypenation

Questions:

  • What do I need to configure in order to use auto-hyphenation?
  • Side question: Why do I need to add \\ to get an empty line between 9. and 10.?
David Carlisle
  • 757,742
JJD
  • 1,977
  • 4
  • 22
  • 36
  • 2
    Use "~ for dashes or "=. And /""... for the /. See the documentation of babel – topskip Aug 22 '12 at 17:09
  • 4
    Use \usepackage[english,ngerman]{babel}. Unless you say \selectlanguage later the last language in the option list is active. – cgnieder Aug 22 '12 at 17:09
  • 3
    Also words with dashes hyphens like Software-Produkt will only be hyphenated at the dash unless you follow @PatrickGundlach's advice and write Software"=Produkt. – cgnieder Aug 22 '12 at 17:18
  • Just in case you use LuaTeX: see the answers to the following question: http://tex.stackexchange.com/q/60435/243 – topskip Aug 22 '12 at 17:24
  • 2
    You may also want to use \slash instead of the / symbol; this tells LaTeX that it's OK to break the long "word" Erfassung/Aktualisierung after the slash. – Mico Aug 22 '12 at 17:30
  • When I add "- the word gets hyphenated but still the " gets printed. – JJD Aug 22 '12 at 17:44
  • @PatrickGundlach When I add "= both characters get printed but no hyphenation happens. When I use "~ a " gets printed and no hyphenation applies. – JJD Aug 22 '12 at 17:47
  • @cgnieder Nice hint, no changes regarding the hyphenation though. – JJD Aug 22 '12 at 17:48
  • @Mico There is still no hyphenation when I use Erfassung\slash Aktualisierung. – JJD Aug 22 '12 at 17:52
  • @JJD these shorthands are only active with the (n)german language. Pass only the ngerman to babel or use \selectlanguage{ngerman} in order to use the shorthands. – topskip Aug 22 '12 at 18:05
  • What is the “\PassOptionsToPackage{utf8}{inputenc}\usepackage{inputenc}” good for? ´\usepackage[utf8]{inputenc}´ works fine! – Speravir Aug 22 '12 at 18:13
  • @Speravir Sorry, this is a fragment from an older setup. I did not clean the configuration. Thx for the advice. – JJD Aug 22 '12 at 18:24
  • @JJD: I think there are two separate issues here: First, because you haven't set "german" (or "ngerman") as the last-named language, German hyphenation rules aren't in effect. Second, use of \slash instead of / only serves to tell LaTeX that the preceding and following words are distinct (instead of one very long and complicated word); use of \slash by itself won't enable German-language hyphenation rules. – Mico Aug 22 '12 at 18:31
  • 2
    Another addition: I think, actually your problem is, that you already declared languages in the documentclass options. And once again: If you mostly want to use German in your document, you should change the order in the babel or (exclusive or) documentclass options – what Patrick said: Read the babel documentation. – Speravir Aug 22 '12 at 18:31
  • @Mico I also couldn't get \slash to work (and I made sure ngerman hyphenation was enabled). Not sure why... – cgnieder Aug 22 '12 at 18:48
  • 1
    Alternatively you could add another shorthand by saying \makeatletter\declare@shorthand{ngerman}{"/}{\penalty\@M/\hskip\z@skip}\makeatother and then use Erfassung"/Aktualisierung – cgnieder Aug 22 '12 at 18:49
  • @Speravir I ended up with the following: \documentclass[ngerman], \usepackage{babel} and without \selectlanguage{ngerman}. I think, a lot of my not working experience came from the fact that I need to run PDFLaTeX more than once. – JJD Aug 22 '12 at 18:53
  • @cgnieder - I think there's some kind of interaction I hadn't noticed before between babel (and the ngerman option) and the \slash command, which disables hyphenation after \slash. Fortunately, \slash\hspace{0pt} still works, but it's not nearly as elegant! – Mico Aug 22 '12 at 19:45

1 Answers1

8

You have to select the language that is used. So add \selectlanguage{ngerman} in front of German text and \selectlanguage{english}in front of english text.

The hyphenation is not working because LaTeX has problems to hyphenate Erfassung/Aktualisierung correctly. Insert (you are using babel) "- to mark the places a hyphenation can occur.

Use \begin{enumerate} to build well typesetted enumerations.

I added these thing in your MWE:

\documentclass[
oneside, openright, titlepage,
dottedtoc, numbers=noenddot,
headinclude, footinclude=true,
cleardoublepage=empty, abstractoff,
BCOR=5mm, paper=a4, fontsize=11pt,
ngerman,
american,
draft
]
{scrreprt}

\PassOptionsToPackage{utf8}{inputenc}
\usepackage{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage[pdfspacing]{classicthesis}

\begin{document}

% Disable paragraph indentation.
\setlength{\parindent}{0pt}
\selectlanguage{ngerman}
\begin{enumerate}
  \item Wie lange benötigen die Personen für die Erfassung/Aktuali"-sierung 
    der Daten vor Ort und bei der Nachbearbeitung im Büro?
  \item Verwenden Sie ein kommerzielles Hardware- oder Software-Produkt
    für die Verwaltung
\end{enumerate}

\end{document}
Mensch
  • 65,388
  • 1
    @JJD when you remove the american/ngerman from the global option list, you can see the differences in the order for babel by using the "= and similar shorthands. – topskip Aug 22 '12 at 18:07
  • 1
    @PatrickGundlach When I use \usepackage{babel} with \selectlanguage{ngerman} and put "= or "- it still works. Sorry for my confusion. – JJD Aug 22 '12 at 18:16
  • 2
    And I thought German didn't hyphenate because those Germans (I am one culturally, too) much prefer the look of Verylongcompoundwordswithouthyphenationjusttoconfusethefrench. Silly me. – Steven B. Segletes Jan 09 '15 at 19:22