Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
"="~ would be a wrong hyphenation of compound words in german and I suppose in english, too. –  Herbert 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 –  Herbert 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

1 Answer 1

up vote 7 down vote accepted
\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. :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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