7

When I was learning to drive a typewriter (shortly after the death of my pet sabre-tooth), I picked up the habit of using a double hyphen when splitting compound words, thus:

The system has a high-
-performance component

I've read babel: Adding ngerman' s language shorthands to english as the main document language, and Stefan's answer to What's the benefit of loading babel when writing in English?, and thought this would do the trick:

\documentclass[draft]{article}
\usepackage[ngerman,british]{babel}
\useshorthands{"}
\addto\extrasbritish{\languageshorthands{ngerman}}
\selectlanguage{british}
\begin{document}
\noindent
Normal hyphenation, to illustrate:\\ 
\begin{minipage}{80pt}
Lala High"=performance.
\end{minipage}
\\[2pc]
\begin{minipage}{80pt}
Lalala lalala High"=performance.
\end{minipage}
\\[2pc]
My best guess:\\
\begin{minipage}{80pt}
Lala High"="~performance.
\end{minipage}
\\[2pc]
\begin{minipage}{80pt}
Lalala lalala High"="~performance.
\end{minipage}
\end{document}

It looks like the sequence "="~ is close to what I want, but it suppresses hyphenation of the parts.

I've now spent about two hours trying all kinds of combinations, but as I don't really understand what I'm doing, I thought it better to ask, here, someone who actually knows.

I could, of course, use the \discretionary command, but I'd prefer it to be automatic.

BTW, typographical criticism is welcome (such as "don't do that!"), but I'd still like to know, even if just out of curiosity.

  • "="~ would be a wrong hyphenation of compound words in german and I suppose in english, too. – user2478 Nov 17 '11 at 14:10
  • @Herbert: Are you saying my sample quote at the top is terminally incorrect typography? (Just to clarify your comment, which you have every right make...). Or just a question of style? – Brent.Longborough Nov 17 '11 at 14:13
  • High"=performance is correct, only one dash, hyphenated or not – user2478 Nov 17 '11 at 14:16
  • Sincere condolences on the death of your pet sabre-tooth. - I have not seen text- newline -text in German, thus I would not advise it. – Stephen Nov 17 '11 at 18:41
8
\useshorthands{"}
\makeatletter
\declare@shorthand{ngerman}{";}{\discretionary{-}{-}{-}\bbl@allowhyphens}
\makeatother
\addto\extrasbritish{\languageshorthands{ngerman}}

Now "; (choose another shorthand, if you prefer) will do what you're looking for:

\begin{minipage}{80pt}
Lalala lalala High";performance.
\end{minipage}

will typeset as

Lalala lalala High-
-performance.

but

\begin{minipage}{80pt}
Lala High";performance.
\end{minipage}

will typeset as

Lala High-per-
formance.

Don't do it. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.